- it will become an OP_BUY or OP_SELL
- Check that the OrderDelete worked - What are Function return values ? How do I use them ? - MQL4 forum
- OrderSelect BY_TICKET will select the deleted ticket out of the history pool next time and the OrderDelete will fail. Clear the ticket number after the delete.
- If you accidentally close the chart/terminal, power fails, OS crashes, etc., you've lost the ticket number and the EA has lost control of its orders. Do you recover by doing an OrderSelect loop in init()?
Would you ever write? if( (2+2 == 4) == true) ...
Of course not. if(2+2 == 4) // is sufficient.
So why do you write? if(OrderSelect(BuyStop1, SELECT_BY_TICKET)==true)
Simplify if(OrderSelect(BuyStop1, SELECT_BY_TICKET))
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,
I'm new in mql programming and trying to create an EA, which the idea is check a buy stop order if executed then delete the sell order and vice versa..
The buy stop and sell stop order are open manually, the order ticket are use for ea input.
But when I try it in demo, when 1 order is executed, the opposite order is not delete.
Please help, the code below (I know its a poor code since I'm a beginner) :
Thanks..