OPEN-SOURCE SCRIPT
NY Anchored VWAP and Auto SMA

NY Anchored VWAP and Auto SMA
This script is a versatile trading indicator for the TradingView platform that combines two powerful components: a New York-anchored Volume-Weighted Average Price (VWAP) and a dynamic Simple Moving Average (SMA). Designed for traders who utilize VWAP for intraday trend analysis, this tool provides a clear visual representation of average price and volatility-adjusted moving averages, generating automated alerts for key crossover signals.
Indicator Components
1. NY Anchored VWAP
The VWAP is a crucial tool that represents the average price of a security adjusted for volume. This version is "anchored" to the start of the New York trading session, resetting at the beginning of each new session. This provides a clean, session-specific anchor point to gauge market sentiment and trend. The VWAP line changes color to reflect its slope:
Green: When the VWAP is trending upwards, indicating a bullish bias.
Red: When the VWAP is trending downwards, indicating a bearish bias.
2. Auto SMA
The Auto SMA is a moving average with a unique twist: its lookback period is not fixed. Instead, it dynamically adjusts based on market volatility. The script measures volatility using the Average True Range (ATR) and a Z-Score calculation.
When volatility is expanding, the SMA's length shortens, making it more sensitive to recent price changes.
When volatility is contracting, the SMA's length lengthens, smoothing out the price action to filter out noise.
This adaptive approach allows the SMA to react appropriately to different market conditions.
Suggested Trading Strategy
This indicator is particularly effective when used on a one-minute chart for identifying high-probability trade entries. The core of the strategy is to trade the crossover between the VWAP and the Auto SMA, with confirmation from a candle close.
The strategy works best when the entry signal aligns with the overall bias of the higher timeframe market structure. For example, if the daily or 4-hour chart is in an uptrend, you would look for bullish signals on the one-minute chart.
Bullish Entry Signal: A potential entry is signaled when the VWAP crosses above the Auto SMA, and is confirmed when the one-minute candle closes above both the VWAP and the SMA. This indicates a potential continuation of the bullish momentum.
Bearish Entry Signal: A potential entry is signaled when the VWAP crosses below the Auto SMA, and is confirmed when the one-minute candle closes below both the VWAP and the SMA. This indicates a potential continuation of the bearish momentum.
The built-in alerts for these crossovers allow you to receive notifications without having to constantly monitor the charts, ensuring you don't miss a potential setup.
This script is a versatile trading indicator for the TradingView platform that combines two powerful components: a New York-anchored Volume-Weighted Average Price (VWAP) and a dynamic Simple Moving Average (SMA). Designed for traders who utilize VWAP for intraday trend analysis, this tool provides a clear visual representation of average price and volatility-adjusted moving averages, generating automated alerts for key crossover signals.
Indicator Components
1. NY Anchored VWAP
The VWAP is a crucial tool that represents the average price of a security adjusted for volume. This version is "anchored" to the start of the New York trading session, resetting at the beginning of each new session. This provides a clean, session-specific anchor point to gauge market sentiment and trend. The VWAP line changes color to reflect its slope:
Green: When the VWAP is trending upwards, indicating a bullish bias.
Red: When the VWAP is trending downwards, indicating a bearish bias.
2. Auto SMA
The Auto SMA is a moving average with a unique twist: its lookback period is not fixed. Instead, it dynamically adjusts based on market volatility. The script measures volatility using the Average True Range (ATR) and a Z-Score calculation.
When volatility is expanding, the SMA's length shortens, making it more sensitive to recent price changes.
When volatility is contracting, the SMA's length lengthens, smoothing out the price action to filter out noise.
This adaptive approach allows the SMA to react appropriately to different market conditions.
Suggested Trading Strategy
This indicator is particularly effective when used on a one-minute chart for identifying high-probability trade entries. The core of the strategy is to trade the crossover between the VWAP and the Auto SMA, with confirmation from a candle close.
The strategy works best when the entry signal aligns with the overall bias of the higher timeframe market structure. For example, if the daily or 4-hour chart is in an uptrend, you would look for bullish signals on the one-minute chart.
Bullish Entry Signal: A potential entry is signaled when the VWAP crosses above the Auto SMA, and is confirmed when the one-minute candle closes above both the VWAP and the SMA. This indicates a potential continuation of the bullish momentum.
Bearish Entry Signal: A potential entry is signaled when the VWAP crosses below the Auto SMA, and is confirmed when the one-minute candle closes below both the VWAP and the SMA. This indicates a potential continuation of the bearish momentum.
The built-in alerts for these crossovers allow you to receive notifications without having to constantly monitor the charts, ensuring you don't miss a potential setup.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.