OPEN-SOURCE SCRIPT
Aggiornato

GreenStar ATR% Extension Monitor

520
GreenStar ATR% Extension Monitor

The GreenStar ATR% Extension Monitor answers two questions in one window:
1) How volatile is the name? (14-period ATR as a percent of price)
2) How far has price stretched from a moving average, in relation to historical data?

Some names routinely stretch to 10-12x before mean-reverting. Others rarely clear 5x.
Scroll back on a daily chart to see extension habits for that symbol.


Why extension matters

Dollar distance from a 50-day MA does not compare a $15 name to a $400 name.

Dividing percent gain from the MA by ATR% provides a multiple of normal daily range.
That is the blue xFromMA line.

The green ATR% stepline shows the denominator: typical range relative to price.
These are separate formulas on the same pane and timeline to show correlation.
(It does not draw on the price chart.)


Two plots with independent calculations

ATR% (green stepline): 14-period ATR as a percent of price. Typical daily range relative to price level.

xFromMA (blue line): how many ATR% units price sits above or below the MA.

ATR% = ATR(14) / close x 100
xFromMA = ((close - MA) / MA x 100) / ATR%

Zero on xFromMA means price is at the MA.
A negative value indicates price is currently below the MA level.


Reading the pane

Both lines declining together often means the name is compressing toward the MA. Volatility and stretch easing at the same time.

Both rising means it's expanding.

Diverging slopes happen too.
xFromMA climbing while ATR% falls can mean price drifting from the MA while day-to-day volatility cools.
Read each line first, then note whether they agree.

Note: The lines share a pane for context, not because they combine into a signal.
A green/blue touch or cross is not a buy or sell event.


Visible-range markers (optional)

High, low, and mean for xFromMA are calculated from the visible bars on the chart.
There is no fixed lookback period.
They update on scroll or zoom, comparing current stretch to recent visible history.

The mean is the average xFromMA over those visible bars, not the midpoint between high and low.
Visible-range mean requires high/low lines enabled in the same settings group.

Optional zero line (dotted): xFromMA = 0, full width of the pane.

ATR% high/low bands exist too, off by default.


Settings

MA period (default 50)
MA type (default SMA)
ATR period (default 14)
Line colors and widths (default: dark green ATR%, blue xFromMA)
Zero line (default on)
High/low bands, xFromMA (default on)
Visible-range mean (default on)
ATR% high/low bands (default off)


Disclaimer

Context tool only. Not a signal, not financial advice. No entry or exit triggers. Past extension habits do not predict future price action.
Note di rilascio
Added ATR% Average (purple): a moving average of the ATR% line (default length 50).

This is NOT ATR(50), It is an average of the ATR(14) series.
Variable ATR period and average length can be set independently (defaults 14 / 50).

Use it as a volatility regime reference (ATR% daily value above/below its average shows expansion and contraction).

This is separate from the xFromMA extension readout.
See original description for settings and usage.

Also in this update:
• Show/hide toggles for ATR%, ATR% Average, and xFromMA
• Color and width settings for each
• Visible-range mean/high/low refresh more reliably on pan/zoom

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.