Please confirm that my understanding is correct

 
Hello,

Suppose I select an order using OrderSelect().

Are the following assumptions true?

1. if (OrderCloseTime() > 0 && OrderProfit() > 0.0)
then the order was closed because it reached the profit limit condition?

2. if (OrderCloseTime() > 0 && OrderProfit() < 0.0)
then the order was closed because it reached the stop loss condition?

3. What does it mean if (OrderCloseTime() > 0 && OrderProfit() == 0.0) ?

4. if (OrderCloseTime() == 0)
the order is still pending?

Best regards,
Levente
 
1. Properly thus: if (OrderClosePrice()== OrderTakeProfit()) means "the order was closed because it reached the profit limit level"

2. if (OrderClosePrice()== OrderStopPrice()) means "the order was closed because it reached the stop loss level"

3. That mean the pending order was deleted (or expirated).

4. Yes.

See "MQL4: Trading functions"
Reason: