Sunday, May 15, 2016

Technical indicators with neural nets

Hello, welcome back to my blog about automated trading. Two weeks ago I have prepared research about the technical indicators. This time I will connect them with the feed forward neural network.

For the source code example, please download repository and update to branch 13-nn_predictions, changeset de4b7457a020.

Background

Theory says that Neural Network is very good for discovering dependencies. So I took it in the naive way. For notation, please refer to the previous post. I took the following indicators:
  • Today's %K(5)
  • Percent change between today.close and today SMA(5)
  • Percent change between today.close and today SMA(10)
  • Percent change between today.close and today.bollinger lower band with (14,2)
  • Percent change between today.close and tmorrow.open
  • Tomorrow's day of the week 
Now during the research I discovered few things (will be talking about them below). One of them was that it doesn't make sense to make complicated questions at once. So category I choose for this time is whether tomorrow.close > tomorrow.open or not.

Coding and results

There is a bit of reorganization within a code. I put a lot of models into the librares. And I have grouped the test application together into com.enterprisemath.tradingcloudblog.testapps package. The one for today is called PricePredictionTestApp2. The whole workflow is same as in this article. The only what changes is group of stocks, question and prediction method.

This method gave me following results.
  • Number of not sure: 1296
  • Number of true when true: 15
  • Number of true when false: 34
  • Number of false when true: 8
  • Number of false when false: 11
  • Total success rate: 0.019
Honestly, this doesn't look good enough to bet money on it. However walking through the whole process and studying for it actually gave me good insights. Let's summarize the learning points.
  • Use simple questions for predictions. It's better to combine multiple models rather than trying to build the super model.
  • Data preparation
  • Confusion matrix
  • Probabilistic and recurrent neural networks
All these are good startups for the whole research and give enough space to improve. So let's do that.

That's it for today. Next week I will talk about the data preparation. Thank you for reading!!!

No comments:

Post a Comment