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).
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.