Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 417

 

Does anyone know how to disable "trade averaging" in MQL5?

So that all trades will open individually and not merge into one huge one?

 
RomanRott:

Does anyone know how to disable "trade averaging" in MQL5?

So that all trades will open individually and not merge into one huge one?


Switch from netting to hedge account

 
RomanRott:

Does anyone know how to disable "trade averaging" in MQL5?

So that all trades will open individually and not merge into one huge one?

Averaging is done on a netting account. You need an account with hedging. It is specified when you open the account

 
Yurij Kozhevnikov :

Comparison of numbers with a floating point for equality

bool ( fabs (number1-number2) < _Point / 10 * 5 )
 
nicholishen:

Comparison of numbers with a floating point for equality


There is a floating point number, you may have converted it to an integer. There are also inverse warnings of type (int)

 
nicholishen:

Comparison of numbers with a floating point for equality


You are converting one number formation to another, you don't even need to look at the code.

Int

Double

is a different thing

 
Vladimir Zubov :

a floating-point number, perhaps you brought it to an integer. There are also backward warnings of type (int)

This method is accurate for testing the equality of two different doubles and is faster than NormalizeDouble(num1-num2,_Digits)==0.0
 
nicholishen:
This method is accurate for testing the equality of two different doubles and is faster than NormalizeDouble(num1-num2,_Digits)==0.0

int = 0;

or

double = 0.0;

is not correct!

 
Vladimir Zubov:

int = 0;

or

double = 0.0;

is not correct!

NormalizeDouble returns type double so either way you type it it is a double comparison. https://www.mql5.com/en/docs/basis/operations/relation
 
nicholishen:
NormalizeDouble returns type double so either way you type it it is a double comparison. https://www.mql5.com/en/docs/basis/operations/relation

If you have any questions, please contact the English branch