Diamond Backtesting with MultiCharts (BTWFMgr)
(Professional Software Solutions)


MultiCharts Trading Software

MultiCharts is a complete trading software platform for professionals.
It offers considerable benefits to traders, and provides significant advantages over competing platforms.
It comes with high-definition charting, dynamic portfolio-level backtesting, EasyLanguage support, genetic optimization, and 300+ strategies and indicators.
Take action: take the 30-day free trial now!

We also prepared a video showing BTWFMgr working in conjunction with the current MultiCharts 32bit version (8.5.6850) - MC32_85_6850.wmv

Check out a Video showing how to run the BTWFMgr ins MultiCharts (Version 6 and 7+) (BT_MC_Demo1.wmv)

Note for 64Bit MultiCharts Users:
Install x64 Plug In: 
To run the current MultiCharts 64Bit Version (recent 8.7 July 2013) - and download the current 64Bit PSS_BT64.DLL file here (Updated Feb 25, 2015) and save to:
C:\Program Files\TS Support\MultiCharts64\PSS_BT64.dll    (436 KB (446,976 bytes)
This plugin has been tested with the latest MC 9.0 (Build 10759) and previous 8.7,8.6,8.5 x64 versions.
Adjust EasyLanguage Code: 
Use the new BTWFMgr Preparation Tool:
C:/BTWFMgr/BTPrep.exe to automatically modify your EasyLanguage Code!
Be sure to enable the MultiCharts x64 checkbox - as shown below - if you use the MultiCharts x64 Version:
 

The new BTWFMgr Preparation Tool wil automatically adjust the EasyLanguage section as shown below - to name the 64Bit name to
"PSS_BT64.DLL":
//====== WALK-FORMWARD-OPTIMIZATION DATA COLLECTION SECTION ======
external: "PSS_BT64.DLL", int, "PSS_BTMC", LPSTR,LPSTR,LPSTR,IEasyLanguageObject;
DefineDLLFunc: "PSS_BT64.DLL", int, "PSS_BTSetExit", FLOAT;
 


Setup

BTWFMgr can also process optimizations now with the TradeStation compatible MultiCharts platform:
Step1: Prepare your Strategy in MultiCharts
Step2: Run the Optimization for your strategy/signal
If you are running Windows - make sure you run MultiCharts.exe in ADMINISTRATOR mode (sometimes running in Windows Vista Mode helps):

Step1: Prepare your Strategy in MultiCharts

 
1 Open the MultiChart PowerLanguage Editor:
2 Open the Strategy you would like to optimize and analyze with BTWFMgr for editing
a) File/Open
b) Enable only the Signal check box

c) Select double click on your Strategy

As a sample you can import our RSI Sample Strategy from here:
PSS_RSISample.pla
3 Open the Diamond BTWFMgr
Start/Programs/Diamond Backtesting with Walk Forward Manager (BTWFMgr)/Backtesting with Walk Forward Manager (BTWFMgr)
or double click on:
C:/BTWFMgr/BTWFMgr.exe
4 Click on the "Strategy Preparation" button (or File/Strategy Preparation)
5 Enter your Strategy name next to the "Strategy Name" Box:
6 Copy the Strategy MultiCharts EasyLanguage code to the clipboard:
a) Open your Strategy EasyLanguage code in Multicharts using the power editor
b) Click on Edit/Select All
c) Click on Edit/Copy
d) Go back to the BTWFMgr preparation box and click on "Load from Clipboard"
e) Click YES on the confirmation box:


7 View the extracted strategy numeric parameter and make any adjustments (usually you want to have ALL parameters selected - the big X):

8 TIf you are running the Multicharts x64 version - check the box: 

This will use the x64 bit DLL for multicharts "PSS_BTMC64.DLL" and the data collection function "PSS_BTMC()"
Otherwise the redular DLL is used: "PSS_BT.DLL" and the regular data collection function "PSS_BT()"
9 The click on the "Modify Strategy" button
This will open the notepad with the new strategy EasyLanguage code.


The strategy is unchanged, just the data collection section is added to your code at the end.
Copy the new code to your strategy code opened in the Multicharts power editor:
b) Click on Edit/Select All
c) Click on Edit/Copy
d) Go back to the Multicharts power editor and box and click on "Load from Clipboard"
e) Click on Edit/Select All
f) Click on Edit/Paste - this will replace the old code with the new modified code
g) Compile the new code
  The only difference between the MultiChart and Tradestation modification
is the DLL function call to PSS_BTMC() instead of PSS_BT()::
MultiChart:
external: "PSS_BT64.DLL", int, "PSS_BTMC", LPSTR,LPSTR,LPSTR,IEasyLanguageObject;
...
nRetWFO = PSS_BTMC(Symbol,"PSS_RSISample"{Strategy},WalkForwardVar{InputNames},self);

TradeStation:
external: "PSS_BT.DLL", int, "PSS_BT", LPSTR,LPSTR,LPSTR,IEasyLanguageObject;
...
nRetWFO = PSS_BT(Symbol,"PSS_RSISample"{Strategy},WalkForwardVar{InputNames},self);


Step2: Run the Optimization for your strategy/signal

 
2a Open your workspace with the Chart and Strategy/Signal loaded
as a sample you can open the PSS_RSISample chart from here:
PSS_RSISample_MSFT15.wsp
2b Right click on the chart and select "Format Signal":
2c Click on "Optimize" and enter your (exhaustive) optimization ranges
and set  the nBTWFMgrExport parameter to 2 - here is an example for our sample signal PSS_RSISample:

A new Strategy input parameter has been added: nBTWFMgrExport
The following modes are available:
0 Disable BTWFMgr data capture
1 Enable BTWFMgr data capture - in initial strategy potential research mode
When you are researching the basic strategy potential and the effect of additional context input values
2 (Default) Enable BTWFMgr data capture - in regular backtesting mode
When you are finalizing strategy development and want to collect data for the Walk Forward backtesting
  Make sure the Properties are sett o $10000 Dollar per trade:
2d Click on OK to start the optimization and the MultiCharts Progress WInodws will appear:
2e When the MultiChart optimization has completed, BTWFMgr will automatically process the newly collected
and display the BTWFMgr Result window and remove its temporary work files.
 2f Make sure the PSS_RSI_Sample (or any other study you use) is compiled:
a) Open in Power Editor
b) Click on Compile/Compile XXX (F3)
c) You should see a message like:

Also the ready Status should show YES:


How BTWFMgr processes the MultiCharts optimzations
BTWFMgr uses the following steps to process MultiCharts optmizations:

Downloading MC:
a) Open existing MultiCharts version ("C:\Program Files\TS Support\MultiCharts64\MultiCharts64.exe")
b) Click on Help/Check for Updates
c) If new updates are available - click on the "download the new version" link 
d) This opens IE and a should enable the direct download link: http://www.multicharts.com/downloads/multicharts.8.7.x64.exe (97MB)
e) Download and install the new version

Import ASCII Data:
a) Open Quote Manager via Toolbar Icon
b) File/Import Data/ASCII

Internal Notes:

Global Mgr gets next Perm Sequence Numebr in: GetNextPermSeq()  
Imprint SeqNbr:
pPerm->m_nPermSeq = g_BTDLLMgr.GetNextPermSeq(); //m_arrMCPerm.GetSize();
pPerm->AddDir(txtLastFnPreData);
//if (_access(txtLastFnPreDef,0) != 0) //"C:/BTWFMgr/PSS_RSISample/SYM1/015Min"
if (pPerm->m_nPermSeq == 1)
 pPerm->m_bFirstRun = TRUE; // we need the def file
Write new Event form main API: PSS_BTMC()
calls: PSS_BTEvtMC(txtSym,pStrat,pInpDesc,nBTWFMgrExport,nMaxInp,(FLOAT *)&Flt,(FLOAT *)&fTrdVal);
Turn special MC Verbose on:
#define MC_DEV 0 //set to 1 to see more dev diags
Also from INI file (or fixed source):
m_WFOVerbose = GetIniLong("SYS","BTWFVerbose",0);
File: C:\Program Files\TS Support\MultiCharts64\MultiCharts64.ini
[SYS]
BTWFVerbose=0
iused in: if (m_WFOVerbose > 1)
Installs MC64.DLL to:
C:\Program Files\TS Support\MultiCharts64\PSS_BTMC64.DLL
Disable Autopilot BTWFMgr:
REGGetStr(WFO_REG_AUTOSTART,strVal,txtVal,WFO_TRACE,TRUE);
strVal = "0"; // disable autopiliot BTWFMgr
Start BTWF1:
if (pPerm->m_bFirstRun == TRUE)
  int retDef = pPerm->OpenDef(txtFnDef,txtErr);

using: CRamFile m_rfDef;
Free Ram using Close('R')