Download MetaTrader 5
To add comments, please log in or register
Looking for like-minded people? You will find lots of them on the Forum!
Sherif Hasan
7221
Sherif Hasan 2014.12.05 17:24 

Hi,

i would like to find whether my previous order closed with s/l or t/p?

please advise me to find?

Carl Schreiber
5930
Carl Schreiber 2014.12.05 18:38  

1) Some brokers change the OrderComment()...

2) Loop through the OrdersHistoryTotal and compare OrderClosePrice with OrderStopLoss resp. OrderTakeProfit()

whroeder1
13593
whroeder1 2014.12.05 20:45  
gooly:

1) Some brokers change the OrderComment()...

2) Loop through the OrdersHistoryTotal and compare OrderClosePrice with OrderStopLoss resp. OrderTakeProfit()

  1. Some do. I wouldn't trust it.
  2. Can't use equality A) SL/TP are market orders when triggered will not be exact prices, and B) The == operand. - MQL4 forum https://forum.mql4.com/56002#801213 The == operand. - MQL4 forum
  3. // OrderSelect
    double OCP = OrderClosePrice();
    bool isTP = MathAbs(OrderTakeProfit() - OCP) > MathAbs(OrderStopLoss() - OCP);
/
To add comments, please log in or register