Download MetaTrader 5

a small bug about very simple codes

To add comments, please log in or register
Do you want to learn MQL5? 300 articles will help you!
Fa Cao
1141
Fa Cao 2014.01.26 08:24 
          if( Stop_Loss > OrderStopLoss() )
          { Print("Stop_Loss and OrderStopLoss():",Stop_Loss,",",OrderStopLoss());
            .........
          }

just as you see the code as above.

what is surprising is that I see the values of Stop_Loss and OrderStopLoss() are the same in journal of tester when i test back. so why these values can be printed if they are the same, ( if( Stop_Loss > OrderStopLoss() ))?

1. if i modify the codes as "if( Stop_Loss > OrderStopLoss() + Point)" from "if( Stop_Loss > OrderStopLoss() )", all is ok, why?

2. if i test the codes on USDJPY, all seems Ok; but on EURUSD, somethings seems very bad because of the above bug.

Tjipke de Vries
6315
Tjipke de Vries 2014.01.26 08:30  
whroeder1
14530
whroeder1 2014.01.26 13:58  
  1. The == operand. - MQL4 forum
  2. Print uses 4 places. Print the full price PriceToStr()

Fa Cao
1141
Fa Cao 2014.01.27 00:50  
thanks all
To add comments, please log in or register