OPEN-SOURCE SCRIPT

SmartVol SuperTrend | Oquant

250
Overview
The SmartVol SuperTrend is an evolution of the traditional SuperTrend indicator. While the standard SuperTrend uses Average True Range (ATR) to calculate volatility bands, this version utilizes Volume-Weighted Standard Deviation (VWSD).
By integrating volume into the volatility calculation, the indicator attempts to filter out "quiet" price movements and reacts more dynamically to price action supported by high trading activity.

How It Works
The script follows a multi-step process to define trend direction:
Smoothing: It applies a 5-period EMA to the source price to reduce minor noise before calculating the bands.
Volume-Weighted Volatility: Instead of a simple Standard Deviation, the script uses a custom volume standard deviation function. It measures the dispersion of price around its Volume Weighted Moving Average (VWMA), weighting each price point's contribution by the volume of that bar.
Recursive Band Logic: Like the classic SuperTrend, the bands are "locked" in place. The lower band can only move up, and the upper band can only move down, until price closes on the opposite side, triggering a trend flip.
Visuals: The script highlights the trend by coloring the candles and the space between the price and the trend line, providing a clear visual of the current market bias.

Usefulness
By using Volume-Weighted Standard Deviation, this indicator accounts for real market activity. Consequently, it expands its bands more aggressively during high-volume breakouts while dampening its reaction to price moves when volume fades, potentially offering more robust band levels anchored to true market participation.

How to Use
Trend Identification: When the line is green and below price, the trend is bullish. When the line is purple and above price, the trend is bearish.
Factor Adjustment: Increase the Factor (default 1.8) to reduce sensitivity and avoid whipsaws in volatile markets. Decrease it for tighter tracking.
EMA Length: Adjust the EMA length to change how much price smoothing is applied before the trend calculation.

Note on Signals
This indicator is designed for trend-following. Like all lagging indicators, it performs best in trending markets and may produce false signals during sideways consolidation.

Settings
Source: The price source used for calculations (default: Close).
EMA Length: The lookback for the initial price smoothing (default: 5).
VWSD Length: The period used to calculate the volume-weighted volatility (default: 30).
Factor: The multiplier applied to the VWSD to determine the distance of the bands (default 1.8).

⚠️ Disclaimer: This indicator is intended for educational and informational purposes only. Trading involves risk, and past performance does not guarantee future results. Always test and evaluate indicators/strategies before applying them in live markets. Use at your own risk.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.