All indicators

ANN MACD Future Forecast (SPY 1D)

Oct 2, 2019

Static chart image
Volume BasedSignalsForecastingOscillatorsMachine LearningMoving AveragesVolatility

The ANN MACD Future Forecast (SPY 1D) indicator utilizes an artificial neural network (ANN) architecture to predict future market direction by processing technical inputs through a tangent activation function and filtering the results via a MACD framework. This tool aims to provide an advanced forecasting mechanism by combining deep learning principles with traditional momentum oscillators to identify potential trend reversals.

Usage

The Usage section describes how the script can be used for market analysis. The indicator outputs a histogram based on the "seed" value—a combination of the neural network's predicted output and the current price change.

  • Long Positions: Contrary to traditional MACD interpretation, users should look for crossunders (where the histogram moves below the zero line) as the predicted values often work in inverse to current price action.
  • Short Positions: Users should look for crossovers (where the histogram moves above the zero line) to identify potential bearish shifts.
  • Barcolor Overlay: Users can enable the "Barcolor" setting to highlight candles based on the forecast conditions (Green for positive forecast conditions, Red for negative).
  • Divergence Analysis: Because the tool processes inputs like Bollinger Bands and Squeeze Momentum, it can be used to identify early acceleration changes before they appear in standard oscillators.

Details

The script is constructed using a Multi-Layer Perceptron (MLP) logic. The core implementation details include:

  • Activation Function: It uses a correctly implemented Tanh (Hyperbolic Tangent) function to process input data.
  • Inputs: The neural network takes five specific inputs: volume change, moving average change, upper Bollinger Band change, lower Bollinger Band change, and Squeeze Momentum change.
  • Seed Calculation: The output of the ANN is subtracted from the current price change to create a "seed." This seed represents a hybrid of historical data, current developments, and forecasted values.
  • Smoothing: The seed value is passed through a standard MACD (12, 26, 9) calculation. By using exponential averages, the system places higher importance on recent neural network outputs to reduce lag while maintaining forecasting capabilities.

Settings

  • Barcolor I / 0?: Toggles the candle coloring on or off based on the forecast direction.
  • Fast Length: (Internal) The period for the fast EMA calculation of the seed value.
  • Slow Length: (Internal) The period for the slow EMA calculation of the seed value.
  • Signal Length: (Internal) The period for the signal line calculation.

FAQ

How do I interpret the histogram?

The histogram represents the difference between the MACD line and the Signal line derived from the ANN seed. Due to the nature of the predictive model, crossovers are typically treated as bearish signals and crossunders as bullish signals.

Does this indicator repaint?

No, the script does not contain any "future" code (like request.security with lookahead) that would cause repainting. However, the signal is only confirmed once the current bar has closed.

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.