Breakout + Alerts
Feb 15, 2020

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:
- Highest Price Long: The peak high over the entry lookback.
- Lowest Price Long: The level used for trailing an exit on long trades.
- Lowest Price Short: The floor low over the entry lookback.
- 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.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

