How to make my EA count candles after a condition is met.
-
Hi
I would like to make my EA count a certain number of candles after my custom indicator appears for the first time before placing a trade when the custom indicator appears the second time. This is the link to my project. I believe it should work like this but its not working. https://fxdreema.com/shared/9mnIGmaab
What i simply want the EA to do is to count a certain number (eg. 30) of candles (equal or greater than) or wait for a set period of time (eg. 30mins) after a green buffer appears and place sell trade when the red buffer appears and vice versa.
-
But what happens if a new dot appears on the chart before those 30 candles have been passed since the previous one? Should that invalidate the previous count and begin a new one from the new dot?
-
Do you mean the number of candles between signals ? Maybe you can loop back to locate the last signal candle whenever a new signal appear
-
@sktsec said in How to make my EA count candles after a condition is met.:
Do you mean the number of candles between signals ? Maybe you can loop back to locate the last signal candle whenever a new signal appear
Could you please show/tell me how to do the loop back?
-
@l-andorrà said in How to make my EA count candles after a condition is met.:
But what happens if a new dot appears on the chart before those 30 candles have been passed since the previous one? Should that invalidate the previous count and begin a new one from the new dot?
Yes exactly. A new count should begin if it happens that way. I only want the EA to place trades if there has been minimum of 30 or more candles in between the last dot and the current one.
-
Put a variable into a comment to watch, once per par (in separate trees) +1 to the variable, then every time the indicator appears reset to 0, you can then check this number in a condition.
-
@lanrayy
A simple approach is to use the loop block to loop back until the indicator signal appear.