Wednesday, August 15, 2012

Neural networks - part II

On the last post I described the theoretical background of planning a trading system base on a neural network predictor. In short the network is used to predict the daily bar's high and low prices.
Using this information I decided to place pending orders in a form of a grid based on the network's predicted prices, and the error.
The probability of the estimated low price to be lower than the real low price is noted as P{estimated L<L).
The prediction is not perfect. There is an error which is the estimated L - L.
If we'll use the estimated low price and we sub struct X pips from it then we enlarge our chance to avoid a loss, but we reduce the chance to enter a trade because that price may be out of the daily range.
I created a map of probabilities based on the training data I used in the training stage for each type of operation (long or short).
For long I found what is the probability that the estimated low price - X pips is lower than the actual low price: Prob{est L - X pips < L).
I also calculated a similar map for the exit price: Prob{est H - X pips < H}. Here I would like to be on the safe side. The bigger X is the lower the exit price which is more realistic.
Here is an example for such a map:

Neural network probability map
The upper graph is for short and the lower is for long.
The red color bars are entry prices and the blue for exit.
For example lets make a short pending order:
The probability that the high price will be below 1.246 is 80%.
The probability that the low price will be above 1.235 is over 80%.
So if the daily bar headed towards 1.246 first, we will open a short trade with a take profit around 1.235.
The stop loss is set also according to this grid map. 30 or 40 pips above the entry price we'll place the stop loss. The probability that the price will reach there is very low (a few percents).
In addition we can split the money using a money management model among a few levels like a grid.

Using the neural network requires an integration of the network itself into Metatrader (MQL). I used Matlab and for the development process. Training the network took around 25 minutes per symbol. That trading strategy is trading against the trend. Sometimes it works and sometimes not.
I traded manually using the network's products as I showed above. I didn't recognize a good enough potential at that moment which justified making that effort.
Cons:

  • It required a complicated additional work
  • The volume was low - 0-4 trades per day


It was an interesting try but that's not what I am looking for.
A potential use of this system would be as targets combined with another trading strategy.

No comments:

Post a Comment