dralialadin:
Read this thread to the end: Can price != price ?
Dear,
I am getting problem about double value condition: I wrote code below:
double am0_13 = iMA(NULL,PERIOD_M5,MA2_5min,0,Mode_EMA,MaPrice,0);
double am1_13 = iMA(NULL,PERIOD_M5,MA2_5min,0,Mode_EMA,MaPrice,1);
in the chart MA1 show = 1.53977 and MA2 show = 1.53975
When I write alert(am0_13); am0_13 value show : 1.5398 and alert(am1_13) the value show also 1.5398
alert(am1_13-am0_13) show = 0. But it would be 0.00002
if((am1_13-am0_13)==0.00002) condition not work.
Please some one help me how if condition work. because it should be true but show false.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear,
I am getting problem about double value condition: I wrote code below:
double am0_13 = iMA(NULL,PERIOD_M5,MA2_5min,0,Mode_EMA,MaPrice,0);
double am1_13 = iMA(NULL,PERIOD_M5,MA2_5min,0,Mode_EMA,MaPrice,1);
in the chart MA1 show = 1.53977 and MA2 show = 1.53975
When I write alert(am0_13); am0_13 value show : 1.5398 and alert(am1_13) the value show also 1.5398
alert(am1_13-am0_13) show = 0. But it would be 0.00002
if((am1_13-am0_13)==0.00002) condition not work.
Please some one help me how if condition work. because it should be true but show false.