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.

MACDAvg = XAverage( MyMACD,9)

MACDDiff = myMACD – MACDAvg

leftBar2 = MACDDiff[4]

leftBar1 = MACDDiff[3]

centerBar = MACDDiff[2]

rightBar1 = MACDDiff[1]

rightBar2 = MACDDiff[0]

If leftBar2 < 0 and rightBar2 < 0 and centerBar < leftBar1

and centerBar < leftBar2 and

centerBar < rightBar1 and centerBar < rightBar2 then

Buy this bar on close

If leftBar2 > 0 and rightBar2 > 0 and centerBar > leftBar1

and centerBar > leftBar2 and

centerBar > rightBar1 and centerBar > rightBar2 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

The MACD can be classified as an absolute price oscillator (APO), due to the fact

it deals with the actual prices of moving averages rather than percentage changes.

This makes the MACD different from the other indicators we have thus discussed.

A percentage price oscillator (PPO) computes the difference between two moving

averages of price divided by the longer moving average value.

While an APO will show greater levels for higher-priced securities and smaller

levels for lower-priced securities, a PPO calculates changes relative to price.

Subsequently, a PPO is preferred when comparing oscillator values between different

types of trading instruments, especially those with substantially different prices, or

comparing oscillator values for the same instrument at significantly different times.

57

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!