All indicators

Breakout + Alerts

Feb 15, 2020

Static chart image
Support and ResistanceSignalsChannels

The Trend Following Breakout tool identifies trend reversal and continuation points by tracking historical price extremes to generate entry and exit signals.

Usage

The Trend Following Breakout script is designed to capture significant market moves by entering trades when the price breaks above or below a specific lookback period's high or low.

  • Long Positions: A long entry is triggered when the closing price crosses above the highest high of the "ENTRY H/L" period. The position is closed when the price crosses below the "EXIT H/L" period's high.
  • Short Positions: A short entry is triggered when the closing price crosses below the lowest low of the "ENTRY H/L" period. The position is closed when the price crosses above the "EXIT H/L" period's low.

This tool is particularly effective on higher timeframes such as the 4H and 1D for major assets like BTC and ETH, where trends tend to be more sustained.

Details

The script utilizes a classic Donchian Channel-inspired logic for trend following. It calculates four distinct levels:

  1. Highest Price Long: The peak high over the entry lookback.
  2. Lowest Price Long: The level used for trailing an exit on long trades.
  3. Lowest Price Short: The floor low over the entry lookback.
  4. Highest Price Short: The level used for trailing an exit on short trades.

By separating the entry and exit lengths, users can apply a "fast exit" strategy (e.g., entering on a 100-bar breakout but exiting on a 50-bar breakdown) to lock in profits more aggressively while waiting for a high-conviction entry.

Settings

  • ENTRY H/L: Sets the lookback period (number of candles) used to determine the breakout level for entering new long or short positions.
  • EXIT H/L: Sets the lookback period used to determine the trailing level for exiting active positions.
  • Backtest Window (Year, Month, Day): These settings define the start and end dates for the strategy execution, allowing users to analyze performance over specific historical periods.

FAQ

How do I use the Trend Following Breakout?

Apply the script to your chart and adjust the Entry and Exit H/L lengths to match the volatility of the asset you are trading. Look for the price to break the plotted green or red bands to signal trade transitions.

Can I set up alerts with this script?

Yes, the script includes built-in alert conditions for Long Entry, Short Entry, Long Exit, and Short Exit, which can be configured through the TradingView Alert menu.

How do I access Trend Following Breakout?

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.