All indicators

Classic Trend Following System

Dec 11, 2021

Static chart image
SignalsChannelsMoving AveragesTrailing-StopVolatility

The Classic Trend Following System indicator is a comprehensive long-term trend analysis tool that combines exponential moving average crossovers with Donchian Channel breakouts to identify high-probability entry points.

Usage

The system is designed for long-term trend following, particularly in markets that exhibit sustained trending behavior such as stocks, commodities, and currencies.

A long position is typically triggered when the fast EMA is above the slow EMA and price breaks above the upper Donchian Channel. Conversely, a short position is considered when the fast EMA is below the slow EMA and price breaks below the lower Donchian Channel. The tool includes an integrated ATR-based trailing stop to manage risk and lock in profits as the trend progresses.

Details

The script utilizes a specific combination of trend filters and momentum breakouts:

  • Moving Average Filter: Uses two Exponential Moving Averages (EMAs) instead of simple ones to provide more responsiveness to recent price action while maintaining a long-term bias.
  • Donchian Channels: Set to a 50-day period by default to capture significant price breakouts beyond recent consolidation zones.
  • Risk Management: Implements an ATR-based position sizing and trailing stop mechanism. The stop-loss is dynamically calculated based on Average True Range (ATR), typically set at 4 multiples away from the price to avoid premature exits during normal market volatility.

Settings

Backtest Window

  • Backtest Start Date: Sets the starting point for historical data analysis.
  • Backtest End Date: Sets the ending point for historical data analysis.

Moving Average Inputs

  • Length Fast EMA: The period for the short-term trend filter (Default: 50).
  • Length Slow EMA: The period for the long-term trend filter (Default: 150).
  • Source Fast/Slow MA: Determines the price source (e.g., Close) for calculations.
  • Color Fast/Slow EMA: Customizes the visual appearance of the moving averages.

Donchian Channels Inputs

  • Length Upper Channel: The lookback period for the highest high.
  • Length Lower Channel: The lookback period for the lowest low.
  • Fill Color: Adjusts the background shading between the channels.

ATR Position Size Inputs

  • Leverage Used: Multiplier for the position size calculation.
  • Point Value/ATR Multipliers: Defines the distance for the initial risk calculation.
  • ATR Period: The lookback period for ATR volatility measurement.
  • Risk Per Trade: The percentage of equity to risk on a single trade.

ATR Trailing Stop Inputs

  • ATR Period: Lookback for the trailing stop calculation.
  • ATR Multiplier: Determines how many ATRs away the trailing stop is placed.
  • Line Width: Adjusts the thickness of the trailing stop plot.

FAQ

How do I use the Classic Trend Following System?

You can use it to identify long-term entries by looking for price breakouts that align with the direction of the EMA crossover.

What markets are best for this script?

While it can be used on any asset, it is optimized for markets that trend for extended periods, such as equities, forex pairs, and commodities.

How can I access this tool?

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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

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