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.

performance of the trading system. There is enough information provided to help

determine if your particular algorithm is good enough for either trading or further

research. As you can see, the interface is simple enough—load data, test system,

plot equity. The hard stuff is getting into the VBA and creating a trading algorithm

with the tools at hand.

■ Programming Environment

154

USING MICROSOFT EXCEL TO BACKTEST YOUR ALGORITHM

The BASIC (an acronym for Beginner’s All-purpose Symbolic Instruction

Code) programming language was introduced in the 1960s but became popular

in the mid-1970s. BASIC quickly became the most popular interpreted language

for beginners. Over the years, compiler companies have extended BASIC into

professional software development. Microsoft has been using BASIC derivatives for

decades and it is at the heart of VBA. When you code your trading algorithm in

to the ESB, you will be programming in pure BASIC. You will see a lot of lines of

code (I wish I could hide them, but the VBA Editor doesn’t allow for collapsible

text regions) that you will not need to understand (unless you want to). There

are just three major sections with which you will need to concern yourself. But

before we get into all that, launch your Microsoft Excel and make sure you see the

Developer tab in the Ribbon. If you don’t see it, then you will need to turn it

on. You can do this by simply clicking the File menu and then selecting Options.

After Excel Options dialog opens scroll down to Customize Ribbon and click on

it. Figure 5.7 shows the Customize Ribbon dialog and where to click to get the

Developer Tab to show up in the Ribbon.

Once you return to a blank worksheet, the Developer tab should now be

visible. Now go to the www.wiley.com/go/ultimatealgotoolbox and download

the ExcelSystemBackTester.zip file to your C: drive and unzip it. The zip file

contains two folders: Algorithms and Data. Get to the Algorithms folder and open

the BollingerDX spreadsheet. The spreadsheet that opens should look similar to

Figure 5.3. Now click on the Developer tab and the Ribbon should take on this

appearance (see Figure 5.8).

The only icon that we are concerned with is to the far left of the Ribbon, Visual

Basic. Click on the icon/button and the Visual Basic Editor (VBE) will launch.

Make sure your VBE looks like the one in Figure 5.9.

There’s a lot of stuff here. But we are just interested in the modules that are

inside the red oval from Figure 5.9. You don’t need to mess with anything else if

you are just interested in using the ESB to test your trading ideas. The window that

contains the modules is called the Project Explorer. It simply groups all the files

in the project together for convenience.

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!