So far we have looked at a case study where the MLP Neural Network was applied to forecast a Financial Index.  A derived trading model showed that Neural Networks generate higher returns than that of the buy and hold strategy for an Index traded Fund.  Predictive Edge?… Probably not given the simplicity of the model we have been dealing with.  But we have learnt and discovered a few things about MLPs which will be usefull when we shall build more complicated models.

We have seen that

  • A committee of MLP NNs outperforms a single MLP structure.
  • Dimensionally reduced inputs improve the quality of your NN outputs.  Garbage in garbage out.
  • Smoothing your inputs via minimum lag filters enables your outputs to appear in a timely fashion.

Some challenges to overcome with MLPs:

  • The learning algorithms explored thus far only perform local searches.  We dont know if the weights of our trained NN is occupying a local minimum.  A committee NN structure tries to deal with this problem by having different initialisations for each network, but this does not provide a thorough global search mechanism.
  • We limit ourselves to a fixed MLP structure - how do we know our chosen structure is the best given the infinite set of possible structures we haven’t tested?
  • Our forecasts are relatively good for out-of-sample sets closer to the training set.  How do we know what length of walk forward window to use for re-training without compromising the quality of forecasts?
  • etc, etc.

We now move on to look at another Biologically Inspired Algorithm, the Genetic Algorithm.  We would like to apply the Genetic Algorithm to search for suitable parameters for our stock price prediction function.  To start with we will look at a simple prediction function whose structure is fixed, which will form the basis for developing self-evolving prediction functions later on.  We will then move on to look at a form of Genetic Programming known as Grammatical Evolution which allows us to evolve trading rules.  Hopefully by then we would have enough material to develop a Genetically inspired trading model incorporating all the ideas we would have covered by then. 

Part 1: The case of a fixed prediction function

Our prediction function aims to predict the difference between the closing value and the opening value of the FTSE100 index based on historical values.  Because we are limiting ourselves to using historical values for the FTSE100 time-series, our prediction function needs to incorporate the generalised forms of various technical trading strategies that use historical data to forecast and hence trade the index.  A function with terms relating to filters, closing prices, opening prices etc seems appropriate for this task.  The prediction function shall take the form:

eq1.PNG

Where:

  • eq3.PNG is the difference between the closing price and the opening price of the FTSE100 index on day T
  • eq5.PNG is the closing price on day T-1 minus the average of of the closing prices of T-2 up to and including day T-x
  • eq6.PNG is the closing price on day T-1 minus the the lowest price between days T-2 and T-x
  • eq7.PNG is the closing price on day T-1 minus the the highest price between days T-2 and T-x
  • eq4.PNG are all integer values which will be evolved by our genetic algorithm.  So we have 13 integer parameters to evolve.

The time-series of interest is taken from the range 10/07/2000 to 28/12/2006.  We make a slight modification such that our training set occupies the middle of the time-series.  This would allow us to examine how well our model copes with a range it was trained with as well as a range it needs to forecast. 

  • Test Set 1: 800 trading days.  To check how well our model generalises its forecasts and aviods overfitting.
  • Test Set 2: 36 trading days.  This will be the “true” out-of-sample range to forecast.
  • Training Set: 800 trading days.  This range will be used by the Genetic Algorithm to evolve the 13 parameters of our Prediction Function.

range1.png