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.

TestSystem—this button reads the data that was dumped into the Data

worksheet and puts it into the seven data arrays. The program then starts looping

through each bar and flows through the user-defined entry and exit logic. If

the consequence of the user-defined logic results in a trade entry or exit, the

software makes a note and processes the order as if it was actually executed. At

the termination of the data loop, all trades are processed and an equity stream of

closed trade profits and open trade equity is dumped out into the EquityStream

worksheet.

Keep in mind this is a very simple program and can only work on one market one

system at a time. Figure 5.3 shows a typical layout of the Data worksheet.

The GetData component was previously actuated by simply clicking the button

and as you can see the different cells, open, high, low, close, volume, and

open interest, were then populated. Also, the Tick Value and Min Tick values

were cross-referenced in the DataMaster and their respective cells were filled in as

well. The DataMaster worksheet contains the symbols and their properties in the

current data universe. As you can see, stocks are not listed, but that doesn’t mean

you can’t test them. Commodities and futures contracts have different sizes and

values. These values must be stored somewhere so the software can gain access to

them during the testing process. Originally, the software simply asked the user

to input this information, but I quickly discovered this was way too cumbersome

and decided to create the DataMaster worksheet (see Figure 5.4).

These data properties were derived directly from the underlying data. If you

don’t get these values right, then your results will be completely wrong. Most

data vendors will provide this information when you purchase their end-of-date

(EOD) historic database. I use two data vendors, CSI and Pinnacle, for commodity

and futures price quotes. You can buy deep historic databases from either of these

vendors for a very reasonable price. If you purchase data through a reliable vendor,

151

USING MICROSOFT EXCEL TO BACKTEST YOUR ALGORITHM

FIGURE 5.3

A typical Excel data worksheet.

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!