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.

66

STOCHASTICS AND AVERAGES AND RSI! OH, MY!

risk measure and modify version 1 to make it more risk averse. Looking back at

the results you will notice a relatively high maximum drawdown at the portfolio

level—greater than 30 percent. In the world of hedge funds, this is an acceptable

level—I am not kidding! Some of the most successful hedge fund managers have

taken their clients down more than 40 percent before rebounding. This is the main

difference between hedge fund participants and the typical investor. The trade-off

for higher returns is, of course, higher risk. Let’s see if we can be a better hedge

fund manager and reduce that 30 percent plus drawdown. Let’s assume we have a

million-dollar allocation (remember, we are in a dream world), we only want to

risk 0.2 percent (0.002 or $2,000 per trade), and we don’t want to reinvest profits

(at this point). How can we use this information to reduce drawdown in version 2

of our trading algorithm?

Version 1 buys on penetration of upper Bollinger Band and gets out on the

penetration of the moving average. So our initial trade risk can be defined as

the distance between the upper band and the moving average. If we equate this

distance to dollars, then we can filter out any trades that exceed our acceptable risk

amount of $2,000. Now, will this guarantee that our largest loss will be $2,000

or less? No! Remember when I stated the bands were self-adapting? During the

life of any given trade, the bands could expand and the distance between the outer

bands and the moving average could grow well beyond our $2,000. This could

result in an individual trade loss greater than that amount. Well, can we at least

guarantee the maximum drawdown will decrease? Again, no! Maximum drawdown

is a consequence of a losing streak. Even though we are filtering trades (eliminating

what we consider too risky), that doesn’t necessarily mean the trades involved in

the losing streak will be eliminated. The filtering process might even eliminate the

trades that pull the equity curve out of the drawdown. So, theoretically the risk

aversion overlay might not help at all and might even make matters worse. Let’s see

for ourselves and use the following pseudocode on the same 35 markets:

‘Trend Following with Bollinger Bands

‘Utilizing 60-day average and 2 standard deviations

‘Version 2 - don’t take any trade with risk > $2,000

myAVG = SMA(C,60)

myTopBand = BollingerBand(C,60,+2)

myBotBand = BollingerBand(C,60,-2)

filterTrade = false

‘convert price range to dollars by multiplying by dollar value of points

If (myTopBand - myAvg) * BigPointValue > 2000 then

filterTrade = true

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!