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.

direction of the 200-day moving average but waits for a pullback for longs and rallies

for shorts. The Bollinger B% function returns the location of the current close in relationship

to the upper and lower Bollinger bands. If the function returns a small value,

then the close is close to the lower band and vice-versa for a high value. This system is

programmed in EasyLanguage and the source code will be revealed in the Chapter 7.

Box 3.4 Mean Reversion (MR)

Calculate the 200-day moving average of closing prices

Calculate the 5-day Bollinger B% value

Calculate the 3-day moving average of the Bollinger B% value

If c > MAV(c,200) and MAV(BB%,3) < 0.25, then buy next bar at open

If c < MAV(c,200) and MAV(BB%,3) > 0.75, then sell short next bar at open

Liquidate long MOC when BB% > .75 or close < entryPrice - 2000/big-

PointValue

Liquidate short MOC when BB% < 0.25 or close > entryPrice +

2000/bigPointValue

Take a look at the equity curve in Figure 3.8. Here is a pattern system that trades

the stock indices as well.

109

$54,000

$48,000

$42,000

$36,000

$30,000

Closed Trade Equity Curve

COMPLETE TRADING ALGORITHMS

$24,000

$18,000

$12,000

$6,000

$0

FIGURE 3.8

14 28 42 56 69 83 97

Equity curve that reflects a pattern system.

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!