ANN MACD (BTC)
Oct 2, 2019

The ANN MACD (BTC) indicator utilizes an Artificial Neural Network (ANN) to forecast price momentum by processing multiple technical inputs through a multi-layer perceptron architecture. This tool aims to provide a refined MACD histogram output that anticipates potential trend shifts based on historical training data from the BTC market.
Usage
The Usage section focuses on interpreting the neural network's processed output, which is presented as a traditional MACD histogram. Traders can use the histogram to identify bullish or bearish momentum shifts.
- Histogram Analysis: When the histogram is green and below the zero line (based on the script's specific logic), it indicates a potential bullish recovery or momentum. When red and above the zero line, it suggests bearish pressure.
- Zero Line Crosses: Crosses above or below the zero line serve as primary signals for momentum direction.
- Bar Coloring: By enabling the "Barcolor" setting, the chart bars will change color to match the momentum state, allowing for easier trend identification directly on the price action.
Details
The script implements a simple feed-forward neural network with a single hidden layer containing 8 nodes. It uses the tanh activation function for both the hidden and output layers. The network was trained using 301 rows of data with a learning rate of 0.6 and momentum of 0.8.
The model processes six specific inputs derived from the percentage change (tangent difference) of:
- Volume
- Bollinger Lower Band
- Bollinger Basis (Middle Band)
- Bollinger Upper Band
- Relative Strength Index (RSI)
- Standard MACD Histogram
The output of the neural network is then compared against the current price change to generate a residual signal, which is subsequently smoothed by a standard MACD calculation (12, 26, 9) to produce the final displayed histogram.
Settings
- Barcolor I / 0 ?: Toggles the coloring of price bars based on the indicator's momentum state.
- RSI Length: Determines the lookback period for the RSI calculation used as a neural network input.
- MACD Fast Length: The fast EMA period for the internal MACD input.
- MACD Slow Length: The slow EMA period for the internal MACD input.
- MACD Signal Length: The signal line smoothing period for the internal MACD input.
FAQ
How do I interpret the histogram colors? The histogram colors represent the output of the neural network processed through a MACD filter. Green typically represents bullish momentum while red represents bearish momentum, though the logic is inverted relative to the zero line compared to standard MACD.
Can I use this on any timeframe? While the script can be applied to any timeframe, the original training data was focused on the 15-minute timeframe for analysis on 4-hour charts or higher.
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.