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.14

Source: TradeStation

A 60-day, two-SD Bollinger Band on crude oil.

Here’s how you calculate Bollinger Bands:

Calculation of Bollinger Bands using 60 days and 2 standard deviations:

1. Calculate a 60-period SMA of price for the chosen time period.

2. Calculate the standard deviation of the 60-day sample (use a computer).

3. The top or upper band is the 60-period SMA + 2 standard deviations.

4. The bottom or lower band is the 60-period SMA − 2 standard deviations.

Let’s put the Bollinger Band indicator to a test utilizing a common trend-following

algorithm (Box 2.8).

Box 2.8 Using John Bollinger’s Bands as a Trend Follower

Buy when market closes above top band.

Sell short when market closes below bottom band.

Sell when market position is long and market closes below average.

Cover when market position is short and market closes above average.

myAvg = Average(C,60) ‘ 60-day moving average calculation

myTopBand = BollingerBand(C,60,+2) ‘ 2 std dev above average

myBotBand = BollingerBand(C,60, −2) ‘ the − 2 means below average

If close crosses above myTopBand, then

Buy MOC

63

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!