How do you prevent your EA from placing trades too soon after each other but still allow other functions like trailing stop and closing to go ahead
This video was inspired by a forum post I read a long time ago. I don’t remember exactly where but the question was how to prevent an EA from trading too quickly after placing another trade.
The answers to the question used sleep to introduce a delay after placing the trade. In this case I don’t agree with using sleep as the answer.
Sleep will prevent all further activity by the expert and the expert may also be handling trailing stop, closing existing trades, or other things.
This video shows 2 other approaches, one using a delay by minutes before the next trade and the other uses a delay in bars.
The code is available on GitHub:
https://github.com/OrchardForexTutorials/220227_delay_between_trades