OPEN-SOURCE SCRIPT
Advanced SuperTrend and Volume Oscillator Indicator

Overview
This is an Advanced Momentum Confluence Engine which is a state-aware, intraday algorithmic trading script. It blends structural trend identifiers (SuperTrend, VWAP) with raw momentum oscillators (Volume, Stochastic RSI).
The system ensures high-probability entries through strict 2-bar trajectory confirmation and price-action validation. It features an isolated state machine, custom time-based end-of-day (EOD) square-offs tailored for the Indian market, and structured JSON outputs for seamless integration with external Python execution engines.
Core Indicator Components
A. Trend Structure: SuperTrend
Acts as the macro directional bias and dynamic trailing support/resistance.
Calculation: Standard ATR-based multiplier.
Parameters: ATR Length = 10, Multiplier = 3.0.
System States: Bullish (stGreen), Bearish (stRed).
B. Intraday Mean: Volume Weighted Average Price (VWAP)
Acts as the baseline for intraday valuation, structural trade confirmation, and early stop-loss triggers.
Calculation: Standard Session VWAP based on Typical Price (hlc3).
C. Volume Acceleration: Raw Volume Oscillator
Measures relative volume momentum to confirm institutional participation without lagging EMA overlays.
Calculation: $100 \times \frac{EMA(Volume, 5) - EMA(Volume, 10)}{EMA(Volume, 10)}$
Parameters: Short EMA = 5, Long EMA = 10.
D. Price Velocity: Averaged Stochastic RSI
Measures the speed of price movement relative to its recent intraday range.
Calculation: Computes the mathematical average of the %K and %D lines (avgStoch).
Parameters: RSI Length = 14, Stochastic Length = 14, K Smooth = 3, D Smooth = 3.
Extremity Zones: Oversold (< 20), Overbought (> 80), Stuck Bottom (<= 1), Stuck Top (>= 99).
3. Signal Validation & Price Action Filters
To eliminate "head fake" signals and slippage, the engine requires a combination of sustained momentum and immediate price action alignment.
2-Bar Momentum Trajectory:
Both the Volume Oscillator and the Stochastic RSI must be actively moving in the intended direction for two consecutive bars.
Rising: ta.rising(val, 2) (Current > Previous > 2 Bars Ago).
Falling: ta.falling(val, 2) (Current < Previous < 2 Bars Ago).
Candle Color Validation: The engine will not buy into active selling or sell into active buying.
Long Requirement: Execution candle must be Green (close > open).
Short Requirement: Execution candle must be Red (close < open).
This is an Advanced Momentum Confluence Engine which is a state-aware, intraday algorithmic trading script. It blends structural trend identifiers (SuperTrend, VWAP) with raw momentum oscillators (Volume, Stochastic RSI).
The system ensures high-probability entries through strict 2-bar trajectory confirmation and price-action validation. It features an isolated state machine, custom time-based end-of-day (EOD) square-offs tailored for the Indian market, and structured JSON outputs for seamless integration with external Python execution engines.
Core Indicator Components
A. Trend Structure: SuperTrend
Acts as the macro directional bias and dynamic trailing support/resistance.
Calculation: Standard ATR-based multiplier.
Parameters: ATR Length = 10, Multiplier = 3.0.
System States: Bullish (stGreen), Bearish (stRed).
B. Intraday Mean: Volume Weighted Average Price (VWAP)
Acts as the baseline for intraday valuation, structural trade confirmation, and early stop-loss triggers.
Calculation: Standard Session VWAP based on Typical Price (hlc3).
C. Volume Acceleration: Raw Volume Oscillator
Measures relative volume momentum to confirm institutional participation without lagging EMA overlays.
Calculation: $100 \times \frac{EMA(Volume, 5) - EMA(Volume, 10)}{EMA(Volume, 10)}$
Parameters: Short EMA = 5, Long EMA = 10.
D. Price Velocity: Averaged Stochastic RSI
Measures the speed of price movement relative to its recent intraday range.
Calculation: Computes the mathematical average of the %K and %D lines (avgStoch).
Parameters: RSI Length = 14, Stochastic Length = 14, K Smooth = 3, D Smooth = 3.
Extremity Zones: Oversold (< 20), Overbought (> 80), Stuck Bottom (<= 1), Stuck Top (>= 99).
3. Signal Validation & Price Action Filters
To eliminate "head fake" signals and slippage, the engine requires a combination of sustained momentum and immediate price action alignment.
2-Bar Momentum Trajectory:
Both the Volume Oscillator and the Stochastic RSI must be actively moving in the intended direction for two consecutive bars.
Rising: ta.rising(val, 2) (Current > Previous > 2 Bars Ago).
Falling: ta.falling(val, 2) (Current < Previous < 2 Bars Ago).
Candle Color Validation: The engine will not buy into active selling or sell into active buying.
Long Requirement: Execution candle must be Green (close > open).
Short Requirement: Execution candle must be Red (close < open).
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.