Financial Example
Hi All,
I’d love to give encog a try with a financial time series but I'm having a little trouble getting started. What I was hoping to try and do was use encog to make trade decisions.
I’m having a little trouble figuring out where to begin with a time series.
Would you use an array which would hold an entire time series ex: 900 prices?
(1 day of 30 second prices)
I was also trying to understand what types of inputs I'd need.
Inputs:
I also have the 12-15 inputs, things like moving average, parabolic, relative strength, acceleration, angle of least squares, ect…
I’m guessing I’d also have to add what
Inputs:
1. Indicator1 ex: (EMA, SMA, RSI, CCI, PAR, MACD)
2. …
3. Indicator12
4. CurrentPostion (Holding Long, Holding Short, Not Holding)
5. CurrentTime (The array of 900 is getting passed in, what’s the current position,)
6. Duration (how long you held the current position)
(example: its 11:35:30 and your next trade will execute 11:36:00)
6. Does it make sense to pass in some sort of look back value (like what just happened in the last 3 minutes)
7. Still thinking about more to add…
Outputs:
1. Buy to open a position (BTO) Buy
2. Sell to close a postion (STC) Sell
3. Sell to open a position (STO) Short
4. Buy to close a position (BTC) Cover
5. Hold Current position
I’m guessing the process would go something like:
1. Grab one day of data
2. Calculate all of the indicators
3. Then walk through the day from beginning to end, opening and closing positions (I’m guessing randomly to start with)
4. Calculate the results for the day (
5. Use the profit as a measure of success
6. Punish for over trading.
7. Restart
Any suggestions you might have or even just a pointer to a general direction would be really helpful!
Thanks all,
Chris
Here’s an example of one of the indicators…
Chart:
http://i.investopedia.com/inv/articles/site/SAR1.gif
Article:
http://www.investopedia.com/articles/technical/02/042202.asp
The vertical red and blue lines are prices of the stock. (Open High Low Close)
The little blue dots are the parabolic indicator.
When the dots are on the bottom they indicate hold a long position (if parabolic < hold long position)
When the dots are on the top they indicate hold a short position (if parabolic > hold short position)
Parabolic is great in trending markets but it fails in non-trending markets.
The idea would be to combine multiple indicators to make buy sell decision based on multiple indicators.




For one, make sure you normalize the data going in.
Also the way you are describing your training will work okay. But it would be more of a score-function than pure supervised training. So simulated annealing, or a genetic algorithm might best serve you, rather than RPROP(or similar) where you calculate a score, rather than creating a training set.
Jeff
Neural networks are very powerful market analysis tool. But too many indicator inputs will take you nowhere.
First read this article.
http://www.trade2win.com/knowledge/articles/general_articles/neural-netw...
Refer this article. This is in russian, translate it to english. The concept is same here he is using a perceptron. He is linearly classifying the market as Bull and Bear. Using a NN use can do a non linear classification.
http://articles.mql4.com/ru/289
Even this site has valuable info on how a neural network can be applied to trading.
http://cortex.snowcron.com/forex_nn.htm
Use one network to capture a small aspect of the market and provide that output to other network which makes the trading decision.Since forex brokers allow automated trading ,there are lots of systems based on neural networks. You can visit the forex related forums to get more info on various trading robots.
Visit this site (www.mql4.com). Every year they conduct a automated trading contest. Consistently trading systems based on Neural networks and GP have excelled consistently. Dont miss to read the interview transcripts of contestants.