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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

it is boundless extended readings above +100 or below −100 can indicate very

strong trend moves.

The weakness of the CCI is its variability due to the volatile nature of the underlying

instrument that is being applied to. A volatile stock will cause the indicator to behave

erratically and jump well above/below the standard +100 and −100. These

benchmarks may have to be expanded based on the market being analyzed. Many

traders also apply a smoothing function to the CCI in an attempt to eliminate

knee-jerk reactions.

We will be discussing two trading algorithms based on the CCI (Box 2.5). The

first will utilize the CCI in the same manner as the RSI and stochastic. The second

algorithm will use the CCI in a completely opposite manner—trend confirmation.

Box 2.5 Donald Lambert’s CCI OB/OS System Description

If 9-day average of the CCI 20-day crosses above −100, then

Buy MOC

If 9-day average CCI 20-day crosses below + 100, 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 indicates market on close.

Donald Lambert’s CCI OB/OS System p–code

‘Donald Lambert CCI OB/OS

myCCIVal = average(cci(cciLen),smooth);

If myCCIVal crosses above -100 then buy this bar on close

If myCCIVal crosses below 100 then sellShort this bar on

close

49

STOCHASTICS AND AVERAGES AND RSI! OH, MY!

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

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!