I just saw a study online that touts that the metric CAGR/Ave DD is a better metric than CAGR/MaxDD. Is there anyway to calculate this in Amibroker?
You may calculate it and output it via (high level) custom backrest interface.
Further examples on creating metrics
I don't know how to code this up however I do know from watching the same study that you must also measure equity at set time intervals to calculate the average.
I'll be interested to know what solution you find for this custom metric.
Also normalized profit factor would be interesting.
Thinking about it logicaaly, the common metric of CAGR/MaxDD makes little sense as a system metric.
"Better" is subjective. The reasoning behind MaxDD is that after all, you have to stomach the worst drawdown. Question of psychology and sticking to the system. Your own mind and ability to cope with unfortunate turn of events is often more problematic than purely theoretical considerations.
As to calculation of average drawdown you have to ask yourself (or the study you are referring to) if they want to average drawdown every bar or in some other way.
If you want everybar you could do that this way (but again, this is too optimistic figure):
SetCustomBacktestProc("");
/* Custom-backtest procedure follows */
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest(); // run default backtest procedure
eq = bo.EquityArray;
higheq = Highest( eq );
drawdown = 100 * ( higheq - eq)/ higheq;
avgdrawdown = LastValue( MA( drawdown, BarCount ) );
bo.AddCustomMetric("AvgDrawdown %", avgdrawdown );
}
The average drawdown needed is the average of peaks and troughs in the simulation run, not bar by bar.
I was hoping that since Amibroker has to go through the equity array and find all the drawdowns to determine the max that there would an array of drawdowns somewhere I could access to get the average.
Eq = bo.EquityArray;
maxEq = Highest(Eq);
DD = Eq - maxEq;
DDpcnt = DD/maxEq*100;
@Random_Entry I don't agree with your thought that the Maximum drawdown "makes little sense", but hey we all have our opinions.
@DanaF Two thoughts about what you are looking for, one is to consider the Ulcer Performance Index as it incorporates both the depth and duration of drawdowns into the metric.
Second idea is to perhaps average the worst drawdowns for your denominator. For example instead of the CAGR/AveDD, you look at CAGR/Ave of 5 worst DD. (you can modify this to 6 worst, 10 worst, etc)
Obtaining the 5 worst DD is on the forum,
And perhaps that can be modified to produce something like this,
Completely subjective:)
I found this series of videos an excellent watch and well worth watching the complete playlist.
Thanks I will look into that.
Yep, that is the series I watched. I have to wonder about the rankings of the metrics in the video. I am a rookie at this, so I don't understand how a correlation of 0.7457 is so much better than 0.7019. However, that is a really good series for new algo wannabes like me.
@DanaF
Did you have any luck adding this custom performance metric as a column in your back testing?
I haven't tried yet. I will let you know when I do.
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.