Four examples of how to use Adaptive Net Indicators are called ANI Example 1.cht, ANI Example 2.cht, ANI Example 3.cht, and ANI Example 4.cht.
The charts for the examples are installed in the ANI Examples subfolder of the NeuroShell Trader folder. When you open the charts, you will be asked if you want to use the data saved in the charts. Select "yes" so you can see the same results.
Adaptive Moving Average - ANI Example 1.cht
One of the interesting things you can do with Prediction Nets is to build adaptive moving averages. To do this, you feed the close and several lags of the close as inputs. Then you predict 0 days ahead so that today’s close is included in the moving average. The trick is to find contributions that produce weightings to give the appropriately smoothed indicator. If you weight today’s close too highly, then the indicator will simply just copy today’s close.
Predict6 used with some low smoothing factors makes a fairly decent adaptive moving average of the close. This is what we did in the first example using America Online (AOL) daily prices. With a little work you can probably find smoothing factors that make a moving average perhaps even more to your liking.
You might wonder why we didn’t just use LagPredict1 using the close as the only input, and setting the lag parameter to 5, or whatever value we wanted, for that matter. We could have done that, but the LagPredict function does not allow you to set the contribution factors of each lag individually. In the LagPredict and LagClassify functions, all lags have the same contribution as the main input. We wanted to play with the contributions of each lag.
Using Predict3 - ANI Example 2.cht
The most straightforward way to utilize ANI is by using a Predict function in a Trading Strategy. If the prediction for the future price change is up, we buy. If the future price change is down, we sell.
We can use the percent change instead of the change, but it isn’t reasonable to predict the price itself. The reason is that ANI, unlike the Turboprop 2 neural net in the Prediction Wizard, is a pattern recognizer that does not extrapolate. That means it can never predict a price higher than the highest in the lookback period.
The stocks we used were Boeing (BA) and Intel (INTC). Since we are using Predict3 for both entry and exit rules, it is more convenient to insert it first in the chart. We used the Indicator Wizard and inserted the Predict3 ANI with simple indicators as inputs from the Price Momentum category (CCI, RSI, and Stochastic %K). The output is the percent change in close 1 day in advance. (Remember, this example is only to explain ANI, so we aren't saying the inputs and outputs we are using in this example are necessarily the best ones to use.)
Next we inserted a Trading Strategy in which we used A > B for long entry and A < B for short entry. There will be a different Predict3 for both long entry and short entry. We could have built two more for long and short exits, but we just used a "reversal" for simplicity that only involves long and short entry, and always keeps you in the market.
The A parameters were set to the percent change in close as predicted by Predict3, which we had already created. We let the optimizer find the B parameters, and set the ranges between –10 and 10, because we wouldn’t expect short term percent changes in price much beyond that range.
It is important to note here again that we are using two neural nets which will be optimized separately. One will be optimized to predict the long entry condition, and the other to predict the short entry condition.
One of the interesting things about ANI is that the output indicator can be optimized. This means the optimizer finds out for you:
1. How far ahead the %change should be predicted (the lookahead period). We set this range from 1 to 10 bars.
2. What period of time the %change should be computed over. We used 1 to 10 here too.
Also, the optimizer finds the lookback period (the size of the ANI training set). We limited the lookback period to 200 bars.
The contribution factors will also be found by the optimizer, and we have allowed the search to be between 0 and 2.
We backtested for 6 months, and optimized for two years before that so that our backtest would be out-of-sample. Optimization periods of longer than 2 years would be better if it were not for the way the market had changed from a bull market to an indecisive market at the time we did our examples. We did not want to build models on "ancient history".
If you have used the NeuroShell Trader extensively before, and followed our advice, you may be wondering why we allowed such short training set sizes (the optimizer was allowed to go much lower than 200). We feel that the more "local" nature of the nets we use in ANI may be a little less likely to overfit.
Pattern Recognition With LagPredict4 - ANI Example 3.cht
The way a human would typically do pattern matching on financial data is as follows. He or she would scan the price stream (close) looking for distinct movements. Then he or she would examine the pattern formed by the changes in close for some number of bars (let’s say 11) just prior to the distinct movements. If this human is pretty good at pattern recognition, he or she might even examine the changes in the open, high, and low of the preceding 11 bars as well as the change in close in those bars. The human is looking for what types of patterns in the prior 11 bars that foretell the distinct movement.
Once the human is satisfied that there is a high probability of the distinct movement following certain patterns, he or she can then watch for those patterns in the future. When the patterns appear, the human expects one of the distinct movements to follow, and places orders appropriately.
In this example we have done the same type of pattern recognition with LagPredict4 in a Trading Strategy.
For our actual output, we have selected the 1 day percent change in close, and we let the optimizer find out how far ahead it is best to predict, from 1 to 10.
For our 4 inputs, we have selected the 1day percent change in open, high, low, and close, making sure that the optimizer cannot change the 1 day percent change to a 2 day or any other percent change. The lag value was 10, meaning today’s value and the preceding 10 values are in the pattern.
The results for the stock we picked, Dell Computer, were significantly better than a buy and hold strategy during both the optimization period and the backtest period.
Classification with Classify4 - ANI Example 4.cht
The final example is one of classification, using the indicator Classify4. Inputs were ones found in the Price Momentum category. The output, you remember, must be something that is both positive and not positive, so that there are two classes. We selected the momentum of the close. We let the optimizer decide upon the values of all indicator parameters, the lookahead period, and the contribution factors.
Note that how we set the range of the B value in the A>B and A<B relational indicators. Since the output of Classify4 ranges from –1 to 1, it is not wise to give the optimizer a larger range.
We originally optimized this example using about 8 stocks. Three of the eight responded well, and we deleted the ones that did not exceed the buy and hold strategy. Boeing, Biogen, and Texaco all did quite well in this example.
|