How to optimize a neural network using a genetic algorithm
Updated on 2011-11-19 03:54:45
If you haven't yet created your first neural network prediction model, I strongly suggest you look at the how-to lesson: How to create and trade a Neural Network model
A Genetic algorithm is an evolutionary algorithm that tries to solve optimization problems using techniques inspired by the natural evolution.
An example of an optimization problem is: Given several neural network inputs, which ones should I choose in order to generate a prediction model that is likely to be the most profitable.
- In QuantShare trading software, select "AI" then "Optimizer"
- In the Optimizer Manager form, click on "Create"
- Select "Genetic Algorithm" then "Prediction Model" in the "What do you want to optimize?" list
- Update the genetic algorithm parameters then click on "Next". Example: for a quick optimization, set low values in the "Number of generations" and "Population size" fields.
- Click on "Select a prediction item" then select a neural network model
- Add as many inputs as you want. The optimizer will try to find the inputs combination that gives that highest fitness value.
Example of Inputs:
Relative Strength Index - RSI
Moving Average of the trading volume
Relative strength between a stock and the main market index
10-Bar Rate of Change
To create an optimization based on the neural net underlying trading strategy, type the following fitness formula:
Fitness = StrategyMetric;
- Click on "Next" twice then save your optimize item
To start the optimization of the neural network based on a genetic algorithm, select the previously saved item in the "Optimizer Manager" then click on "Run".