Any help!? I am looking to suspend trade for say two hours once my orders are opened. I DO NOT want to stop the EA from working as I have a loop to close trades once profit target or max loss is reached. I know I can set a global variable in the ordersend function so that I can stop new orders from being placed. How would I write a piece of code to wait, for example, two hours before allowing new orders? I thought of using OrderOpenTime and then using currenttime to see if that is OrderOpenTime + Something(variable amount of time) and then deleting global variable?
Any help/code would be greatly appreciated!!!! Thank you. Daniel
That's exactly how I'd do it. Just remember to compare server time with server time and don't get any local times in the mix.
That's exactly how I'd do it. Just remember to compare server time with server time and don't get any local times in the mix.
Ok, thanks for the affirmation.....could you help me with the code? I know enough to be dangerous and that is about all! :) Any help would be truly appreciated! D
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Any help!? I am looking to suspend trade for say two hours once my orders are opened. I DO NOT want to stop the EA from working as I have a loop to close trades once profit target or max loss is reached. I know I can set a global variable in the ordersend function so that I can stop new orders from being placed. How would I write a piece of code to wait, for example, two hours before allowing new orders? I thought of using OrderOpenTime and then using currenttime to see if that is OrderOpenTime + Something(variable amount of time) and then deleting global variable?
Any help/code would be greatly appreciated!!!! Thank you. Daniel