Thursday, April 26, 2012

Predicting Forex with Google preditct - Atempt #1

Since there lot of math involved in AI I was very happy to find that Google has product exactly for that. And to use it is relatively simple. My first attempt was to predict trading signals for Forex i.e. where to buy  (close buy) and to where sell (close sell). So I went through the price history and tagged time points as I would be actual trading on historical data. Here is an example:
Purple - SELL, yellow - CLOSE_SELL, green - BUY, blue - CLOSE_BUY
So after few days I had 44177 time points tagged with 5 different values: BUY, CLOSE_BUY, SELL, CLOSE_SELL and NONE. From all of these time points - 4724 were tagged with some signal and all others as NONE.
Then it was time to prepare prediction data. My learning data was similar to this:
SELL, 99 price values before time point, price at current time point
NONE, 99 price values before time point, price at current time point
NONE, 99 price values before time point, price at current time point
NONE, 99 price values before time point, price at current time point
....
CLOSE_SELL, 99 price values before time point, price at current time point
...
Model training took about 1.5 hours and Google Predict ended up with "classificationAccuracy": 0.9 
It was time to test the model.  To test the model I again use historical data. I sent about 60 request (some of them were from the same data I used to train model) and for all of then response was NONE. So I consider this as failure, but there is also bright side:
  1. Found a way how not to use AI and what learning data is considered bad;
  2. Learned how to use OAuth2 and how to use Google services from my code;
  3. Got experience with MongoDB (noSQL database);
  4. Refreshed my knowledge in Wicket, Swing and JFreeChart;
  5. It was fun and I got new ideas to test.

1 comment: