computer intelligence sports betting resource

(c) 2003 - 2008 All Rights Reserved
Home.The Basics.Tactics.Best Software.Software Comparisons.Directory.Contact Us.Links.
Home.The Basics.Tactics.Best Software.Software Comparisons.Directory.Contact Us.Links.
The international stock markets are a particular suitable area for modeling neural networks because of the amount of historical data so readily available on the Internet

Many have tried before you of course, and it is oh so easy to find many a good fortune story of those who have tried and succeeded. There are of course though just as many (if not more) poor souls who have lost a packet following silly systems, share trading software with grand claims or even DIY and good looking AI methods which were perhaps poorly researched and/or tested. You have been warned!

One great advantage of building your own trading systems using a neural network is that your method could be unique - or as near as is possible to be - and you will not be one of the many thousands following one or more of the very well established trading analysis tools so loved (and maybe overused?) by traders worldwide.

Having your own buy & sell indicators allows you to tackle the markets on your own terms, not influenced by how many others may be following the same rules . . and beating frequently you to the trading desk which will adversely affect the price you can get.

Models for training and trading can be as simple or as complex as you think fit. At one end of the scale you can use just the share’s historical closing prices in isolation, a basic “chartist” approach if you like, spotting trends in the stock’s highs and lows.

You can factor in references to the appropriate market sector, does it echo or foretell what may happen? You may feel another, even seemingly unassociated individual share or sector, has an influential effect. Or add in the index for the market as a whole, or even from an overseas market.

Many see “being different” as essential to stock market success, so don’t be lead by the crowd (but don’t try to lead anyone yourself either!) just tread your own path.

Such tactics cannot guarantee success of course, much depends upon how well you set out your stall in the first place. Neural networks are excellent at uncovering trends not immediately obvious to the casual observer. But remember, don’t put all your eggs in one basket - diversify and don’t go looking too hard for shares to trade . . . if it’s out there it will probably find you!

Money can be made from both rising and falling markets by the shrewd investor armed with the right tools. Check out our case study for a worked example of a very simple NNet!

Neural network, tell me, what happens if . . .

By way of illustrating the potential for developing successful trading systems using artificial neural network, we’ll take you step-by-step building, training and operating a very simple approach.

In the first instance we need the historical shares prices to train our NNet, these were obtained from uk.finance.yahoo.com using the excellent DataBull utility. Data for quoted distribution company
Electrocomponents PLC (ECM.L) from 15 May 2000 to 16 Jan 2004.
Yahoo financial data supplies end-of-day figures for each trading day
including the “adjusted close”, the figure we will be utilising for our NNet training. The data will be presented as follows;

Our INPUTS will consist of 10 consecutive days adjusted closing prices. Our OUTPUT will be the adjusted close 5 trading days after the final input date (usually 1 calendar week)

What we’re attempting to do is to train a network that will predict the likely closing price in one week’s time given the last 10 consecutive days closing prices.

So, the first of our downloaded data was As per the table shown here. The first 10 consecutive days are 15 May through 26 May. The adjusted close 5 Trading days later would be on 5 June.

The first formatted training line would therefore be;

- - - - - - - - - - - - - - - inputs - - - - - - - - - - - - - - - - - -    Output
690, 682.93, 687, 663.5, 659, 660, 667.5, 654.5,650, 652  >  665
. . . similarly line 2 would be . . .
682.93, 687, 663.5, 659, 660, 667.5, 654.5,650, 652, 644  >  683
. . . etc. . .
Using Ward System’s Predictor neural network software the assembled file was trained (using Predictor’s “genetic” option which enables validated training without the need for a separate sample)

After 250 generations the NNet’s attempts to map the training model’s graph was as shown below, the actual prices (blue line) being closely mapped by the neural network’s predictions (red line).
Now our neural net model is trained we are in a position to test its effectiveness on subsequent dates. Simply gather the past 10 consecutive days adjusted closing prices for ECM.L, feed this information into our trained net and generate the net’s prediction of what the closing price 5 days from now may be.

The first few trading days after the training period gave these outputs;
date
-9
-8
-7
-6
-5
-4
-3
-2
-1
today
PRED
actual
12-Jan-04
322.25
319.5
325
325
331.75
327.5
327.75
332
337
339.75
340.50
361.5
13-Jan-04
319.5
325
325
331.75
327.5
327.75
332
337
339.75
337.75
340.58
355.5
14-Jan-04
325
325
331.75
327.5
327.75
332
337
339.75
337.75
348.25
341.37
346.25
15-Jan-04
325
331.75
327.5
327.75
332
337
339.75
337.75
348.25
345.5
340.77
340.75
16-Jan-04
331.75
327.5
327.75
332
337
339.75
337.75
348.25
345.5
351.25
341.19
345
The important column is the NNet’s prediction (PRED). By comparing this with today’s close we can establish whether the net forecasts a rise or a fall over the week. Above, for example, the daily forecasts indicated 12 Jun 0.75 rise over the following 5 days, this is followed by a 2.83 rise, 6.87 fall, 4.72 fall and finally a 10.05 rise.
(The actual 5 days later share price is shown in the final column)

Now of course we would perhaps be rather foolish to follow any NNet’s recommendations blindly. In such an uncertain environment no system is going to ever be 100% accurate. After all, only one of the five predictions from our trained NNet is near the actual - but it is a “feeling” for the movement trend  we should be more interested in.

Allowing for the grey areas inevitable any type of forecasting, it would be prudent I’d suggest to follow a NNet’s recommendations ONLY when a degree of error has been factored in. Just how large or small this should be will be a matter of personal choice with reference to the market in which you’re operating and your own view of risk & reward.

If we implement a nominal 10% margin for error on our example strategy it would dictate that we only trade when the NNet’s predicted value indicated a gain over the week which was equal to, or greater than, 10%. Such a tactic when applied to the two-year interval (12 Jan 2004 to 10 Jan 2006) following the training period indicated the following trades;
date
-9
-8
-7
-6
-5
-4
-3
-2
-1
today
actual
PRED
PerShare
%P/L
28-Apr-05
239
234
239
238
237
237
233
237
232
227.75
228
255.24
0.25
0.11%
29-Apr-05
234
239
238
237
237
233
237
232
228
230
231
257.70
1.00
0.43%
03-May-05
239
238
237
237
233
237
232
228
230
229
233.5
257.35
4.50
1.97%
04-May-05
238
237
237
233
237
232
228
230
229
225.5
233.25
257.25
7.75
3.44%
05-May-05
237
237
233
237
232
228
230
229
226
229.5
236.5
258.97
7.00
3.05%
06-May-05
237
233
237
232
228
230
229
226
230
228
238.75
259.57
10.75
4.71%
09-May-05
233
237
232
228
230
229
226
230
228
231
237.75
260.28
6.75
2.92%
10-May-05
237
232
228
230
229
226
230
228
231
233.5
242
260.22
8.50
3.64%
11-May-05
232
228
230
229
226
230
228
231
234
233.25
240
260.82
6.75
2.89%
12-May-05
228
230
229
226
230
228
231
234
233
236.5
244.75
261.47
8.25
3.49%
14-Oct-05
244
246
241
240
234
236
235
230
231
229
225
253.90
-4.00
-1.75%
18-Oct-05
241
240
234
236
235
230
231
229
233
232.75
225.5
257.25
-7.25
-3.11%
19-Oct-05
240
234
236
235
230
231
229
233
233
226.5
229.25
256.68
2.75
1.21%
20-Oct-05
234
236
235
230
231
229
233
233
227
228.5
222.75
258.78
-5.75
-2.52%
21-Oct-05
236
235
230
231
229
233
233
227
229
225
220.25
259.25
-4.75
-2.11%
24-Oct-05
235
230
231
229
233
233
227
229
225
229.75
228
259.44
-1.75
-0.76%
25-Oct-05
230
231
229
233
233
227
229
225
230
225.5
228
261.04
2.50
1.11%
26-Oct-05
231
229
233
233
227
229
225
230
226
229.25
231
261.09
1.75
0.76%
27-Oct-05
229
233
233
227
229
225
230
226
229
222.75
236.25
261.65
13.50
6.06%
28-Oct-05
233
233
227
229
225
230
226
229
223
220.25
235
259.77
14.75
6.70%
31-Oct-05
233
227
229
225
230
226
229
223
220
228
235.25
261.22
7.25
3.18%
01-Nov-05
227
229
225
230
226
229
223
220
228
228
253.5
262.58
25.50
11.18%
02-Nov-05
229
225
230
226
229
223
220
228
228
231
246.25
262.02
15.25
6.60%
03-Nov-05
225
230
226
229
223
220
228
228
231
236.25
251.5
262.95
15.25
6.46%
04-Nov-05
230
226
229
223
220
228
228
231
236