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.

TABLE 7.1

EasyLanguage Keywords and Abbreviations

Reserved Word Abbreviation Description

Date D Date of the close of the bar.

Time T Time as of the close of the bar.

Open O Open price of the bar.

High H High price of the bar.

Low L Low price of the bar.

Close C Close price of the bar.

Volume V Number of contracts/shares traded.

OpenInt OI Number of outstanding contracts.

212

AN INTRODUCTION TO EASYLANGUAGE

You do this by adding an index to the reserved word. The closing price of yesterday

would be: Close [1]. The closing price two days ago would be: Close [2], and so

on. The number inside the bracket determines the number of bars to look back.

The larger the number, the further you go back in history. If you wanted to compare

today’s closing price with the closing price 10 days prior, you would type: Close >

Close[10].

Before we move on, we should discuss how TradeStation stores dates and times.

January 1, 2001, is stored as 1010101 instead of 20010101 or 010101. When the

millennium changed, instead of incorporating the century into the date, TradeStation

simply added a single digit to the year. The day after 991231 was 1000101 according

to TradeStation. Time is stored as military time. For example, one o’clock in the

afternoon is 1300 and one o’clock in the morning is 100.

After that brief introduction to the EasyLanguage, let’s return to the EL Editor

and take a look at myMeanRev1 algorithm.

Start off by reading the first few lines of code. You will notice that these lines

are comments because the comments are preceded and followed by the left and

right curly brackets, {}. This is your typical mean reversion system and is designed

to trade those markets that demonstrate a mean reversion propensity. All markets

demonstrate mean reversion characteristics at some time or another, but the stock

indices seem to revert to the mean more frequently than the others.

The next lines are the Inputs and Variables used in the algorithm. The user

can change the input values through the Format Analysis Techniques and

Strategies dialog window. This window is brought up once you have applied the

Strategy to a chart. If you like, go ahead and create a Chart Analysis of daily ES

(emini-S&P) going back 10 years. Once the chart has been populated with data, go

up under the Insert menu and select Strategy (see Figure 7.7).

After selecting MyMeanReversion1 from the list of Strategies, your chart

window should contain some trades like the ones shown in Figure 7.8. Now we

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!