Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
you can try this
void OnTradeTransaction(const MqlTradeTransaction& trans, const MqlTradeRequest& request, const MqlTradeResult& result) { if(trans.type == TRADE_TRANSACTION_ORDER_DELETE) // trying to pause trade when SL hit { Alert("Stop loss hit"); } }

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
I want to make an expert which checks if a position was closed by the stoploss. As soon as a position is closed by a stoploss I want to be noticed by an Alert. What is the best way to do this? Would you check the order-history with every tick or is it the better way to use OnTrade() or OnTradeTransaction()?
Thank you!