OPEN-SOURCE SCRIPT

ATR-Multiple from 50SMA

153
This indicator provides a nuanced view of price extension by calculating the distance between the current price and its 50-period Simple Moving Average. This distance is not measured in simple percentage terms but is quantified in multiples of the Average True Range (ATR), offering a volatility-adjusted perspective on how far an asset has moved from its mean.

The primary goal is to help traders identify potentially overextended conditions, which can often precede price consolidation or reversals. As a general guideline, when an asset's price stretches to multiples of 7 ATRs or more above its 50-day SMA, it often enters a zone where significant profit-taking may occur. By visualizing this extension, the indicator can serve as a powerful tool for gauging when to consider taking profits on existing long positions. Furthermore, it can act as a cautionary signal, helping traders avoid initiating new long positions in assets that are already significantly stretched and may be poised for a pullback.

Features

Volatility-Adjusted Extension
Measures the distance from the 50 SMA in terms of ATR multiples, providing a more standardized way to compare extension across different assets and time periods.

Daily Timeframe Consistency
By default, the indicator uses the daily SMA and ATR for its calculations, regardless of the chart's current timeframe. This ensures a consistent and meaningful measure of extension rooted in the daily trend.

Histogram Visualization
Displays the result as a clear histogram in a separate pane, making it easy to track the extension level over time and identify historical extremes.

Dynamic Color-Coding
The histogram bars are color-coded to visually highlight different levels of extension. The colors shift as the price moves further from the mean, providing an intuitive at-a-glance reading.

Key Threshold Markers
Includes pre-set horizontal lines at the 7 and 10 ATR multiples to clearly mark the zones of potential profit-taking and extreme extension, respectively.

Built-in Alerts
Comes with configurable alert conditions that can notify you when the price reaches the "profit-taking" threshold (7 ATRs) or the "extreme extension" threshold (10 ATRs).

Customization Options

MA & ATR Periods
You can adjust the length for the Simple Moving Average (default 50) and the Average True Range (default 14) to suit your specific analytical needs.

Timeframe Source
A toggle allows you to switch between always calculating using daily data (the default and recommended setting) or using the data from the current chart's timeframe.

Color Display Style
You can choose between a smooth color gradient that transitions elegantly with the extension level or a distinct, step-based color display for a clearer visual separation of the defined zones.

Full Color Scheme Control
Every visual element is fully customizable. You can change the colors for the regular extension, the "get ready," "profit-taking," and "extreme" levels, as well as the horizontal reference lines.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.