Examples

Top  Previous 

Two examples of how to use Neural Indicators are called NI Example 1.cht and NI Example 2.cht.  The charts for the examples are installed in the NI Examples subfolder of the NeuroShell Trader folder.


NI Example 1

In NI Example 1, we used America OnLine (aol) stock prices. We built a simple trading strategy in which a Neural Indicator was used for a long entry condition (rule), and another for short entry condition. There were no exit conditions; we reversed from a long to a short and vice versa. We used the optimizer in the NeuroShell Trader Professional to find the weights (from -1 to 1) of the neural indicators.

 

The conditions for both the long entry and the short entry were the conditional recurrent net Recur4C. Therefore, we could simply insert them as conditions without using the relational A>B indicator, since A>B is already "built into" Recur4C.

 

Since the recurrent nets, unlike the others,  "look backwards" in time for several bars, we wanted to try them with inputs that did NOT look back. We simply used open, close, high, and low. We believe the best way to use recurrent nets is to use inputs which have no lookback period, meaning that no lagging type indicators are needed.

 

We allowed the optimizer to find the scaling period too.

 

At the time we built this example, just after the first of May 2000, the market had been experiencing large swings for several months as it tried to decide whether to go bearish or yet more bullish after the rather large tech stock "correction". We chose to optimize over a limited time period to avoid learning too much about the previous bull market. We optimized over one year, and held out 2 months for out-of-sample evaluation.

 

The results for both the optimization period (in-sample) and the backtest period (out of sample) beat the buy and hold strategy.


NI Example 2

In NI Example 2 we used DELL stock prices and built a strategy that went only long. Both the long entry and long exit rules were the same: the familiar A>B relational indicator, in which we made A the Neural Indicator (Jump3). B was limited to 0 in the optimizer. So were seeking to optimize two nets: one which is used as a buy signal when it outputs a value > 0, and another which is used as a sell signal when it outputs a value > 0.

 

Note that we didn't need the net for the sell signal to be giving a value < 0 for sell, although we could have. Since we are not predicting any value, just getting signals, the optimizer can evolve signals either above or below zero. In other words, the symmetric nature of the nets means the optimizer can find weights to make the output go either above or below zero for a signal.

 

Again, we did not allow B to vary during optimization, since the weights would adjust themselves around zero. We carefully set the range for B so that only zero was allowed, although you may want to experiment with allowing the optimizer to set B as well in the range -1 to 1.

 

For the network inputs we used some typical technical indicators, allowing the optimizer to find the proper parameters as it found the weights.

 

Again, we used rather short backtest and optimization periods to avoid modeling ancient history.

 

The results didnt beat buy and hold, but they were decent, which wasnt bad for that period.