5. Predicting the
Stock Market
5.1 Data Collection
From the Internet
5.2 Data Preprocessing
5.2.1 Sorting
5.2.2 Moving Average
5.3 Commands
5.4 Prediction
with Preprocessing: Intel 4
5.5 Prediction Without Much
Data
5. Predicting
the Stock Market
For the sake of discussion, we will predict Intel stock one-month
ahead. You can obviously substitute Intel for any other stock or market
index. To predict Intel one month ahead, the monthly data is required.
You can change the prediction to one-day, one-week, or one-year ahead by
substituting daily, weekly, or yearly data, respectively.
Attrasoft PredictorPro predicts events based on the past
history:
-
If the past and the future are the same, the prediction is expected to
be accurate.
-
If the past and the future are different, the prediction should be used
as a reference.
Before you play real games with real dollars, you should make simulations
with past data, or future data (pretending you are playing without the
economic cost of your learning experience). Do not jump into predicting
the stock market directly without any experience. A reasonable simulation
is to set up a model and make 100 - 1,000 predictions. If the results
are not satisfactory, change your data set.
5.1 Data
Collection From the Internet
It is important to avoid any typing in data collection. There are many
sites on the Internet, which offer free data. In the following, we will
show you how to download data from the “Microsoft Investor” section of
the Microsoft Networks.
Microsoft Excel is required for the following. Assume we want to collect
Intel Corp. (Intc) data, here is the procedure:
First Time User:
-
Go to: http://investor.msn.com/quotes/quotes.asp?beenthere=1&Page=Research&Item=QuoteDetail
and enter "intc";
-
On the page, click "Charts";
-
Click "Start Download"; and when prompted to install a Microsoft software,
click "yes';
-
You should see a test chart now, and click "I see the chart";
-
Click "Period/10 Years" or other selections you want;
-
To download, click "File/Export Data", at this point, your Excel will be
opened and the Intel data is right there. Save the data and the job will
be done.
After the First Time :
-
Go to http://investor.msn.com/charts/charting.asp?Symbol=intc, on the page
enter "intc";
-
Click "Period/10 Years" or other selections you want;
-
To download, click "File/Export Data". At this point, your Excel will be
opened and the Intel data is right there. Save the data and the job will
be done.
Now, you have obtained the Intel stock data for the last 7 years,
and it looks like this:
Intel Corporation (INTC)
Monthly prices (Dec 1991 to Nov 1998)
DATE HIGH
LOW CLOSE VOLUME
Oct-98 90.813
75.813 89.188
393720800
Sep-98 89
69.75 85.75
369103300
Aug-98 92.625
70.938 71.188
440267900
Jul-98 88.25
72.25 84.438
396391200
Jun-98 77.625
65.656 74.125
360081300
…
Apr-92 7.406
6.125 6.688
443011200
Mar-92 8.438
6.438 6.906
424595200
Feb-92 8.594
7.375 7.938
340300800
Jan-92 7.875
5.906 7.484
589994400
Dec-91 6.156
5.031 6.125
260759200
Now we want:
-
Sorting
-
Calculating moving averages
-
Preparing the PredictorPro Data.
5.2 Data Preprocessing
5.2.1 Sorting
Now without typing a single number, you have obtained the Intel
data in the Excel spread sheet. Before you can use the data, you have to
preprocess it for two or three steps:
-
Sorting
-
Calculating Moving averages (Optional)
-
Prepare PredictorPro data
The above data file downloaded from Microsoft Investor puts the latest
data in the first row and the earliest data in the last row. The PredictorPro
can not use this type of data. The PredictorPro uses data in
order: the earliest data first, and the latest data last. To reverse
the order, in the Microsoft Excel:
-
Highlight the data;
-
click "Data\Sort"; and
-
click "OK".
Now the data is sorted in the correct order for the PredictorPro.
5.2.2 Moving Average
To save space, please refer to the last chapter.
5.3 Commands
Stocks like Intel or Microsoft grow exponentially, therefore, you should
use the following commands:
-
Real/+ Exponential
-
Real/-- Exponential
5.4
Prediction with Preprocessing: Intel 4
The data set of this example is:
-
5-month moving average of Intel
-
5-month moving average of SP 500
-
5-month moving average of Microsoft
Clicking "Example/Intel 4 ..." can generate this example.
The goal is predict the 5-month moving average of Intel on Oct-98, which
is 80.9378.
Click "Real/-- Exponential", we get
Possibility
Confidence*Probability
76.0928 1086.51 107.244
92
79.5299 1101.96 103.787
58
---------------------------------------------------
Weighted Average
77.4218 1092.48 105.907
Highest Probability
76.0928 1086.51 107.244 92
Error of each number
0.859271 3.86403 0.86441
The confidence is too low. To change the Trend from 5 to 4, click
"Data/link" and enter 4 under Trend. Click "Real/-- Exponential" again,
we get the distribution:
Possibility
Confidence*Probability
86.404 1078.78 102.058
262
77.8113 1071.05 105.515
4000
76.0928 1086.51 100.329
364
81.2484 1063.32 105.515
330
82.9669 1063.32 105.515
398
82.9669 1071.05 105.515
670
79.5299 1094.23 110.702
160
76.0928 1086.51 107.244
228
81.2484 1101.96 108.973
160
79.5299 1101.96 103.787
126
77.8113 1086.51 107.244
364
76.0928 1094.23 110.702
330
---------------------------------------------------
Weighted Average
78.9408 1075.29 105.665
Highest Probability
77.8113 1071.05 105.515 4000
Error of each number
0.859271 3.86403 0.86441
Prediction confidence varies from month to month. The confidence
for another month might be much higher. The prediction is 78.9408
± 0.859271, which is close to 80.9378.
5.5 Prediction
Without Much Data
There are times you want to predict a new stock, "A", where no data
is available. You can substitute the stock, "A", with another similar stock,
"B".
You have to be careful here: if you use a 5-trend prediction, you must
have at least 4 rows of "A" stock. if you use a 6-trend prediction, you
must have at least 5 rows of "A" stock.
To predict Intel, the data set of this example is:
-
5-month moving average of Microsoft
-
5-month moving average of SP 500
Clicking "Example/Intel 5 ..." will generate this example.
The goal is to predict the 5-month moving average of Intel on Oct-98,
which is 80.9378.
Click "Real/-- Exponential", we get
Possibility Confidence*Probability
79.0219 34576
76.242 7936
81.8018 20184
84.5816 380
87.3615 256
62.3426 64
---------------------------------------------------
Weighted Average
79.6091
Highest Probability
79.0219 34576
Error of each number
1.38994
Prediction confidence varies from month to month. The confidence
for another month might be much higher. The prediction is 79.6091
± 1.38994, which hits 80.9378.
Online Order/Online Fax order:
Attrasoft PredictorPro for Windows
Version 2.8 ($494.99 + $5 US Shipping and Handling)
Mail Order: 499.99 (S&H included)
PredictorPro
Attrasoft, Attn.: Gina
P. O. Box 13051
Savannah, GA. 31406, USA
Send questions or comments to:
webmaster@attrasoft.com
or contact us at:
Attrasoft,
P.
O. Box 13051, Savannah, GA. 31406, USA
Copyright © 2001
Attrasoft, Inc. All rights reserved. |