- Group volume bars into groups of 3 (3 consecutive bars, starting from most recent closed bar)
- Check if most recent closed volume bar closed higher than the previous volume bar
- Check if the volume bar 3 bars ago closed higher than the volume bar 2 bars ago
- In other words, High-Low-High pattern
- I want to mark the middle bar
- I want this pattern to repeat in groups of 3, looking back in time on the chart
Clearly, I am not succeeding. This is what I have so far:
Code: Select all
//@version=5
indicator("volume detector")
highLowHigh= barstate.isconfirmed and (volume[1] > volume[2]) and (volume[3] > volume[2] -1)
bgcolor(color=highLowHigh ? color.green[2] : na)
This community is outstandling. I am so thankful we have something like this.