OPEN-SOURCE SCRIPT

Clustering Volatility (ATR-ADR-ChaikinVol) [Sam SDF-Solutions]

151
The Clustering Volatility indicator is designed to evaluate market volatility by combining three widely used measures: Average True Range (ATR), Average Daily Range (ADR), and the Chaikin Oscillator.
Each indicator is normalized using one of the available methods (MinMax, Rank, or Z-score) to create a unified metric called the Score. This Score is further smoothed with an Exponential Moving Average (EMA) to reduce noise and provide a clearer view of market conditions.

Key Features:

Multi-Indicator Integration: Combines ATR, ADR, and the Chaikin Oscillator into a single Score that reflects overall market volatility.

Flexible Normalization: (Supports three normalization methods)

  • MinMax: Scales values between the observed minimum and maximum.
  • Rank: Normalizes based on the relative rank within a moving window.
  • Z-score: Standardizes values using mean and standard deviation.



Dynamic Window Selection: Offers an automatic window selection option based on a specified lookback period, or a fixed window size can be used.

Customizable Weights: Allows the user to assign individual weights to ATR, ADR, and the Chaikin Oscillator. Optionally, weights can be normalized to sum to 1.

Score Smoothing: Applies an EMA to the computed Score to smooth out short-term fluctuations and reduce market noise.

Cluster Visualization: Divides the smoothed Score into a number of clusters, each represented by a distinct color. These colors can be applied to the price bars (if enabled) for an immediate visual indication of the current volatility regime.

How It Works:

  1. Input & Window Setup: Users set parameters for indicator periods, normalization methods, weights, and window size. The indicator can automatically determine the analysis window based on the number of lookback days.

  2. Calculation of Metrics: The indicator computes the ATR, ADR (as the average of bar ranges), and the Chaikin Oscillator (based on the difference between short and long EMAs of the Accumulation/Distribution line).

  3. Normalization & Scoring: Each indicator’s value is normalized and then weighted to form a raw Score. This raw Score is scaled to a [0,1] range using statistics from the chosen window.

  4. Smoothing & Clustering: The raw Score is smoothed using an EMA. The resulting smoothed Score is then multiplied by the number of clusters to assign a cluster index, which is used to choose a color for visual signals.

  5. Visualization: The smoothed Score is plotted on the chart with a color that changes based on its value (e.g., lime for low, red for high, yellow for intermediate values). Optionally, the price bars are colored according to the assigned cluster.


_____________
This indicator is ideal for traders seeking a quick and clear assessment of market volatility. By integrating multiple volatility measures into one comprehensive Score, it simplifies analysis and aids in making more informed trading decisions.

For more detailed instructions, please refer to the guide here:
https://ru.tradingview.com/chart/ETHUSDT/7mICCtf0-legkij-gid-po-indikatoram-kak-videtb-rynok-glubzhe/

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.