IN THE ABOVE PROGRAM "I AM HERE" IS NEVER PRINTED...
I HAV A ALSO TRIED OPEN[0]-CLOSE[0]==-0.0002..BUT THIS CONDITION NEVER RETURNS TRUE AND PRINT IS NEVER PRINTED..
double f=MathAbs(iOpen(NULL,30,0)-iClose(NULL,30,0)); Print(f); double d=0.0002; if((iOpen(NULL,30,0)-iClose(NULL,30,0))==d) { Print("I AM HERE"); }
results on backtesting:-
2012.11.10 17:22:42 2012.11.09 23:59 BEST EXPERT EURUSD,M30: 0.0004
2012.11.10 17:22:42 2012.11.09 23:51 BEST EXPERT EURUSD,M30: 0.0001
2012.11.10 17:22:42 2012.11.09 23:50 BEST EXPERT EURUSD,M30: 0.0002
2012.11.10 17:22:42 2012.11.09 23:50 BEST EXPERT EURUSD,M30: 0.0001
2012.11.10 17:22:42 2012.11.09 23:50 BEST EXPERT EURUSD,M30: 0.0002
2012.11.10 17:22:42 2012.11.09 23:49 BEST EXPERT EURUSD,M30: 0.0001
2012.11.10 17:22:42 2012.11.09 23:48 BEST EXPERT EURUSD,M30: 0
2012.11.10 17:22:42 2012.11.09 23:48 BEST EXPERT EURUSD,M30: 0.0002
but still the print command never executes..
Please don't double post, especially making a question in 2009 topic, you probably won't get the answer from the poster.
What you doing is comparing double type variable, which is difficult to do. Why don't you print the real value of iOpen(NULL,30,0)-iClose(NULL,30,0) up to 8 digits after decimal point, and see for your self
double f = iOpen(NULL,30,0)-iClose(NULL,30,0); Print(DoubleToStr(f, 8));
The solution, you may want to convert the value into integer type.
See also : Can price != price ? and https://www.mql5.com/en/forum/140534

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use