OPEN-SOURCE SCRIPT
Updated EMA Trend Bars + Optional VWAP Gate

Indicator: EMA Trend Bars + Optional VWAP Gate
What it does
• Colors your bars green (up), red (down), or gray (neutral) based on whether price is above or below a chosen EMA.
• Adds an optional VWAP filter (gate): only confirms green if price is above both EMA and VWAP, red if below both.
• Lets you pick source (HLC3, Close, or Heikin Ashi) to align with your charting style.
• Plots the EMA and (optionally) VWAP for reference.
• Includes alerts when the trend flips from down → up or up → down (static text, TradingView-friendly).
• Has an optional buffer (in ticks) so you don’t get whipsawed right at the EMA line.
⸻
KISS (Keep It Simple, Stupid)
The whole idea is to strip away noise and keep the system as lean as possible:
• One trend line (EMA) → simple bias filter.
• One value anchor (VWAP) → session’s fair price.
• Clean colors (green/red/gray) → quick glance = instant bias.
• No complex confluence stacks → less decision fatigue.
• Optional buffer → avoids chop without adding unnecessary rules.
The KISS principle here: price vs EMA + optional VWAP gate = trend bias. That’s it.
⸻
How to use it
1. Pick your EMA length:
• 34 is a balanced default for intraday scalping.
• Shorter (e.g., 21) = faster, more flips.
• Longer (e.g., 55/89) = slower, smoother trend.
2. Decide if VWAP filter stays ON:
• VWAP ON = fewer trades, higher confluence (good for patient entries).
• VWAP OFF = more trades, may catch earlier flips (good for fast scalping).
3. Read the bars:
• Green = only look for longs.
• Red = only look for shorts.
• Gray = stand aside (conflict or chop).
4. Alerts:
• Add “Trend Up” or “Trend Down” alerts for quick bias changes.
• Best used for heads-up, not blind auto-entries.
5. Buffer setting:
• 0 ticks = raw flips at EMA.
• 1–2 ticks = prevents micro whipsaws.
• Adjust depending on your instrument’s volatility (NQ is spikier, MES smoother).
What it does
• Colors your bars green (up), red (down), or gray (neutral) based on whether price is above or below a chosen EMA.
• Adds an optional VWAP filter (gate): only confirms green if price is above both EMA and VWAP, red if below both.
• Lets you pick source (HLC3, Close, or Heikin Ashi) to align with your charting style.
• Plots the EMA and (optionally) VWAP for reference.
• Includes alerts when the trend flips from down → up or up → down (static text, TradingView-friendly).
• Has an optional buffer (in ticks) so you don’t get whipsawed right at the EMA line.
⸻
KISS (Keep It Simple, Stupid)
The whole idea is to strip away noise and keep the system as lean as possible:
• One trend line (EMA) → simple bias filter.
• One value anchor (VWAP) → session’s fair price.
• Clean colors (green/red/gray) → quick glance = instant bias.
• No complex confluence stacks → less decision fatigue.
• Optional buffer → avoids chop without adding unnecessary rules.
The KISS principle here: price vs EMA + optional VWAP gate = trend bias. That’s it.
⸻
How to use it
1. Pick your EMA length:
• 34 is a balanced default for intraday scalping.
• Shorter (e.g., 21) = faster, more flips.
• Longer (e.g., 55/89) = slower, smoother trend.
2. Decide if VWAP filter stays ON:
• VWAP ON = fewer trades, higher confluence (good for patient entries).
• VWAP OFF = more trades, may catch earlier flips (good for fast scalping).
3. Read the bars:
• Green = only look for longs.
• Red = only look for shorts.
• Gray = stand aside (conflict or chop).
4. Alerts:
• Add “Trend Up” or “Trend Down” alerts for quick bias changes.
• Best used for heads-up, not blind auto-entries.
5. Buffer setting:
• 0 ticks = raw flips at EMA.
• 1–2 ticks = prevents micro whipsaws.
• Adjust depending on your instrument’s volatility (NQ is spikier, MES smoother).
Release Notes
Indicator: EMA Trend Bars + Optional VWAP GateInspiration and original code by Chris Moody "CM EMA Trend Bars"
What this indicator does
• Colors your bars green (up), red (down), or gray (neutral) based on whether price is above or below a chosen EMA.
• Adds an optional VWAP filter (gate): only confirms green if price is above both EMA and VWAP, red if below both.
• Lets you pick source (HLC3, Close, or Heikin Ashi) to align with your charting style.
• Plots the EMA and (optionally) VWAP for reference.
• Includes alerts when the trend flips from down → up or up → down (static text, TradingView-friendly).
• Has an optional buffer (in ticks) so you don’t get whipsawed right at the EMA line.
⸻
Why KISS (Keep It Simple, Stupid)
The whole idea is to strip away noise and keep the system as lean as possible:
• One trend line (EMA) → simple bias filter.
• One value anchor (VWAP) → session’s fair price.
• Clean colors (green/red/gray) → quick glance = instant bias.
• No complex confluence stacks → less decision fatigue.
• Optional buffer → avoids chop without adding unnecessary rules.
The KISS principle here: price vs EMA + optional VWAP gate = trend bias. That’s it.
⸻
How to use it
1. Pick your EMA length:
• 34 is a balanced default for intraday scalping.
• Shorter (e.g., 21) = faster, more flips.
• Longer (e.g., 55/89) = slower, smoother trend.
2. Decide if VWAP filter stays ON:
• VWAP ON = fewer trades, higher confluence (good for patient entries).
• VWAP OFF = more trades, may catch earlier flips (good for fast scalping).
3. Read the bars:
• Green = only look for longs.
• Red = only look for shorts.
• Gray = stand aside (conflict or chop).
4. Alerts:
• Add “Trend Up” or “Trend Down” alerts for quick bias changes.
• Best used for heads-up, not blind auto-entries.
5. Buffer setting:
• 0 ticks = raw flips at EMA.
• 1–2 ticks = prevents micro whipsaws.
• Adjust depending on your instrument’s volatility.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.