All indicators

ANN MACD GOLD (XAUUSD)

Oct 23, 2019

Static chart image
Volume BasedSignalsOscillatorsMachine LearningMoving AveragesVolatility

The ANN MACD GOLD (XAUUSD) indicator is a specialized momentum tool that utilizes an artificial neural network (ANN) trained on historical gold data to identify potential trend shifts. By processing 19 distinct input variables through multiple hidden layers, it generates a refined MACD-style histogram designed specifically for XAUUSD analysis on the 4-hour timeframe.

Usage

The indicator is primarily used to identify trend direction and momentum exhaustion in the gold market.

  • Bullish Momentum: Represented by green histogram bars below the zero line, suggesting a potential long entry or recovery phase.
  • Bearish Momentum: Represented by red histogram bars above the zero line, suggesting potential short entries or distribution phases.
  • Bar Coloring: Users can toggle the "Barcolor I / 0 ?" setting to "ON" to highlight chart candles based on the indicator's signal state.
  • Alerts: The script includes built-in alert conditions for buy and sell signals, which trigger upon the crossover of the neural network's processed histogram values.

Details

This script implements a Feedforward Neural Network architecture optimized for the XAUUSD pair. The network was trained over 329,818 cycles with a training error of 0.012767.

The system inputs include the rate of change (tangent difference) for:

  • RSI (Relative Strength Index)
  • Volume
  • MACD Histogram
  • Momentum
  • Bollinger Bands (Basis, Upper, and Lower)
  • 12 Exponential Moving Averages (EMAs) ranging from period 3 to 60.

The hidden layer structure consists of 5 nodes in the first layer and 1 in the second, using the Hyperbolic Tangent (Tanh) activation function to process nonlinear relationships before outputting a final prediction value.

Settings

Main Settings

  • Barcolor I / 0 ?: Toggles the colorization of price bars on the chart.
  • BB Length: Sets the lookback period for the Bollinger Bands used in the ANN inputs.
  • BB Mult: Sets the standard deviation multiplier for the Bollinger Bands.

Fast EMA Group

  • Fast EMA 1-6: Configures the periods for the short-term moving averages (defaults: 3, 5, 8, 10, 12, 15).

Slow EMA Group

  • Slow EMA 7-12: Configures the periods for the long-term moving averages (defaults: 30, 35, 40, 45, 50, 60).

FAQ

How do I use the ANN MACD GOLD (XAUUSD)?

Add the indicator to your XAUUSD chart, preferably on the 4-hour timeframe. Look for the histogram color shifts and use them in conjunction with your existing trading strategy to identify entries and exits.

What data was this neural network trained on?

The network was specifically trained using gold (XAUUSD) data with a focus on capturing the relationship between momentum oscillators, volatility bands, and multiple EMA trend lines.

How can I access this script?

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.