Test whether x candles have been touching moving average line in a row
-
Hi all
I would like to send myself a notification when an EMA line has touched x number of candles in a row. Is there a way to do this with fxdreema?
I am guessing it is possible with 'indicator moves with' block but I am not sure how to configure it. Can anyone offer any advice?

-
You could do two condition blocks per candle…lets say x is 4 candles. So you need 8 condition blocks, 2 per ID. One block is candle ID 1 crosses above EMA ID 1, one block is same but „crosses below“. Then you do that for each candle in the past you want checked. Then connect the blocks and put signal at the end.
-
Thanks @SirLuk was just looking at that BUT...how do you ID the candle? There's no candle ID selector in the crossing block so I'm not sure how I could specify what candle to test.
Unless I would have to store variables for candles with pass/fail flags until x candles passed the test?
-
Use normal condition blocks, like this:

One of these blocks has to pass to get to the next two blocks with the ID 2.
-
Aaaaaaaaah yes! Thank you! Will try that, cheers man
-
Edited below...
-
@general-melchett said in Test whether x candles have been touching moving average line in a row:
In case anyone is interested, I had to modify the conditions: basically if price passes ABOVE candle low AND price passes BELOW candle high, for this to work...

-
@general-melchett That AND block is redundant in that position. Connecting both condition blocks one on top of the other will get the same effect.