check if an order was closed @ take profit or @ stop loss
Alberto Tortella: One way is to compare the OrderClosePrice() with
OrderTakeProfit() and OrderStoploss(), but may be there is a smarter way.
-
bool closeBySL = MathAbs( OrderClosePrice() - OrderStopLoss() ) < MathAbs( OrderClosePrice() - OrderTakeProfit() );
- Not a good idea to use comments, brokers can change comments,
including
complete replacement. Not all brokers modify comments with
[SL] or [TP]
Hi all, is there a quick way to check in the Order History if an order was closed @ tale profit (green) or @ stop loss (red) ?
One way is to compare the OrderClosePrice() with OrderTakeProfit() and OrderStoploss(), but may be there is a smarter way.
Thank you!