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 2.15

Source: TradeStation

Keltner Channels and Bollinger Bands applied to the same data.

for both indicators. We can plainly see that different settings need to be used if

we want the indicators to behave in somewhat similar fashion. In other words, the

Keltner Channel parameters need to be normalized in terms of the Bollinger Band

parameters. This is the only way a fair test can be carried out. The parameters in

question are the indicator length and the width of the bands/channels. We must find

out the number of ATRs that are nearly equivalent to two standard deviations. Is

two deviations comparable to one ATR, or is it two ATR to one standard deviation?

Again, referring back to the chart, we now know that in all likelihood, two ATR

does not equal two standard deviations. We know that trades are generated when

price penetrates the bands/channels, and if the bands/channels are somewhat close

to each other or overlapping, then a similar number of trades should be generated.

Using the number of trades as the objective, a set of normalized parameters can

be determined through optimization of each algorithm across different indicator

lengths and channel widths. Since both standard deviation and average true range

are functions of the size of the sample (length of days, in our case), both length

and width will be optimized. The number of trades will be recorded for each step

of the optimization. If a 60-period two-standard-deviation Bollinger Band generates

3,000 trades, then an equivalent parameter set for the Keltner algorithm would be

those parameters that generated a similar number of trades. Figure 2.16 shows the

number of trades generated utilizing the Bollinger algorithm by varying the length

and width parameters over a basket of 36 futures markets.

This is an unusual graph, so let me explain what exactly is being plotted. The

x-axis plots bins of varying lengths at different width values. The y-axis is the number

of trades generated by the combination of differing lengths and widths. The length

was optimized from 10 to 80 in steps of 2.0 and the width was optimized from

0.25 to 3 in steps of 0.25. The first bin holds all the results of the different-length

variables while holding the width at 0.25. Like the first bin the second bin varies

the lengths while holding the width to 0.50. Notice how large an impact the

71

STOCHASTICS AND AVERAGES AND RSI! OH, MY!

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!