All indicators

ARIMA Moving Average and Forecaster

Jan 11, 2024

Static chart image
ForecastingMoving AveragesVolatility

The ARIMA Moving Average and Forecaster indicator provides an advanced time-series modeling framework that combines autoregressive integrated moving average logic with dynamic forecasting to project future price trends and volatility boundaries. This tool streamlines the complexity of ARIMA modeling by automating stationarity assessments and providing visual error bands for trend analysis.

Usage

The Usage section focuses on how the ARIMA model interprets historical data to project future price paths. Users can employ the indicator as a specialized moving average or as a predictive forecasting tool.

  • Trend Analysis: The ARIMA Moving Average serves as a lagged average (based on the SMA of the current trend). It can replace standard moving averages like the 50 or 200 SMA while providing additional context through error bands.
  • Stationarity and Lag Selection: For accurate forecasting, the data must be stationary. Users can enable the "Auto Determine Lag Length" feature, which uses Dickey-Fuller tests to select the most statistically appropriate lag.
  • Forecasting: When enabled, the script projects the current trend into the future. It displays a central result line (conservative estimate) alongside upper and lower confidence levels. These levels illustrate potential continuation or reversal scenarios based on the current rate of change.
  • Active Trading: By adding standard deviation extensions, traders can create wider volatility bands, useful for identifying overextended price action during intraday sessions.

Details

ARIMA (AutoRegressive Integrated Moving Average) combines three components:

  1. AutoRegressive (AR): Relates an observation to its own previous values.
  2. Integrated (I): Differences the data to achieve stationarity, stabilizing the mean.
  3. Moving Average (MA): Incorporates the relationship between an observation and residual errors from prior steps.

The model captures the underlying "trendiness" of the asset. A key implementation detail is the restriction on lag length; the script is optimized for low lag orders (typically 1–5). Higher lags can introduce excessive trend bias, leading to unrealistic projections. The script also includes a 95% confidence interval calculation to define the range where the price is statistically likely to fall.

Settings

General Settings

  • Source: Determines the price data used for calculations (default is Close).
  • Train Time: The lookback period used to train the ARIMA model.
  • Lag Length (SMA Length): The manual lag order applied to the model when auto-selection is disabled.
  • Auto Determine Lag Length?: When active, the script uses statistical tests to find the optimal lag for stationarity.

Visuals and Forecasting

  • Plot Error Bands: Toggles the visibility of the standard error bands around the moving average.
  • Forecast Length: Sets how many bars into the future the forecast lines extend.
  • Add an Additional Standard Deviation Extension: Increases the width of the error bands by a user-defined multiplier.
  • Show Forecast Lines: Displays the projected price paths on the chart.
  • Plot Forecast Table: Generates a UI table showing specific price targets for most likely, upper, and lower confidence results.
  • Round Number Decimal Points: Adjusts the precision of values displayed in the forecast table.

FAQ

How do I interpret the Upper and Lower Confidence levels in the forecast?
These levels represent the expected rate of increase or decline. They show what the trend would look like if the current momentum continues or if a reversal occurs within the calculated statistical variance.

Why are the forecast lines not appearing on my chart?
This typically happens in heavy trending environments where the lack of bidirectional movement prevents the calculation of confidence intervals. Manually setting the Lag Length to 3, 4, or 5 usually resolves this.

How can I access the ARIMA Moving Average and Forecaster?
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.