How to find whether my previous order closed with s/l or t/p?

 

Hi,

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

please advise me to find?

 

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

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

 
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);
Reason: