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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Once the frequency of each drawdown is stored in each bin the total number of

drawdown occurrences must be calculated.

freqSum = sum(bins)

Python has a cool list method sum. This method sums up all of the values in the

list in one fell swoop. This is the beauty of an object-oriented language. Once the

total is calculated, the cumulative probabilities is just a loop away.

binProb = list()

for y in range(0,numBins):

if y == 0:

binProb.append(bins[y]/freqSum)

else:

binProb.append(bins[y]/freqSum + binProb[y-1])

268

The probability of bin #1 is simply the number of drawdowns in that bin divided

by the total number of max drawdowns. The subsequent bin’s probabilities are

the probability of the current bin plus the prior bin’s probability. This process

accumulates the frequencies of the drawdowns. Here is a printout of a probability

distribution of an algorithm trading different markets.

GENETIC OPTIMIZATION, WALK FORWARD

Probability of DD < 1547 is 0.060

Probability of DD < 3094 is 0.080

Probability of DD < 4643 is 0.080

Probability of DD < 6192 is 0.280

Probability of DD < 7743 is 0.320

Probability of DD < 9294 is 0.400

Probability of DD < 10847 is 0.400

Probability of DD < 12400 is 0.420

Probability of DD < 13955 is 0.640

Probability of DD < 15510 is 0.660

Probability of DD < 17067 is 0.680

Probability of DD < 18624 is 0.820

Probability of DD < 20183 is 0.880

Probability of DD < 21742 is 0.880

Probability of DD < 23303 is 0.900

Probability of DD < 24864 is 0.920

Probability of DD < 26427 is 0.940

Probability of DD < 27990 is 0.960

Probability of DD < 29555 is 0.980

Probability of DD < 31120 is 1.000

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!