I have two occurrences, Cond1 and Cond2. In between these two bars there is a variable number of bars, but I want to identify when: 1.) all the bars share at least a tick of the Cond1 bar and 2.) The range of every bar between Cond1 and Cond2 is lower than the range of the Cond1 bar.
What would be the most efficient code to define this?
Yes. Each bar includes a price between the High and Low of the Cond1 bar.
No I should have said a smaller range or narrower range. H-L of all bars is less than H-L of Cond1 bar. This is what I am defining as a consolidating area.
This should get you started. Obviously my cond1 is just for testing since you didn't reveal your Condition 1 rules. Everything after the Filter command is also for verification only.