Check second condition within 'n' bars after the first condition
-
Hello everyone,
i have two conditions:- first one is a moving average crossover
- second one is a candle close below/above a moving average
I got those two conditions working but i want to check the second condition within 'n' bars after the first one ( the crossover). If thats true then enter buy/sell. How do i set this up ?
I tried "Loop pass n times" the second condition after the first one is true, but this doesn't seem to work
image url) -
Counting candles will be easier. Just create a variable adding +1 every new candle open after the first condition is true. Then use a condition block so that if 'current counter' = 'n bars after condition' the trade is open.
-
@l-andorrà
Thank you for your help. Here is my current project:
https://fxdreema.com/shared/xnrI3zX3cHow exactly do i count "every new candle open" after the first condition?
-
First
it looks like easy and nice system.
Second
I did always this thing. I made variables like PosBuy and put value 0 after crossing variable change to 1.
Its not fancy but for me work like always.https://fxdreema.com/shared/JFtNYG5hb

-
Here is my updated project. It works now, but i don't know if i'm overcomplicating things...

-
@varso Thank you, looks like a good solution!