Files
JosueNina 7008d17714
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Add MaxDrawdownRecovery metric (#8865)
* Implement  a prototype of the maximum recovery time function.

* Add unit test skeletons.

* Add failing test

* Issue #4581: Implement MaxDrawdownRecoveryTime.

* Issue 4581: Add DTO for Drawdown Percentage, Drawdown Enddate, and High Value

* Issue 4581: Fix bgu for when lDrawdowns list is empty.

* Issue 4581: Change names of tests. Change name of file.

* Issue 4581: Make adjustements to flow of adding drawdowns to lDrawdowns.

* Issue 4581: Add multiple unit tests.

* Issue #4581: Change name of unit test

* Issue #4581: Add to PerformanceMetrics

* Issue #4581: Add Maximum Drawdown Recovery to PortolioStatistics class.

* Issue #4581: Add to portolfio statistics class.

* Issue #4581: Add to statistics builder.

* Issue #4581: Add report key.

* Case #4581: Convert to decimal.

* Issue #4581: Correct comment.

* Issue #4581: Correct performance metrics view model string.

* Case #4581: Correct statistics builder view model string..again.

* Issue #4581: Placed DradownDradownDateHighValueDTO at the end of the file for simpler diff.

* Issue #4581: Add 2 new tests.

* Issue #4581: Change algorithm so that when multiple maximum drawdowns occur, the longest of all recoveries is reported.

* Issue #4581: Add unit test.

* Issue #4581: Remove reportkey. Change dto name.

* Issue #4581: Change summary.

* Issue #4581: Change comment.

* Add max drawdown recovery calculation with unit tests

* Update regression algorithms with the new metric

* Solve review comments

* Update regression algorithms

* Add TryGet to safely get the key: MaximumDrawdownRecovery

* Ignore MaximumDrawdownRecovery metric in OptimizationBacktest Json

* Revert changes in Messaging

* Update regression algorithms

* Add test case: TakesLongestRecoveryAmongMultipleDrawdowns

* Use integer days for MaximumDrawdownRecovery

* Add MaximumDrawdownRecoveryReportElement

* Use more explicit names

* Rename files and variables for consistency

* Update regression algorithms

---------

Co-authored-by: Alain Schaerer <aschaerer@pcatg.com>
2025-07-17 16:32:23 -03:00

359 lines
17 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta property="og:title" content="QuantConnect Backtest Report: "/>
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="QuantConnect.com"/>
<meta property="og:description" content=""/>
<meta property="og:url" content="https://www.quantconnect.com/terminal/reports/"/>
<meta property="og:image" content="{{$PLOT-CUMULATIVE-RETURNS}}"/>
<meta property="og:image" content="{{$PLOT-ANNUAL-RETURNS}}"/>
<meta property="og:image" content="{{$PNG-AUTHOR-PHOTO}}"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css2?family=Inter&family=Roboto&display=swap" rel="stylesheet">
<style>
{{$REPORT-STYLESHEET}}
</style>
</head>
<body>
<div class="page">
<div class="header">
<div class="header-left">
<img src="https://cdn.quantconnect.com/web/i/logo.png">
</div>
<div class="header-right">Strategy Report: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>
</div>
<div class="content">
<div class="container-row">
<div class="col-xs-12">
<table id="description-box" class="table compact no-margin align-top">
<thead>
<tr>
<th>
<p>
<span>|</span> Strategy Description
</p>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p id="strategy-description" class="text-justify">
{{$TEXT-STRATEGY-DESCRIPTION}}
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row first-row">
<div class="col-xs-8">
<table id="key-characteristics" class="table compact">
<thead>
<tr>
<th class="title">Key Statistics</th><th class="kpi-live">Backtest</th><th class="kpi-live">Live</th><th class="title"></th><th class="kpi-live">Backtest</th><th class="kpi-live">Live</th>
</tr>
</thead>
<tbody>
<tr>
<td class="title">Runtime Days</td><td>{{$KPI-BACKTEST-DAYS}}</td><td class="kpi-live">{{$KPI-DAYS-LIVE}}</td>
<td class="title">Drawdown</td><td>{{$KPI-DRAWDOWN}}</td><td class="kpi-live">{{$KPI-LIVE-DRAWDOWN}}</td>
</tr>
<tr>
<td class="title">Turnover</td><td>{{$KPI-TURNOVER}}</td><td class="kpi-live">{{$KPI-LIVE-TURNOVER}}</td>
<td class="title">Probabilistic SR</td><td>{{$KPI-PSR}}</td><td class="kpi-live">{{$KPI-LIVE-PSR}}</td>
</tr>
<tr>
<td class="title">CAGR</td><td>{{$KPI-CAGR}}</td><td class="kpi-live">{{$KPI-LIVE-CAGR}}</td>
<td class="title">{{$LIVE-MARKER}}Sharpe Ratio</td><td>{{$KPI-SHARPE}}</td><td class="kpi-live">{{$KPI-LIVE-SHARPE}}</td>
</tr>
<tr>
<td class="title">Capacity (USD)</td><td>{{$KPI-STRATEGY-CAPACITY}}</td>
<td class="title">Sortino Ratio</td><td>{{$KPI-SORTINO}}</td><td class="kpi-live">{{$KPI-LIVE-SORTINO}}</td>
</tr>
<tr>
<td class="title">Trades per Day</td><td>{{$KPI-TRADES-PER-DAY}}</td><td class="kpi-live">{{$KPI-LIVE-TRADES-PER-DAY}}</td>
<td class="title">Information Ratio</td><td>{{$KPI-INFORMATION-RATIO}}</td><td class="kpi-live">{{$KPI-LIVE-INFORMATION-RATIO}}</td>
</tr>
<tr>
<td class="title">Drawdown Recovery</td><td>{{$KPI-DRAWDOWN-RECOVERY}}</td><td class="kpi-live">{{$KPI-LIVE-DRAWDOWN-RECOVERY}}</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-4">
<table class="table compact">
<thead>
<tr>
<th>Monthly Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img id="monthly-returns-plot" src="{{$PLOT-MONTHLY-RETURNS}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row">
<div class="col-xs-12">
<table class="table compact">
<thead>
<tr>
<th>Cumulative Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img src="{{$PLOT-CUMULATIVE-RETURNS}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row">
<div class="col-xs-4">
<table class="table compact">
<thead>
<tr>
<th>Annual Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:0;">
<img src="{{$PLOT-ANNUAL-RETURNS}}">
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-4">
<table class="table compact">
<thead>
<tr>
<th>Returns Per Trade</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:0;">
<img src="{{$PLOT-RETURNS-PER-TRADE}}">
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-4">
<table class="table compact">
<thead>
<tr>
<th>Asset Allocation</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:0;">
<img src="{{$PLOT-ASSET-ALLOCATION}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row">
<div class="col-xs-12">
<table class="table compact">
<thead>
<tr>
<th>Drawdown</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img src="{{$PLOT-DRAWDOWN}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="page">
<div class="header">
<div class="header-left">
<img src="https://cdn.quantconnect.com/web/i/logo.png">
</div>
<div class="header-right">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>
</div>
<div class="content">
<div class="container-row">
<div class="col-xs-12">
<table class="table compact">
<thead>
<tr>
<th>Daily Returns</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img src="{{$PLOT-DAILY-RETURNS}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row">
<div class="col-xs-12">
<table class="table compact">
<thead>
<tr>
<th>Rolling Portfolio Beta</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img src="{{$PLOT-BETA}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row">
<div class="col-xs-12">
<table class="table compact">
<thead>
<tr>
<th>Rolling Sharpe Ratio</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img src="{{$PLOT-SHARPE}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row">
<div class="col-xs-12">
<table class="table compact">
<thead>
<tr>
<th>Leverage</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img src="{{$PLOT-LEVERAGE}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container-row">
<div class="col-xs-12">
<table class="table compact">
<thead>
<tr>
<th>Long-Short Exposure</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 0;">
<img src="{{$PLOT-EXPOSURE}}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="page" style="{{$CSS-CRISIS-PAGE-STYLE}}">
<div class="header">
<div class="header-left">
<img src="https://cdn.quantconnect.com/web/i/logo.png">
</div>
<div class="header-right">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>
</div>
<div class="content">
<div class="container-row">
{{$HTML-CRISIS-PLOTS}}
</div>
</div>
</div>
<div class="page" id="parameters" style="{{$CSS-PARAMETERS-PAGE-STYLE}}">
<div class="header">
<div class="header-left">
<img src="https://cdn.quantconnect.com/web/i/logo.png">
</div>
<div class="header-right">Strategy Report Summary: {{$TEXT-STRATEGY-NAME}} {{$TEXT-STRATEGY-VERSION}}</div>
</div>
<div class="content">
<div class="container-row">
<div class="col-xs-12">
<table id="key-characteristics" class="table compact">
<thead>
<tr>
<th class="title">Parameters</th>
</tr>
</thead>
<tbody>
{{$PARAMETERS}}
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
<!--crisis
<div class="col-xs-4">
<table class="crisis-chart table compact">
<thead>
<tr>
<th style="display: block; height: 75px;">{{$TEXT-CRISIS-TITLE}}</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:0;">
<img src="{{$PLOT-CRISIS-CONTENT}}">
</td>
</tr>
</tbody>
</table>
</div>
crisis-->
<!--parameters
<tr>
<td class = "title"> {{$KEY0}} </td><td> {{$VALUE0}} </td>
<td class = "title"> {{$KEY1}} </td><td> {{$VALUE1}} </td>
</tr>
parameters-->