All indicators

Trend Duration Forecast

Oct 28, 2025

Static chart image
SignalsForecastingTime BasedDashboardMoving Averages

The Trend Duration Forecast indicator estimates the probable lifespan of bullish and bearish trends by analyzing historical trend persistence to project potential exhaustion zones.

Usage

The script identifies trend transitions using a color-coded Hull Moving Average (HMA) and tracks the duration of every confirmed phase.

  • Real-Time Tracking: As a trend develops, the "Real Length" label updates to show exactly how many bars have passed in the current direction.
  • Forecast Projection: An arrow and a "Probable Length" label are projected forward based on the rolling average of previous trend durations. This allows you to visualize if the current move is statistically "overextended" or if it has significant room to run.
  • Historical Data Table: A table in the bottom right corner displays a breakdown of the most recent bullish and bearish trend lengths and their respective averages, providing context for the current market structure.

Details

The indicator utilizes a Hull Moving Average (HMA) to filter price action. Trend direction is determined by the slope of the HMA over a specific lookback period. Once a trend direction is established, the script begins a bar counter. When the trend reverses, the final bar count is stored in an array. The "Probable Length" is the arithmetic mean of the stored samples in these arrays, providing a rolling statistical forecast of how long future trends in that direction might last.

Settings

  • Smoothing Length: Defines the period for the Hull Moving Average (HMA). Higher values result in smoother trends with more lag.
  • Trend Detection Sensitivity: Controls the number of consecutive bars required for the HMA slope to be considered rising or falling. Lower values increase responsiveness to reversals.
  • Trend Sample Size: Determines how many historical trend durations are stored and used to calculate the average probable length.
  • ↑ Trend / ↓ Trend: Customization options for the colors of bullish and bearish trend visualizations.

FAQ

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

What does the "Real Length" represent? It represents the exact number of bars that have elapsed since the current bullish or bearish trend began.

Why does the Probable Length change? The forecast is based on a rolling average of a specific number of previous trends (Sample Size). As new trends complete, older data points are replaced, causing the average to adapt to shifting market volatility.

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.