Using Technical Indicators as Neural Network Inputs
Summary
The document explains how technical indicators such as moving averages and MACD can be used in neural network trading models. Indicators can be calculated from market data and supplied as predictor variables to the network, alongside raw price data. The output layer represents the target to predict, while the network’s architecture, training method, and stopping rules must also be specified.
Inputs are commonly normalized, for example by using differences or standardized values, so the model learns relative changes rather than absolute price levels. The responses also describe alternatives: a network could learn representations resembling indicators, and genetic programming has been used to build dynamic decision rules from indicators. These are conceptual suggestions and examples rather than comparative evidence that one approach performs best. Neural networks have had mixed results in quantitative finance, and indicator usefulness and model design depend on the prediction task and data.
Key ideas
- Technical indicators can be supplied as predictor features alongside raw price data.
- The target variable belongs in the network output, while architecture and training choices require separate design.
- Normalizing inputs can help models learn relative movements instead of absolute price levels.
- Neural networks may learn indicator-like transformations, and genetic programming offers another way to combine signals.
- Indicator inputs do not guarantee trading performance, and neural network results in finance have been mixed.
Tags
Full text
# How to incorporate technical indicators into neural networks? # How to incorporate technical indicators into neural networks? I plan to develop a neural network to trade commodities futures, but while messing around with some code, a question came up. If I understand correctly, people use various technical indicators with their networks (moving average, MACD, etc.). However, how do these come into play in a machine learning context? Should I just give the values of these functions as inputs, along with the actual data, for each point in time? ## Answer by Rune Aamodt (score 13) https://quant.stackexchange.com/a/1055 Most contemporary NN systems are just made to use the raw price time series for input (maybe with some kind of simple normalization), but for my thesis I wrote a system which traded equities with an ANN with technical indicator inputs (MAs, MACD, even pattern matching for stuff like Head-Shoulders, support levels, etc.). So at least conceptually it's definitely possible. One of the most interesting systems I saw when researching for my thesis, which actually got a lot of impressive results as well, used technical indicators with genetic programming to create a kind of dynamic decision tree to generate buy/hold/sell ratings. If I was to get into AI algo trading again, that's probably the direction I'd focus towards. ## Answer by Ram Ahluwalia (score 9) https://quant.stackexchange.com/a/1053 The predictor variables would consist of the input layer to the neural network. The output layer would consist of your target. You need to specify the hidden layer, number of nodes per layer, the learning algorithm, and the learning algorithm stopping criteria. Typically inputs are normalized (first-differenced, z-scored, etc.) before inputting into the neural network so the model is training on relative changes as opposed to absolute levels. Neural networks have had mixed success in quant finance and in my view there are some more interesting non-parametric techniques worth looking at. ## Answer by Vass (score 5) https://quant.stackexchange.com/a/1056 I will break up your question in to some parts to make answering easier. "people use various economic indicators with their networks (moving average, MACD, etc.) However, how do these come into play in a NN context?"--the 'indicators' MA, MACD etc. come from the data. They are measures of the data capturing some aspect. You could try to capture/replicate these measures within the NN. In a way, your NN is also an 'indicator'. You can have 'indicators' made up of smaller 'indicators'. A NN approximates a functional form that fits your input-to-output targets. It obtains a shape that you train it to on past data. "Should I just give the values of these functions as inputs, along with the actual data, for each point in time?"--yes. It is not straight forward though. a single perceptron (node) in the NN cannot handle a complex indicator's output even if it is scalar (1 dimensional but constraints usually appear alongside to work properly). The perceptron usually has a sigmoidal firing function, and many indicators require more sophisticated interpretations than a threshold bounding. It is context dependent without a general gauranteed solution. My advice is that since you say that you are starting in the AI field, make some NN to approximate the indicators first, and then experiment, and with something breaking down; ask again.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.