aleale72:
Select the order in question and then check it's OrderCloseTime() if it's open it will return 0
Hi,
how can I detect (in mt4) if an order with ticket v_ticket is open or was closed by stoploss or takeprofit ?
Thanks a lot.
Alessandro
RaptorUK:
Select the order in question and then check it's OrderCloseTime() if it's open it will return 0
Select the order in question and then check it's OrderCloseTime() if it's open it will return 0
RaptorUK:
Select the order in question and then check it's OrderCloseTime() if it's open it will return 0
Select the order in question and then check it's OrderCloseTime() if it's open it will return 0
and How to detect if it was closed for tp or sl ?
Thanks in advance.
RaptorUK:
Check it's OrderClosePrice() vs it's OrderStopLoss() and OrderTakeProfit()
Check it's OrderClosePrice() vs it's OrderStopLoss() and OrderTakeProfit()
But stoplosses and take profits can have slippage, right? Need to have a little leeway
Keep a record of every order you, or your EA closes. If you didn't close it then it must be one of these:
-Stoploss
-Takeprofit
-Stopout
I don't think there any other possibilities.
and it might be in closed trade you find in the OrderComment() [tp] or [sl]
- Some brokers modify comments with [tp] or [sl] other's don't. Don't depend.
double distTP = MathAbs( OrderClosePrice() - OrderTakeProfit() ), distSL = MathAbs( OrderClosePrice() - OrderStopLoss() ); bool ClosedBySL = distSL < distTP;
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
how can I detect (in mt4) if an order with ticket v_ticket is open or was closed by stoploss or takeprofit ?
Thanks a lot.
Alessandro