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.2

The AmiBroker Editor window.

As you type the first line of code you will notice the words PositionSize and

MarginDeposit turn bold. If you didn’t capitalize the P or the S in the word

PositionSize, the editor will automatically do so after you type the last letter in

the word and hit the space bar. The editor is letting you know these are keywords

or tokens. And that you can’t use these for variable names. If you are looking for a

keyword or a function name, and you type what you think it is and it doesn’t turn

bold or change colors, then you know you have not used the correct word. The

editor can help you find the proper keyword or function name through its autocompletion

feature. Later we will develop an algorithm based on Bollinger Bands,

but for illustration purposes let’s assume you want to calculate an upper Bollinger

Band now, but don’t know the exact words for the function. You probably think

the function name starts with the letter ‘‘b,’’ so for now type the letter ‘‘b’’ after the

first line and press the <Ctrl> and <spacebar>. A list of keywords and functions

starting with the letter ‘‘b’’ will appear in your editor window (see Figure 4.3).

If you look down the list, you will see the name BBandTop. If you select and

double-click on the name, the function call will be automatically inserted into your

code. The more of the function name you type, the smaller the list of options will

appear after pressing <Ctrl> and <spacebar>. If you type BBand and hit the

123

INTRODUCTION TO AMIBROKER’S AFL

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!