Condition with unknowable candle ID
-
I have a question about creating a condition when there is no way of knowing its Candle ID. It could have happened one, two, three, or more bars earlier from a second condition that creates the buy signal.
For example, I would like to buy when RSI reaches 40. But I want it to have previously been under RSI 30. How can I set this up if I do not know the exact candle ID when it rose to RSI 30 (at the time I want to buy)? Please see attached image.
......
Rsi.jpg -
The only block who can probably do that is this one: Indicator moves within limits http://prntscr.com/8e7qt4
-
Thank you. It almost works, but it's not ordering at the correct time. I believe it may be because of the field 'with exception of few candles'. What does this field mean? I originally believed this meant that if you went back 12 periods then at least 1 period would require the indicator to move within the limit, with 11 being the maximum exceptions.
Can I use this block like this...?
12 periods - 11 possible exceptions = 1 required within the limit
-
This value was requested from another member before. It means that for X candles, the value is allowed to be out of the range. This value should be lower than the period or most often 0.
-
The problem Iโm having with this block is I believe itโs programmed to require the oldest candle to be within the range. If my settings are for 12 periods and 11 exceptions, then the block will not pass until 12 periods have expired, but itโs requiring the oldest period to be within the range. This means that any of the future candles after candle 12 can be the exceptions, but not candle 12.
This creates the problem of having to wait 11 candles before the block passes. Is this true and if so, can it be programmed so that any of the 12 periods can be the exceptions?
-
It does not wait for 11 candles, it loops in the oldest candles that currently exists. But I think you want to find that minimum value which is located somewhere in between the current value and the same value found somewhere in the past. For this task I think that I have no block, but if I think more about it and find some good name for this functionality, I can probably make some block.
-
Thank you for your reply. BTW, thanks for your great work here also

I made a test project. Would you mind checking it out? https://fxdreema.com/shared/IvaSKj68
In strategy tester, I looked at dates 06/22/15 to 06/30/15 for EUR/USD. This will create one result. RSI (14), 4 hour, typical price.
Shouldn't the block pass as soon as an indicator's period is within range, which happens at 6/23/15 12:00? But this doesn't pass until 12 candles later at 6/25/15 08:00.
-
I think you are right. In the code I was counting the number of exceptions that happened, and only when their number is as specified (11) it passed. But it should be the opposite - to count the difference between 12 and 11 and wait for only 1 positive condition.
Try it now.
-
Great! Thank you so much for looking into this.
