| Diamond Backtesting with Walk Forward Manager (BTWFMgr)
EasyLanguage® (Professional Software Solutions) |
BTWFMgr allows you to easily add a small section to your
strategy EasyLanguage®
which will capture your backtesting data.
See the Code example below
| 1. | Open Editor with your Strategy Code
|
||||||||||
| 2. | Open the Diamond BTWFMgr Start/Programs/Diamond Backtesting with Walk Forward Manager (BTWFMgr)/Backtesting with Walk Forward Manager (BTWFMgr) |
||||||||||
| 3. | Click on the "Strategy Preparation" button |
||||||||||
| 4. | Strategy Preparation Box Your Strategy name should appear in the Strategy box at the top. Click on the Prepare button to load the strategy input list. When you are ready click on the "Modify Strategy" button, so BTWFMgr can generate the modified EasyLanguage Code. ![]() You can also use the clipboard to send BTWFMgr the EasyLangugage code: a) Enter the strategy name into the "Strategy Name" box b) Copy the entire Strategy Code to the Cluipboard (Select All + Copy) c) Click on the "Load from Clipboard" button d) Confirm the modification - click on YES ![]() e) The Strategy Input parameter will appear f) Click on "Modify Strategy" g) The newly modified Strategy Code will appear in NOTEPAD - Copy and Paste the new text to the EasyLangugae Window. |
||||||||||
| 5. | To save overhead - select only the Strategy variables you
will use in optimizations: You see a list of all your Strategy Input variables. All numeric variable - which can be used in backtesting optimizations - are pre-selected with an X in the "Optimize" column To select/de-select a variable double click on that line - and the X will appear/disappear |
||||||||||
| 6. | The click on the Modify button This will automatically add a small section at the end of your strategy and verify the strategy for you. That's it - you are ready to go - click on the Confirmation box: ![]() |
||||||||||
| 7. | A new Strategy input parameter has been added: nBTWFMgrExport The following modes are available:
|
||||||||||
| 8. | When you initially develop your strategy you usually want
to research the effect of additional context input values. With BTWFMgr you can check now if certain ranges or values will improve the overall strategy result and then filter bad entries out! We have added - as an example automatically - the TimeOfDay context value, so you can see of certain times yield better results. This function allows you to add also these context input values to the BTWFMgr data capturing:
|
Example BTWFMgr added data
collection
segment:
//====== BTWFMGR_F2D83D3A_BBDB_447E_B0FE_209ED95E4E3F =============
//====== WALK-FORMWARD-OPTIMIZATION DATA COLLECTION SECTION ======
external: "PSS_BT.DLL", int, "PSS_BT", LPSTR,LPSTR,LPSTR,IEasyLanguageObject;
Vars: nRetWFO(0),WalkForwardVar(""),nMinMove(MinMove/pricescale);
Array: arrPSSBTInp[100](0), arrPSSBTVal[30](0);
if nBTWFMgrExport > 0 then begin
if nBTWFMgrExport = 3 AND Marketposition = 0 then
Buy("L") 1818 shares next bar at market;
if GetAppInfo(aiOptimizing) = 1 then begin
//------ Setup Input Name List
if WalkForwardVar = "" then begin
WalkForwardVar = "RSILength";
WalkForwardVar = WalkForwardVar + "/OverSold";
WalkForwardVar = WalkForwardVar + "/OverBought";
WalkForwardVar = WalkForwardVar + "/EMALength";
WalkForwardVar = WalkForwardVar + "/LossAmt";
WalkForwardVar = WalkForwardVar + "/GainAmt";
if nBTWFMgrExport = 1 OR nBTWFMgrExport = 3 then begin
WalkForwardVar = WalkForwardVar + "/*TimeOfDay";
// WalkForwardVar = WalkForwardVar + "/YourContextVariables";
end;
end;
//------ Transfer current Strategy Input Values
arrPSSBTInp[0] = RSILength; // Strategy Input#01
arrPSSBTInp[1] = OverSold; // Strategy Input#02
arrPSSBTInp[2] = OverBought; // Strategy Input#03
arrPSSBTInp[3] = EMALength; // Strategy Input#04
arrPSSBTInp[4] = LossAmt; // Strategy Input#05
arrPSSBTInp[5] = GainAmt; // Strategy Input#06
arrPSSBTInp[6] = Time; // Context Input#01
//------ Transfer Position Details
arrPSSBTVal[0] = 6; // Number of tracked Strategy Inputs
if nBTWFMgrExport = 1 OR (nBTWFMgrExport = 3 AND CurrentShares = 1818) then
arrPSSBTVal[0] = 7; // add Number of Context Variables
arrPSSBTVal[1] = (MarketPosition(0)*MaxShares(0));
arrPSSBTVal[2] = (MarketPosition(1)*MaxShares(1));
arrPSSBTVal[3] = EntryPrice(0);
arrPSSBTVal[4] = EntryPrice(1);
arrPSSBTVal[5] = ExitPrice(0);
arrPSSBTVal[6] = ExitPrice(1);
arrPSSBTVal[7] = PositionProfit(1);
arrPSSBTVal[8] = Commission + Slippage;
arrPSSBTVal[9] = nMinMove;
arrPSSBTVal[10]= BigPointValue;
if LastBarOnChart then
arrPSSBTVal[11] = 1 // Last Bar reached
else
arrPSSBTVal[11] = 0;
arrPSSBTVal[12] = BarNumber;
arrPSSBTVal[13] = BarType;
arrPSSBTVal[14] = BarInterval;
arrPSSBTVal[15] = nBTWFMgrExport;
arrPSSBTVal[16] = Date;
arrPSSBTVal[17] = Time;
arrPSSBTVal[18] = Open;
arrPSSBTVal[19] = High;
arrPSSBTVal[20] = Low;
arrPSSBTVal[21] = Close;
arrPSSBTVal[22] = Volume;
arrPSSBTVal[23] = BarsSinceExit(1);
arrPSSBTVal[24] = BarsSinceEntry(1);
arrPSSBTVal[25] = MarketPosition*CurrentShares;
//------ Call Diamond Backtesting Data Collection Interface
nRetWFO = PSS_BT(Symbol,"PSS_RSISample"{Strategy},WalkForwardVar{InputNames},self);
end;
//------ Close new Positions in Potential Mode
If nBTWFMgrExport = 1 then begin
If marketposition = 1 then
Sell ("LPot") next bar Market;
If marketposition = -1 then
Buy to Cover ("Spot") next bar Market;
end;
end; // End of Data Collection Insert
//====== BTWFMGR_F2D83D3A_BBDB_447E_B0FE_209ED95E4E3F =============
© Copyright 1998-2006, Burkhard Eichberger, Professional Software Solutions
All Rights Reserved Worldwide.