• No results found

Set the length you want to use for your out-of-sample and re-optimization in the Step field, and use the pull-down menu to select the time increment.

AFL AmiBroker Formula Language

N- bar stop You have a choice of:

6. Set the length you want to use for your out-of-sample and re-optimization in the Step field, and use the pull-down menu to select the time increment.

The dates that will be used for each in-sample run and each out-of sample run will be computed and entered into the table. Scroll up and down and review these dates. Be cer- tain they reflect what you want.

7. Select your optimization target from the pull-down list. You should already have se- lected an objective function and been using it all along during your system development and backtesting. K-Ratio, CAR/MDD, RAR/MDD, RRR, and UPI are all good choices. 8. Click OK. This exits the Walk Forward setup dialog.

Each of the walk forward runs is evaluated as it takes place. After an in-sample optimiza- tion, the best set of parameter values is chosen and a single test run is made using those values and that specific in-sample period. The trade summary and equity curve for that in-sample run are calculated. Next, a single test run is made, using those same values, for the out-of-sample period that immediately follows. The trade summary and equity curve for that out-of-sample run are calculated.

There are two reports you can watch as the walk forward runs take place.

The first is the set of in-sample and out-of-sample summaries. These are produced auto- matically and displayed on the walk forward tab.

The second is the concatenation of the in-sample equity curves and out-of-sample equity curves. These are displayed in a pane of the main chart window. But you must first insert the indicator that will display them. Using the charts tabbed menu, expand the equity category, right-click IS and OOS Equity, then left-click Insert.

As the walk forward progresses, you can click on the main chart tab and watch the equity curves develop.

Use the Report icon’s pull down menu and open Report Explorer. Scroll down to the last entry. It is the consolidation of the out-of-sample results. Open that report. Look at the summary statistics and charts. If they look good, your system is ready for trading.

s

ystem

h

ealth anD

p

osition

s

ize

The variation in parameter values from step to step illustrates the dynamic nature of trad- ing systems. It is very rare that one set of parameter values is best over a long period of time. As characteristics of the data change, the model -- the rules and parameter values -- must be allowed to change to keep the system synchronized. Through the life of a trading system, it will pass through periods of close synchronization and high performance, and through periods of weak synchronization and low performance. Just as the model must be allowed to adapt, there is no single position size that is correct for a long period. The question of whether a system is healthy or is broken, and what the correct position size is for current conditions, is critical to trading success. My book, Modeling Trading System Performance, addresses this in detail. It explains how to use the “best estimate” of future trading performance to determine the position size that will result in maximum account growth, while holding drawdown to a level determined by the trader.

Chapter 9 - Analysis

Copyright © 2012 Blue Owl Press, Inc. Download a free copy from www.IntroductionToAmiBroker.com

9 - 36 Synchronization is dynamic. Position size must also be dynamic. The correct position size for a system that is broken is zero.

f

ile

b

utton

The file button has a pull-down menu that gives two choices.

• Export - Export the contents of the Results window to a file in a directory of your choice. The format of the saved file can be either .csv, which can be opened in a spreadsheet for further analysis, or .html, which can be printed, e-mailed, or imported back into the results window.

• Import - Import a file in .html format that was previously exported. The import works best if the file being imported was created by AmiBroker using the Export command.

If the File button is clicked without pulling down the menu, the default operation is Ex- port.

e

Quity

b

utton

The equity button has a pull-down menu that gives two choices.

• Portfolio Equity - Opens a new pane and displays the equity for the most recent run using the portfolio format.

• Individual Equity - Opens a new pane and displays the equity for the most recent run using the current symbol as the price series tested. Changing the current symbol, either by clicking a row in the results window or by selecting a new symbol, changes the equity plot to reflect testing that symbol.

r

eport

b

utton

The report button has a pull-down menu that gives two choices.

• View last report - Opens the report for the most recent backtest. The report is in .html format, with one html page per tab of the report. Reports are saved in the directory C:\Program Files\AmiBroker\Reports. They stay there until you re- move them.

• Report Explorer - Opens the Report Explorer (which runs as a separate program), and loads a summary line for each report in the Reports directory. You can sort the list by clicking on the header of any column.

If you have previously turned on the feature that generates detailed reports (on Analysis > Settings > Report, click Generate detailed reports for each symbol in individual backtest), clicking one of the rows in the report listing will open the detailed report.

The menus for the Report Explorer give a method for selecting and deleting un- needed reports. Use the Edit menu. Either select and delete individual rows. Or select all and then delete.

Chapter 10 - Write It Yourself

Copyright © 2012 Blue Owl Press, Inc. Download a free copy from www.IntroductionToAmiBroker.com

10 - 1

Chapter 10