OPEN-SOURCE SCRIPT
Leno Logic Stack: BOS & CHoCH

The current script uses a fixed lookback. For your specific volume-based setups, you may want to add a volume > ta.sma(volume, 20) condition within the if statements to ensure that the structure break is "validated" by institutional participation.
Integration: Since you are tracking the interaction between price action and the VWMA 20, you could add a condition where a BOS label only prints if the close is above the ta.vwma(close, 20).
Integration: Since you are tracking the interaction between price action and the VWMA 20, you could add a condition where a BOS label only prints if the close is above the ta.vwma(close, 20).
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.