Open AlexCatarino opened 4 years ago
@jaredbroad
I took a quick look at the codebase. Would this be implemented in Common\Statistics\Statistics.cs
and then added to the StatisticsBuilder
?
I think I would also have to add a ReportElement
and feed the statistic with data in Report.cs
(backtestresult and/or liveresult), correct?
Yes perfect @swisstackle, to make it show in the footer of the backtest view it would need to end up in the Dictionary here.
@jaredbroad Do you have a formal definition of maximum recovery time?
With daily prices {100, 98,99,98,99}, is the maximum recovery time non-existent or 1 day?
I'm asking because if it's 1 day, the statistic seems useless in scenarios like {100,98, 99,98,99,50,0}, where the strategy never truly recovers, yet the maximum recovery time would still be 1 making it look good.
@swisstackle We think the right answer is for it to return null/inf in your example above; the view might need to be adjusted to handle the inf/null values but if you make the PR return the correct value we'll handle the rest.
@jaredbroad Ok, when I get time to work on this, I will go for the "recovery time of the maximum drawdown" which fits your description and then we can make adjustments later.
Expected Behavior
Funds understand that all algorithms experience drawdowns, and the smaller, the better, but the recovery time is especially important. An algorithm that is in a sustained drawdown for more than 6-months most likely won't be traded by a fund and would likely be dropped if this occurs in live trading. (source)
Actual Behavior
No statistics on the maximum recovery time.
Potential Solution
Implement such measurement.
Checklist
master
branch