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
* 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>
74 lines
2.8 KiB
C#
74 lines
2.8 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace QuantConnect.Algorithm.CSharp
|
|
{
|
|
/// <summary>
|
|
/// Regression for running an Index algorithm with Hourly data
|
|
/// </summary>
|
|
public class BasicTemplateIndexHourlyAlgorithm : BasicTemplateIndexDailyAlgorithm
|
|
{
|
|
protected override Resolution Resolution => Resolution.Hour;
|
|
protected override int ExpectedBarCount => base.ExpectedBarCount * 8;
|
|
|
|
/// <summary>
|
|
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
|
/// </summary>
|
|
public override bool CanRunLocally { get; } = true;
|
|
|
|
/// <summary>
|
|
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
|
/// </summary>
|
|
public override List<Language> Languages { get; } = new() { Language.CSharp };
|
|
|
|
/// <summary>
|
|
/// Data Points count of all timeslices of algorithm
|
|
/// </summary>
|
|
public override long DataPoints => 401;
|
|
|
|
/// <summary>
|
|
/// Data Points count of the algorithm history
|
|
/// </summary>
|
|
public override int AlgorithmHistoryDataPoints => 0;
|
|
|
|
/// <summary>
|
|
/// Final status of the algorithm
|
|
/// </summary>
|
|
public AlgorithmStatus AlgorithmStatus => AlgorithmStatus.Completed;
|
|
|
|
/// <summary>
|
|
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
|
/// </summary>
|
|
public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
|
{
|
|
{"Total Orders", "81"},
|
|
{"Average Win", "1.28%"},
|
|
{"Average Loss", "-0.06%"},
|
|
{"Compounding Annual Return", "-20.546%"},
|
|
{"Drawdown", "1.800%"},
|
|
{"Expectancy", "-0.402"},
|
|
{"Start Equity", "1000000"},
|
|
{"End Equity", "990775"},
|
|
{"Net Profit", "-0.922%"},
|
|
{"Sharpe Ratio", "-2.903"},
|
|
{"Sortino Ratio", "-6.081"},
|
|
{"Probabilistic Sharpe Ratio", "22.230%"},
|
|
{"Loss Rate", "97%"},
|
|
{"Win Rate", "3%"},
|
|
{"Profit-Loss Ratio", "19.95"},
|
|
{"Alpha", "-0.157"},
|
|
{"Beta", "0.025"},
|
|
{"Annual Standard Deviation", "0.053"},
|
|
{"Annual Variance", "0.003"},
|
|
{"Information Ratio", "-2.07"},
|
|
{"Tracking Error", "0.121"},
|
|
{"Treynor Ratio", "-6.189"},
|
|
{"Total Fees", "$0.00"},
|
|
{"Estimated Strategy Capacity", "$300000.00"},
|
|
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
|
|
{"Portfolio Turnover", "24.63%"},
|
|
{"Drawdown Recovery", "0"},
|
|
{"OrderListHash", "5595ab834c2584c1d124ad575e88cc1a"}
|
|
};
|
|
}
|
|
}
|