How to express this condition (shift)
-
Hi: Looking for help in expressing a shift condition.
If condition happened 1 bar ago, I would put "1" in Candle ID. But how do I express a range of bars, for instance if the condition happened between 1 and 5 bars ago?
Thanks for any advice!
-
It depends on what you want to know within that range. Was it a crossing up or down? Then you can use a 'Condition' block with the specific candle ID on both operands and the appropriate symbol linking them.
If not, mor detailed info would be appreciated.
-
Thanks for the reply. An example would be if a stochastic hit 80 within bars 1 through 10 ago, could be bar 1, 2, 3, etc.
If this condition is true and another indicator is showing true then take trade. Hope that is clear.
I suppose a series of OR condition blocks could work, 1st block Candle ID 1, 2nd block Candle ID 2 etc.
Thanks again.
-
This is one possible way to do it:

This block is looking for the previous 10 bars, from candle ID 10 (ten bars ago) to candle ID 1 (the bar immediately previous to the current one. Notice that I had to specify the cross width as 9, becuase that's the range being considered.
-
Beautiful -you are A+!
-
You're welcome

-
@l-andorrà So that's what the cross width does... width = range? Didn't know that. Thanks. I thought it's a line width... and didn't use this feature.