[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 27

 

Good afternoon, dear moderators and forum residents !

This is my first time coming here and the reason for my appearance here is quite simple - I started to study MQL4.

Of course, as it always happens when I'm confronted with something new, I have some questions about the understanding of some concepts in MQL4.

I've been trading forex for several years now, and I've got some thoughts and ideas that I want to express in the form of an indicator or, better yet, Expert Advisor. I really hope for your help and tolerance to my probably stupid questions.

If I got to the wrong forum thread by mistake, please tell me where to go.


Regards, GGeoZ

 
The branch, what is the question?
 
JavaDev >> :
The thread that, what's the question?

I assume it's foreplay, familiarity.

 

From the textbook: Data Types - Type double-.

A program has opened 12 orders during a week. What type should variable A be that takes into account the average number of orders opened by this program per day? The answer is obviously A = 12 orders / 5 days. So, the variable A = 2.4 should be considered in the program as double since this value has a fractional part. And what type should this variable A be if the total amount of orders opened during the week is 10? It would seem that if 2 (10 orders / 5 days = 2) has no fractional part, we can consider variable A to be of int type. But this reasoning is wrong. The current value of some variable can have a fractional part consisting of zeros only. But the important point is that the value of this variable is intrinsically valid. In this case, variable A must also be of type double, and when writing the constant in the program, the separating dot is necessarily displayed: A = 2.0.....

Questions:

1.

 

Somehow the questions from the previous post disappeared...

Questions:

1. What is meant here by "valid numbers", "valid in nature"?

2. How to determine what type an integer belongs to, int or double?

3. Where do these values come from: The interval of values of type double is between -1.7 * e-308 and 1.7 * e308...?

 
GGeoZ >> :

Somehow the questions from the previous post disappeared...

Questions:

1. What is meant here by 'valid numbers', 'valid in nature'?

2. How do you determine which type an integer belongs to, int or double?

3. Where do these values come from: The interval of values of type double is between -1.7 * e-308 and 1.7 * e308...?

Wiki Double

How to determine - simple example

Price double

double price = 1.23456;

Order ticket number int; (well, it cannot be fractional - it makes no sense)

int ticket = OrderSend(...);

 

Thanks for the reply, JavaDev.....

...but basically my question was how to determine whether it is int or double when we have a WHOLE number, as in the example " And what type should this same variable A be if the total number of open orders for the week is 10? It would seem that if 2 (10 orders / 5 days = 2) has no fractional part, then variable A can be counted as int. "

With a fractional number there is no question.

 
..to understand the meaning of "int ticket = OrderSend(...);" I unfortunately haven't got there yet :-)..... but thanks anyway, I'll get used to this language
 
GGeoZ >> :
...Unfortunately, I haven't understood the value "int ticket = OrderSend(...);"... :).

Got there, got there, just haven't realised it yet. :))

In this line the ticket variable is assigned a value returned by OrderSend(...) function, and it just returns the ticket number for the opened order.

int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)
Main function used to open a position or place a pending order.
Returns the ticket number assigned to the order by the trade server or -1 in case of failure
 

Good afternoon!

There is a form for calculating profit

The formula for calculating profit: [ ( Close price - Open price ) * Size_1_lot * Position_volume ]

If I have 1:200 leverage and I open a 0.1 lot, and 1:500 leverage and I open the same 0.1 lot, the profit will be the same with different leverage?

I've seen different profits on other forums so i'm stumped.

Reason: