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.

FIGURE 4.17

The AFL Code Wizard ‘‘Edit Rule’’ dropdown list.

15-bar moving average of Close (now) is greater than 15-bar

moving average of Close now

Well, this won’t do. The 15-bar moving average of Close will never be greater

than the 15-bar moving average of Close. Click on the number 15 in the second

moving average phrase and slide down to the pane right beside the pane with the list

of functions (see Figure 4.18). Change the period from 15 to 30. The code in the

Edit Rule should now read:

15 -bar moving average of Close (now) is greater than 30 -bar

moving average of Close now

So the rules for entering a long position are now defined. Buy when the 15-bar

moving average (fast) is greater than 30-bar moving average (slow). As you point and

click the AFL code equivalent is created simultaneously. The AFL code equivalent

thus far is:

135

INTRODUCTION TO AMIBROKER’S AFL

MA( Close , 15 ) > MA( Close , 30 )

If you want to see what is going to be ported in the AFL Editor, click on the

tab labeled Auto-generated Formula. The tab is to the right of the Design

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!