Combining Equity Curves in Amibroker

Hi All,
This is just one of many ways you may use or not , to produce an equity curve

  1. // YOUR TRADING SYSTEM HERE
  2. // ….
  3. SetCustomBacktestProc(“”);
  4. if( Status(“action”) == actionPortfolio )
  5. {
  6. bo = GetBacktesterObject();
  7. bo.Backtest();
  8. AddToComposite( bo.EquityArray,”~~~MY_EQUITY_COPY”,
  9. “X”,atcFlagDeleteValues | atcFlagEnableInPortfolio );
  10. }

And so combing them together may be this

/ Create an array of the individual equity curves
equityCurves = {Equity1, Equity2, Equity3, Equity4};
// Use the PortfolioBacktest() function to combine the equity curves into a single portfolio equity curve
portfolioEquityCurve = PortfolioBacktest(equityCurves, 1, 1);
// Plot the portfolio equity curve
Plot(portfolioEquityCurve, “Portfolio Equity”, colorBlue);

PortfolioBacktest function will assume equal weighting for all equity curves. If you want to assign different weight to each strategy you can use the PortfolioBacktestW() function.

How do we use the PortfolioBacktestW() , to weigh all the individual equity curves ?

Example , (A) has 500 trades with 18% drawdown
(B) has 200 trades with 8% drawdown
if those are the two criteria that you may use out of the gzillions of criteria available with a equity curve

would anyone be able to suggest a ” weighing ” a codable formula to be able to use the PortfolioBacktestW() function .

Any thougrghts , comments opinions all welcomed

cheers

michael b

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*