I wanted to see how my systems would perform if I were to run them at the same time and see if I would be better off to do so. And I thought I would share this with others as well.
First: there is a tutorial here, https://decodingmarkets.com/combine-equity-curves-in-amibroker/ . Please note that the majority of what I am showing came from that tutorial but I am showing you what I had to do differently.
Hope that helps some people who are contemplating running multiple systems.
First: there is a tutorial here, https://decodingmarkets.com/combine-equity-curves-in-amibroker/ . Please note that the majority of what I am showing came from that tutorial but I am showing you what I had to do differently.
- Open up Formula Editor for one of the systems you would like to compare. In there add the following CBT (custom backtest)
Code:
// The code for AmiBroker 5.50 and above
// YOUR TRADING SYSTEM HERE
// ....
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest();
AddToComposite( bo.EquityArray, "~~~SYSTEM_NAME", "X", atcFlagDeleteValues | atcFlagEnableInPortfolio ;
}
- Do the above step for all the systems you would like to compare
- The equity for your system will now be saved as "~~~SYSTEM_NAME" and can be seen in the ticker symbol area.
- Create a new formula in Formula Editor with the following (this is to give us the data to copy into an excel sheet or export as a CSV):
Code:
Filter=1;
AddColumn(O,"Open");
AddColumn(H,"High");
AddColumn(L,"Low");
AddColumn(C,"Close");
AddColumn(V,"Volume",1.0);
AddColumn(OI,"Open Interest",1.0);
- Go to a new analysis window, run the code above on your systems ticker.
- You can see that my ticker ~~~MAP_1_6 is selected, which is for my MAP system, v1.6. I also have selected in the settings Weekly. This will give you the weekly values for the system.
- From here you can either CTL + A, and paste into excel, or you can "Export as HTML/CSV".
- Repeat the above for all of the systems you want to compare. I just did 2, but you can do more.
- I kept all my systems with the same amount of starting equity. Now that you have the data in excel you can run your metrics: individual gains, combined gains, maxDD for the same, and then you can put these into charts.
Hope that helps some people who are contemplating running multiple systems.