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.

to the user. Instead of having to retype different values for avgLen every time you

want to test a different value, you can simply change it at the Analysis phase. I will

show how easy this is a little later. Go ahead and finish typing in the rest of the code

and go under the File menu and save it to your Desktop or a folder on the C drive

as MyFirstAlgo. Now you need to check the syntax to make sure you have typed

everything properly. Click on the AFL Check icon (see Figure 4.5).

If you type everything in correctly, then nothing will happen. If you mistyped a

word, you might get something like Figure 4.6. If this happens, just make sure you

have everything typed properly and then hit the icon again. After the syntax has

been properly checked (compiled), click on the Send To Analysis window icon

(see Figure 4.7).

This will create an Analysis tab in the AmiBroker program. I have continuous

crude oil data plotted in the first chart. If you don’t have crude oil data, don’t

worry, just create a chart of something. I inform AmiBroker to apply MyFirstAlgo

to the current data by using the dropdown menu in the top-left corner (Figure 4.8).

Before we click on the BackTest icon, go ahead and click on the Parameters icon.

It’s the icon that looks like an old equalizer (Figure 4.9).

125

FIGURE 4.5

The AFL Check icon.

INTRODUCTION TO AMIBROKER’S AFL

FIGURE 4.6

An error warning.

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!