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.

Box 2.4 gives a description of a simplistic version of a stochastic crossover system

utilizing the same profit-and-loss objectives as the RSI algorithms. The results of this

stochastic algorithm applied to several markets are shown in Table 2.4.

Box 2.4 George Lane’s Slow Stochastic System Description

If 14-day slow %K crosses below slow %D and slow %D is greater than 80, then

Buy MOC

If 14-day slow %K crosses above slow %D and slow %D is less than 20, then

Sell Short MOC

If position is long

Take Profit: If close > entry price + 3 ATR Sell MOC

Protective Stop: If close < entry price − 1 ATR Sell MOC

If position is short

Take Profit: If close < entry price − 3 ATR BuyToCover MOC

Protective Stop: If close > entry price + 1 ATR, BuyToCover MOC

Note that MOC stands for market on close.

46

STOCHASTICS AND AVERAGES AND RSI! OH, MY!

George Lane’s Slow Stochastic System p–code

‘Most software will provide a function that

‘provides all the components of the stochastic

Value1 = stochastic(h,l,c,rawKLen,smooth1,smooth2,1,myFastK,

myFastD,mySlowK,mySlowD)

If mySlowK crosses above mySlowD and mySlowD < 20 then buy

this bar on close

If mySlowK crosses below mySlowD and mySlowD > 80 then

sellShort this bar on close

If marketPosition = 1 then

If c > entryPrice + 3* avgTrueRange(10) then sell this

bar on close

if c < entryPrice - 1* avgTrueRange(10) then sell this

bar on close

If marketPosition =-1 then

If c < entryPrice - 3* avgTrueRange(10) then buyToCover

this bar on close

if c > entryPrice + 1* avgTrueRange(10) then buyToCover

this bar on close

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!