Download MetaTrader 5

a small bug about very simple codes

To add comments, please log in or register
Fa Cao
1141
Fa Cao  
          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
6385
Tjipke de Vries  
whroeder1
15924
whroeder1  
  1. The == operand. - MQL4 forum
  2. Print uses 4 places. Print the full price PriceToStr()

Fa Cao
1141
Fa Cao  
thanks all
To add comments, please log in or register