All indicators

Three EMAs Trend-following Strategy

May 18, 2022

Static chart image
SignalsMoving AveragesTrailing-StopVolatility

The Three EMAs Trend-following Strategy tool identifies potential trend shifts by monitoring price crossovers across three exponential moving averages combined with a volatility-based trailing stop.

Usage

This strategy is primarily used to capture mid-term trends by requiring a confluence of signals before entering a trade. A long signal is generated when the price crosses above all three EMAs (7, 12, and 21 by default) on the same candle. This triple confirmation helps filter out minor fluctuations and focuses on stronger momentum shifts.

To manage the trade, the strategy employs two exit mechanisms:

  • Fixed Take Profit: Closes the position once a specific percentage gain is reached.
  • Volatility Stop (VStop): Acts as a dynamic trailing stop that adjusts based on market volatility, helping to protect gains and exit when the trend reverses.

The strategy is optimized for medium timeframes, such as the 4-hour chart, where trend clarity is typically higher than on lower timeframes.

Details

The strategy relies on the principle that a simultaneous crossover of three EMAs with varying lengths indicates a high-probability trend inception. By using fast (7), medium (12), and slow (21) EMA lengths, the script ensures that the price action has sufficient momentum to lead all three averages. The Volatility Stop calculation incorporates ATR (Average True Range) to create a buffer that adapts to current market conditions, allowing for wider stops during high volatility and tighter stops during consolidation.

Settings

EMA Settings

  • EMA 1 Length: Sets the period for the fastest EMA (default 7).
  • EMA 2 Length: Sets the period for the medium EMA (default 12).
  • EMA 3 Length: Sets the period for the slowest EMA (default 21).

Strategy Settings

  • Take Profit (%): The target percentage increase from the entry price to trigger a fixed exit.
  • VStop Length: The lookback period used for the ATR calculation in the volatility stop.
  • VStop Source: The price source used to calculate the volatility stop.
  • VStop Multiplier: The factor applied to the ATR to determine the distance of the trailing stop.

Backtest Window

  • From/Thru Date: Defines the specific date range for the strategy backtest results.
  • Show Date Range: Toggles the visibility of the date range filter.

FAQ

How do I access the Three EMAs Trend-following Strategy?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

What is the best timeframe for this strategy?

Based on backtesting, the 4-hour timeframe is recommended for a balance between signal reliability and trend capture, though it can be adapted for other medium-term timeframes.

Why does the strategy require three crossovers?

Requiring the price to cross over all three EMAs simultaneously serves as a filter to reduce false signals (whipsaws) and confirm that a robust trend is developing.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.