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.

we have, because who has the time to do a multimillion-iterations optimization

loop? Wait a minute—this book is about algorithms—right? This task is definitely

not doable with a run-of-the-mill exhaustive search optimization engine. An

exhaustive search optimization is where you use brute force and test every possible

combination—no stone is left unturned. Come to think of it, AmiBroker has access

to three forms of genetic optimization. With the use of genetic optimization (GO)

and artificial intelligence, we can accomplish the task and do it in just a few minutes.

Not all iterations are executed, only those that fit a certain fitness. Imagine millions

and millions of optimizations carried out in minutes instead of days or even months.

Genetic optimization is an awesome tool, and this very topic will be discussed in

Chapter 8. Right now, even if you don’t understand artificial intelligence, just

know it is the tool that we need to accomplish this task.

All optimizations will be carried out at the portfolio level. Individual market

optimizations will not be conducted. This will cut down considerably on the total

number of optimizations. Each set of parameters will be applied to each market in

the portfolio, and only one set will be chosen to represent each algorithm. Also,

like I said earlier, we are not trying to fit a system to data in an attempt to create a

trading plan. We are just trying to cover all bases in this algorithm comparison. The

winning parameter sets will be used for illustration purposes only.

AmiBroker was able to complete the task in roughly 40 minutes. This time

period covered all optimizations across the four algorithms. Pretty darn impressive!

Table 3.11 shows the top 10 parameter sets for each algorithm and their associated

profit/loss, maximum drawdown, number of trades, average trade, profit factor,

Ulcer index, and percent winners.

Table 3.12 shows the best parameters sets from each optimization.

And the winner is—triple moving average! The results show a unanimous

champion, the triple moving average. The Donchian algorithm came in second with

the Bollinger algorithm close behind in third. The winner produced a tremendous

profit-to-drawdown ratio of 7.04. Quite a bit better than the second place Donchian

Channels. The TMA accomplished this feat by trading only 574 times. Before

discussing the winners let’s discuss the also-rans.

The DMA algorithm came in last place. It looks like using the parameter sets

revolving around an ultra-short length of 9, a long length of 160, and a $5,000

money management stop shows the best results. These numbers were derived from

taking an average of the top 10 parameter sets. These numbers really don’t make

sense; the normal 1:2 and 1:3 ratio wasn’t anywhere near the top. Basically, the

parameters are telling us the nine-period moving average will eventually get on the

trend, after going back and forth for a while, and hold onto it tenaciously.

The Bollinger Band algorithm came in third place, but with very respectable

results. The parameter sets revolving around a 100-bar moving average length and

2.25 standard deviations and a $4,000 money management stop show the best

95

COMPLETE TRADING ALGORITHMS

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!