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?

  • $\begingroup$ A machine learning approach to stock forecasting firstly involves evaluation of noise, stability, lags(autocorrelation), etc. I rarely use technical indicators as inputs, but rather wavelet coefficients and fractal dimensions as an alternative to performing an FFT on the time series. $\endgroup$
    – user5626
    Jul 7, 2013 at 17:01

3 Answers 3


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.


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.

  • $\begingroup$ like what? HMM? $\endgroup$ Apr 26, 2011 at 3:47
  • $\begingroup$ State-space models, decision trees, MARS $\endgroup$ Apr 29, 2011 at 21:49
  • $\begingroup$ Do you first calculate the indicator and then normalize, or normalize and after that calculate TA on the normalized data? $\endgroup$
    – siamii
    May 6, 2013 at 22:46
  • $\begingroup$ @QuantGuy State space models are far overrated (since everyone uses them now, they've been stripped of much opportunity), but agreed on decision trees. $\endgroup$ Feb 9, 2014 at 7:57

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.