31.07.2021 Views

Ultimate Algorithmic Trading System

Using automated systems for trading in stock markets

Using automated systems for trading in stock markets

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FIGURE 8.4

mother.

At split 1 the genes that will be passed onto the offspring by the father and the

In this example, chromosome (2) is the mother and chromosome (4) is the father.

The crossover point was randomly generated at one, so the offspring received one

gene or number from the mother and three from the father.

Offspring =[00,30,30,04]

Chromosome(2)crosses chromosome(4)atpoint one = New chromosome (2)

How to Allocate Genes to Junior—Using VBA Excel

240

GENETIC OPTIMIZATION, WALK FORWARD

'make sure mom and dad are not one in the same

'we are not dealing with earthworms - right?

If parentsList(i).dad <> parentsList(i).mom Then

Randomize

'how do we split mom and pop's genes?

crossPt = Int((3 - 0 + 1) * Rnd + 0)

'mom is replaced by combination of old mom and dad

For k = crossPt To 3

Next k

chromo(parentsList(i).mom,k)=

chromo(parentsList(i).dad,k)

After the creation of the offspring, it was then used to replace the old chromosome

(2), just like a child taking over his parents’ business. This example chose only one

crossing but in later generations (after total simulation was completed) more chromosomes

were crossed, and they were crossed at different points. The computer is

hoping to create a better offspring than the parents but as in real life this doesn’t always

happen. Just ask your neighbors whose 35-year-old son still lives in their basement.

■ Mutation

In nature, a mutation is change in a genetic sequence. A mutation can be good or

bad, but no matter—it does add diversity. In GA, a mutation occurs infrequently

but can tremendously help find a solution to a complex problem. Without mutation,

www.rasabourse.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!