Adam Woods:
Thanks for everyones help in this forum so far its been amazing.
MT4
Can anyone help me with my next mission. I have worked out how to code an EA with OP_BUYSTOP orders on my rules but if the trades are never triggered how do I cancel them after a certain amount of time. for example the next day. Thanks in advance
Try this ;)
int Expiration=12;//Expiration after xx hours datetime expire=0; expire=TimeCurrent()+Expiration*60*60; ticket=OrderSend(Symbol(),OP_BUYSTOP,-,-,-,-,-,-,-,expire,Green);
If your broker allows expiration time (usually a min and max) then use it per Kenneth's
post. Otherwise, remember the expiration time and when expired, delete the pending order.

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
Thanks for everyones help in this forum so far its been amazing.
MT4
Can anyone help me with my next mission. I have worked out how to code an EA with OP_BUYSTOP orders on my rules but if the trades are never triggered how do I cancel them after a certain amount of time. for example the next day. Thanks in advance