OPEN-SOURCE SCRIPT
已更新 GreenStar ATR% Extension Monitor

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