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).
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。