How can I create a delay in seconds?
-
Hello, I need the orders to enter a few seconds later, I do not know if there is a block for this or I would have to include it in the mql4 code. Thank you.
Instead of entering the order 13.00-12.00-5.00 (open price), for example 3 seconds 13.03-12.03 etc.
https://fxdreema.com/shared/9wejeRI1b -
There is a Delay block. Note that this block stops the whole EA for a while and I think that MetaTrader itself may become unresponsive... but 3 seconds is not a big amount of time and if you don't have other EAs it could work.
But maybe it's better to try this block "Skip Ticks"
-
@fxdreema
How can use the "skip ticks"?
Stop the ea, but then restart it?I want stop the ea after a condition and restart next day, i think i could to use "skip ticks" block
-
That's a good question. I tried to use it at the most simple level and not a single tick is skipped.
https://fxdreema.com/shared/1iMEur5jd
I'm bery interested in someone solving our common problem.
-
You could skip ticks manually.
Create a variable as a flag that says don't execute your trade. Then count ticks from that point. When the counter reaches the desired number then set the flag variable to true.
Maybe a Condition block and a Counter block is all you need ...
Seems plausible.
-
But this is almost what "Skip Ticks" do. When it runs, it sets some variable to a future time, and then on every tick (in OnTick()) that variable is compared with the current time. After the current time is > than the time in the variable, the rest of the code in OnTick() is allowed to work again.
-
@fxdreema Why doesn't Delay do that too?