4 EMA + VWAP in one indicator, with adjustable titles and colors
Jun 26, 2020

The 4 EMA + VWAP indicator is a multi-layered trend-following tool that combines four exponential moving averages with a Volume Weighted Average Price (VWAP) calculation into a single script. It is designed to streamline your workspace by consolidating essential trend and volume-weighted data into one overlay, helping traders stay within indicator limits while maintaining a comprehensive view of market structure.
Usage
The Usage of this tool centers on identifying trend direction, potential support/resistance levels, and momentum shifts. By observing the stack of four EMAs (defaulting to 9, 20, 50, and 200), traders can determine the short-term and long-term trend bias.
- Trend Confirmation: When price is above the EMAs and the shorter EMAs are above the longer ones, a bullish trend is confirmed.
- VWAP Interaction: The VWAP line provides a benchmark for the average price paid throughout the selected period, adjusted for volume. Price trading above the VWAP often indicates bullish sentiment, while trading below suggests bearish control.
- Crossovers: The script includes built-in logic for EMA and price-to-VWAP crossovers, which can be used to identify entry or exit signals when momentum shifts.
Details
The script utilizes the ta.ema function for the four moving averages, providing a weighted calculation that reacts more quickly to recent price changes than a simple moving average. The VWAP component is calculated by taking the sum of the typical price (HLC3) multiplied by volume, divided by the cumulative volume over the user-defined period. This implementation offers a rolling version of the volume-weighted average rather than a session-anchored one, making it adaptable to various timeframes and trading styles.
Settings
- First EMA: Sets the lookback period for the first exponential moving average (Default: 9).
- Second EMA: Sets the lookback period for the second exponential moving average (Default: 20).
- Third EMA: Sets the lookback period for the third exponential moving average (Default: 50).
- Fourth EMA: Sets the lookback period for the fourth exponential moving average (Default: 200).
- VWAP Period: Defines the window of bars used to calculate the rolling Volume Weighted Average Price.
FAQ
How do I interpret the EMA crossover alerts?
The indicator triggers an alert when the 9 EMA crosses the 20 EMA. A crossover (9 above 20) suggests increasing bullish momentum, while a crossunder (9 below 20) suggests increasing bearish momentum.
Can I change the colors of the lines?
Yes, you can adjust the colors and line thickness for each individual EMA and the VWAP line through the "Style" tab in the indicator settings.
How do I get access to the 4 EMA + VWAP indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.