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.

if myADX < 35 then

if MarketPosition = 1 and close < Lowest(close[1],3)

then

Sell this bar on close

if MarketPosition = -1 and close > Highest(close[1],3)

then

BuyToCover this bar on close

The directional movement algorithm description is straightforward and can be

modeled by a flowchart. A finite state machine is not needed because, as we discussed

in Chapter 1, this system follows a certain flow that is directed by a combination

of logical steps and decisions that eventually lead to termination of the process.

Figure 2.3 shows the flowchart of this algorithm.

START

Next or New

Bar

Yes

31

Yes

Sell on Close

if Close is

Lowest Close

4 Days

No

Is Position

Short?

Is Position

Long?

No

Is ADX > 35?

Yes

Is + DI above

– DI ?

No

Buy to Cover

Yes

on Close if

Is Current

Is – DI Above Yes

Close is Highest

Position

+ DI?

Close 4 Days

Short?

Yes

Yes

Is Current

Position

Long?

No

Buy Market on

Close

STOCHASTICS AND AVERAGES AND RSI! OH, MY!

No

No. –DI = +DI

No

Sell Short

Market on

Close

FIGURE 2.3

Wilder’s directional movement algorithm.

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!