JohnnyInamoto:
Can anyone tell me if it's possible to run through my trade history, using MQL, to find out if a specific trade was stopped out?
... but I would like to know if there is a variable that stores whether the reason it closed was because of the SL.
Just loop through the order history and compare the OrderClosePrice() to the OrderStopLoss().
- if the order was an OP_BUY and the OrderClosePrice <= OrderStopLoss, the buy order was stopped out.
- if the order was an OP_SELL and the OrderClosePrice >= OrderStopLoss, the sell order was stopped out.
Thanks chaps :)

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
Can anyone tell me if it's possible to run through my trade history, using MQL, to find out if a specific trade was stopped out?
I have a few techniques to close trades, but I would like to know if there is a variable that stores whether the reason it closed was because of the SL.
Thanks
Johnny