How can I make the new open trade be open after 80 seconds from teh last closed trade?
-
I tried several combinations of the 'time' option within the 'value' option, but to no avail do far. I cannot use the number of candles as a way to control time because I need periods like 25 seconds or 85 seconds. I also tried to use the 'on timer' tab, but same problem. Apparently no one has asked something like that before as I didn't find any thread dealing with this.
Any suggestion?
-
Use onTimer section and set the interval for 1 second. Add a variable and increment it in this section (varCounter = varCounter + 1), and compare the result with the value 85. If it goes over 85, "allow opening" a new trade depending on another conditions (or open one immediately). By "allow opening" I mean set another variable for true (like varOpen = true). When a trade is opened, reset all variables (varCounter = 0, varOpen = false, etc.).
Take an inspiration from this thread and my reply:
https://fxdreema.com/forum/topic/11979/ea-operated-after-3min-from-candle-formation-at-5-min/9 -
@miro1360 Very interesting. I will try it. Once more, thank you very much.
-
@l-andorrà I'm afraid I'm missing something. I created this simple structure but for some reason the counter doesn't work:
https://fxdreema.com/shared/ottolHZxb
Honestly I don't know how the 'on timer' tab works.
-
here you go:
https://fxdreema.com/shared/oRBYGzxCd -
@miro1360 Thank you again very much but I don't understand why you use so many custom code blocks. It should work with standard blocks too. I will test it and will let you know.
-
I can work faster with custom code blocks, you can follow the logic and easily turn it into blocks

Note: onTimer section is not working with tester -
@miro1360 Ok. Thanks. I will test it and let you know. Once more, thank you very much.