Now BTWFMgr is also available for the AmiBroker
platform!
The following topics are available for BTWFMgr and AmiBroker:
The location were the "Diamond Backtesting with Walk Forward Manager"
will be installed is:
"C:\BTWFMgr"
Compare AmiBroker and BTWFMgr
BTWFMgr replicates the exact equity and performance as shown in AmiBroker when
you run an optimization or backtest!
In this example the top equity results (1910.40, 1586.12, 1538.01 etc) match the
"Diamond Backtesting" window,
which shows also a distribution of all the equity results and the average equity
(around $200):

(Internally BTWFMgr is setting the CalcPL switch in the
"Initial conversation" config section to YES)
Equity Graph
You can also instantly view and analyze EACH backtesting equity graph/result
instantly
by clicking in
the green permutation icon ($1910.49) and even see each position as shown below:
Ho to prepare your System/Strategy in
AmiBroker (AB)_Prep)
In order to use the powerful BTWFMgr functions - you have to convert your AmiBroker System/Strategy
in this simple step.
a) Start the "AmiBroker BTWF Code Preparation" utility
Start/Programs/Amibroker Backtesting with Walk Forward Manager (BTWFMgr)/Amibroker_BTWF_Code_Prepapartion
-OR-
click in BTWFMgr on Functions/Prepare your Strategy for BTWFMgr -OR-
click on the blue exclamation mark icon the BTWFMgr icon
b) When the "AmiBroker BTWF Code Preparation" opened - select the system
you want to prepare for optimizations:

Automatically the different Input names are shown the system is using.
c) Click on the "Prepare" button
d) Choose from:

YES=Replace the converted/prepared system AFL file
NO=Create a new converted/prepared system AFL file with "-BT" added to
the filename
Cancel=stop the preparation process
e) View converted File
If the "Show File" box is enabled the program
will automatically display the
converted AFL file (RSICross.afl)
AFL "Optimize" code lines
The prepapartion program (AB_Prep) will automatically scan all the AFL files in
the Formula folders
and select all the systems which contain lines like:
Variable = Optimize ( "Name",
Default,...);
Example:
RSILength = Optimize("RSILength", 11, 6, 20, 1 );
RSIValue = RSI(RSILength);
Note that you should always use variables before using the optimize parameter in
the code as shown above,
so that the program can pass on the value of the variable to the data collection
module!
NOT LIKE THIS:
RSIValue = RSI(Optimize("RSILength", 11, 6, 20, 1 ));
AFL "Optimize" section begin/end declaration
You can instruct AB_Prep to only seach for Input variables in a specific section
by
surrounding your section with all the Optimize functions with the "//BTWF_START"
and "//BTWF_END" comments:
Example:
//BTWF_START
RSILength = Optimize("RSILength", 11, 6, 20, 1 );
OverSold = Optimize( "OverSold", 20, 5, 40, 5);
OverBought = Optimize( "OverBought", 70, 60, 90, 5 );
//BTWF_END
AFL single bo.Backtest(True) declaration
Note that AmiBroker permits only ONE instance of
the "bo.Backtest(True)" function,
so when the scanner already detects this instructions
above the data collection section,
it will automatically turn the default instruction in the data collection
section into a comment with the line reference:
Example:
if (Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
// bo.Backtest(1); // already called at Line#783
Stratregy Input Parameter Synchronization from
BTWFMgr to AFL file
Added AmiBroker AFL synchronization - using the #include_once function:
a) Right-click on the permutation and select "Synchronize Strategy
Parameter"
![]()
b) BTWFMgr will export all parameter for this permutation to a new AFL file,
which is included after the last "Optimize()" statement or //BTWF_END
command:
//BTWF_END
#INCLUDE_ONCE "C:/Program Files/AmiBroker/Formulas/Systems/RSICross-Perm.afl"
//Inserting Parameter Values for Perm#747
c) A new AFL file is created with the exported values for the
selected permutation (RSICross-Perm.afl):
//BTWFMgr strategy permutation parameter section for Permutation#747
EnableTextOutput(False);
RSILength = 14; //Input#001
OverSold = 15; //Input#002
OverBought = 90; //Input#003
EnableTextOutput(True);
d) A confirmation box appears:

Import SPY 15Min test Data
We have also supplied a sample SPY 15Min intraday data series (SPY15MIN.TXT) -
which is automatically copied to the AMiBroker folder:
"C:\Program
Files\AmiBroker\SPY15MIN.TXT".
To Import this into AnmiBroker:
a) Click on File/Import Wizard
b) Click on PICK FILES and select "C:\Program
Files\AmiBroker\SPY15MIN.TXT".
c) Click NEXT
d) Adjust the settings as shown below:

e) Click on NEXT
f) If you would like you can save these import settings
g) Click on FINISH
h) You should see a new Symbol in the "Symbol" Tab: SPY15MIN
"Diamond Backtesting with Walk Forward Manager (BTWFMgr)" Main Page
BTWFMgr Main Program (Version 2.3f2) direct download to C:\BTWFMgr
BTWFOV Overview Module (Version 2.3f2) direct download to C:\BTWFMgr
© Copyright 2004-2010, Burkhard Eichberger, Professional Software Solutions
All Rights Reserved Worldwide.