OPEN-SOURCE SCRIPT
NY Anchored VWAP and Auto SMA

This NY Anchored VWAP and Auto SMA script is a powerful combination of two of the most popular technical indicators, designed to help you identify the intraday trend and potential shifts in market momentum. It stands out by automatically adjusting to current volatility, providing more adaptive and reliable signals than standard moving averages.
How It Works
This script combines a New York session-anchored VWAP with a dynamic Simple Moving Average (SMA) that automatically adjusts its length based on market volatility.
New York Anchored VWAP: The VWAP (Volume-Weighted Average Price) resets at the beginning of the New York trading session. This allows it to accurately track the average price paid by traders for the day, providing a key benchmark for identifying whether the price is trading at a premium or a discount relative to the volume-driven trend. The color of the VWAP line itself changes to indicate its slope: green for an upward trend and red for a downward trend.
Auto SMA: The script calculates a Simple Moving Average (SMA) but with a twist. It uses the Average True Range (ATR) to measure market volatility. When volatility is high, the SMA's lookback period automatically shortens to make it more responsive to price changes. Conversely, when volatility is low, the lookback period lengthens to smooth out the data and reduce noise. This dynamic adjustment helps the SMA stay relevant in all market conditions.
Key Features
Adaptive Lookback: The Auto SMA dynamically adjusts to market volatility, providing more responsive signals during volatile periods and smoother, more reliable signals during calm periods.
Color-Coded VWAP: The VWAP line changes color to instantly show the direction of the trend, making it easy to see at a glance if the average price is rising or falling.
Automated Alerts: The script provides automated alerts for when the VWAP crosses above or below the Auto SMA, signaling potential bullish or bearish momentum shifts.
Customizable Settings: You can hide the VWAP on daily or higher timeframes and change the source for the VWAP calculation to suit your specific trading style.
This tool is perfect for intraday and swing traders who want a more intelligent and adaptive way to measure trend direction and identify potential trading opportunities.
How It Works
This script combines a New York session-anchored VWAP with a dynamic Simple Moving Average (SMA) that automatically adjusts its length based on market volatility.
New York Anchored VWAP: The VWAP (Volume-Weighted Average Price) resets at the beginning of the New York trading session. This allows it to accurately track the average price paid by traders for the day, providing a key benchmark for identifying whether the price is trading at a premium or a discount relative to the volume-driven trend. The color of the VWAP line itself changes to indicate its slope: green for an upward trend and red for a downward trend.
Auto SMA: The script calculates a Simple Moving Average (SMA) but with a twist. It uses the Average True Range (ATR) to measure market volatility. When volatility is high, the SMA's lookback period automatically shortens to make it more responsive to price changes. Conversely, when volatility is low, the lookback period lengthens to smooth out the data and reduce noise. This dynamic adjustment helps the SMA stay relevant in all market conditions.
Key Features
Adaptive Lookback: The Auto SMA dynamically adjusts to market volatility, providing more responsive signals during volatile periods and smoother, more reliable signals during calm periods.
Color-Coded VWAP: The VWAP line changes color to instantly show the direction of the trend, making it easy to see at a glance if the average price is rising or falling.
Automated Alerts: The script provides automated alerts for when the VWAP crosses above or below the Auto SMA, signaling potential bullish or bearish momentum shifts.
Customizable Settings: You can hide the VWAP on daily or higher timeframes and change the source for the VWAP calculation to suit your specific trading style.
This tool is perfect for intraday and swing traders who want a more intelligent and adaptive way to measure trend direction and identify potential trading opportunities.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。