OnTrade() doesn't work in MT4. You could store previous open orders and check for actual open orders every tick, and compare them with previous value. Then, store again new actual value. Regards.
Ma Yuliang:
I want sent a alert when a pending order be opened.
OnTrade() is not work for this .
Any one know how to do this please tell me .
int ticket=0; if(orderTypeID==OP_BUYLIMIT || orderTypeID==OP_BUYSTOP) ticket=OrderSend(Symbol(),orderTypeID,lots,entryLevel,slippage,0.0,0.0,tradeComment,magicNumber,0,DodgerBlue); else if(orderTypeID==OP_SELLLIMIT || orderTypeID==OP_SELLSTOP) ticket=OrderSend(Symbol(),orderTypeID,lots,entryLevel,slippage,0.0,0.0,tradeComment,magicNumber,0,DeepPink); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Alert("Order ticket" + ticket + " has been opened); }
Oluwatosin Aboluwarin:
I think OP wants alert when pending order is triggered, not when it's placed. Regards.
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 sent a alert when a pending order be opened.
OnTrade() is not work for this .
Any one know how to do this please tell me .