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.

FIGURE 7.16

All dependencies and functions are nested inside their strategy algorithm.

show all the functions or dependencies included in the Strategy algorithm (see

Figure 7.16).

This is just neat way to keep track of all the code connected to a particular project

and is a relatively new feature of the EL Editor.

■ Samples of EasyLanguage

Here is a simple Commodity Channel Index (CCI) algorithm:

{CCI system utilizing 3 ATR Profit

And a 1 ATR Stop}

inputs: cciLen(20),smooth(9);

vars: myCCIVal(0);

myCCIVal = average(cci(cciLen),smooth);

If myCCIVal crosses above -100 then buy this bar on close;

If myCCIVal crosses below 100 then sellShort this bar on close;

If marketPosition = 1 then

begin

If c > entryPrice + 3* avgTrueRange(10) then sell

this bar on close;

if c < entryPrice - 1* avgTrueRange(10) then sell

this bar on close;

end;

221

AN INTRODUCTION TO EASYLANGUAGE

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!