Lean  $LEAN_TAG$
QuantConnect.Report.DrawdownCollection Class Reference

Collection of drawdowns for the given period marked by start and end date More...

Public Member Functions

 DrawdownCollection (int periods)
 Creates an instance with a default collection (no items) and the top N worst drawdowns More...
 
 DrawdownCollection (Series< DateTime, double > strategySeries, int periods)
 Creates an instance from the given drawdowns and the top N worst drawdowns More...
 

Static Public Member Functions

static DrawdownCollection FromResult (BacktestResult backtestResult=null, LiveResult liveResult=null, int periods=5)
 Generate a new instance of DrawdownCollection from backtest and live Result derived instances More...
 
static Series< DateTime, double > NormalizeResults (BacktestResult backtestResult, LiveResult liveResult)
 Normalizes the Series used to calculate the drawdown plots and charts More...
 
static Series< DateTime, double > GetUnderwater (Series< DateTime, double > curve)
 Gets the underwater plot for the provided curve. Data is expected to be the concatenated output of ResultsUtil.EquityPoints. More...
 
static Frame< DateTime, string > GetUnderwaterFrame (Series< DateTime, double > curve)
 Gets all the data associated with the underwater plot and everything used to generate it. Note that you should instead use GetUnderwater(Series<DateTime, double>) if you want to just generate an underwater plot. This is internally used to get the top N worst drawdown periods. More...
 
static Frame< DateTime, string > GetTopWorstDrawdowns (Series< DateTime, double > curve, int periods)
 Gets the top N worst drawdowns and associated statistics. Returns a Frame with the following keys: "duration", "cumulativeMax", "drawdown" More...
 
static IEnumerable< DrawdownPeriodGetDrawdownPeriods (Series< DateTime, double > curve, int periods=5)
 Gets the given drawdown periods from the equity curve and the set periods More...
 

Properties

DateTime Start [get]
 Starting time of the drawdown collection More...
 
DateTime End [get]
 Ending time of the drawdown collection More...
 
int Periods [get]
 Number of periods to take into consideration for the top N drawdown periods. This will be the number of items contained in the Drawdowns collection. More...
 
List< DrawdownPeriodDrawdowns [get]
 Worst drawdowns encountered More...
 

Detailed Description

Collection of drawdowns for the given period marked by start and end date

Definition at line 27 of file DrawdownCollection.cs.

Constructor & Destructor Documentation

◆ DrawdownCollection() [1/2]

QuantConnect.Report.DrawdownCollection.DrawdownCollection ( int  periods)

Creates an instance with a default collection (no items) and the top N worst drawdowns

Parameters
periods

Definition at line 54 of file DrawdownCollection.cs.

Here is the caller graph for this function:

◆ DrawdownCollection() [2/2]

QuantConnect.Report.DrawdownCollection.DrawdownCollection ( Series< DateTime, double >  strategySeries,
int  periods 
)

Creates an instance from the given drawdowns and the top N worst drawdowns

Parameters
strategySeriesEquity curve with both live and backtesting merged
periodsPeriods this collection contains

Definition at line 65 of file DrawdownCollection.cs.

Here is the call graph for this function:

Member Function Documentation

◆ FromResult()

static DrawdownCollection QuantConnect.Report.DrawdownCollection.FromResult ( BacktestResult  backtestResult = null,
LiveResult  liveResult = null,
int  periods = 5 
)
static

Generate a new instance of DrawdownCollection from backtest and live Result derived instances

Parameters
backtestResultBacktest result packet
liveResultLive result packet
periodsTop N drawdown periods to get
Returns
DrawdownCollection instance

Definition at line 84 of file DrawdownCollection.cs.

Here is the call graph for this function:

◆ NormalizeResults()

static Series<DateTime, double> QuantConnect.Report.DrawdownCollection.NormalizeResults ( BacktestResult  backtestResult,
LiveResult  liveResult 
)
static

Normalizes the Series used to calculate the drawdown plots and charts

Parameters
backtestResultBacktest result packet
liveResultLive result packet
Returns

Definition at line 95 of file DrawdownCollection.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnderwater()

static Series<DateTime, double> QuantConnect.Report.DrawdownCollection.GetUnderwater ( Series< DateTime, double >  curve)
static

Gets the underwater plot for the provided curve. Data is expected to be the concatenated output of ResultsUtil.EquityPoints.

Parameters
curveEquity curve
Returns

Definition at line 148 of file DrawdownCollection.cs.

◆ GetUnderwaterFrame()

static Frame<DateTime, string> QuantConnect.Report.DrawdownCollection.GetUnderwaterFrame ( Series< DateTime, double >  curve)
static

Gets all the data associated with the underwater plot and everything used to generate it. Note that you should instead use GetUnderwater(Series<DateTime, double>) if you want to just generate an underwater plot. This is internally used to get the top N worst drawdown periods.

Parameters
curveEquity curve
Returns
Frame containing the following keys: "returns", "cumulativeMax", "drawdown"

Definition at line 168 of file DrawdownCollection.cs.

Here is the caller graph for this function:

◆ GetTopWorstDrawdowns()

static Frame<DateTime, string> QuantConnect.Report.DrawdownCollection.GetTopWorstDrawdowns ( Series< DateTime, double >  curve,
int  periods 
)
static

Gets the top N worst drawdowns and associated statistics. Returns a Frame with the following keys: "duration", "cumulativeMax", "drawdown"

Parameters
curveEquity curve
periodsTop N worst periods. If this is greater than the results, we retrieve all the items instead
Returns
Frame with the following keys: "duration", "cumulativeMax", "drawdown"

Definition at line 194 of file DrawdownCollection.cs.

Here is the caller graph for this function:

◆ GetDrawdownPeriods()

static IEnumerable<DrawdownPeriod> QuantConnect.Report.DrawdownCollection.GetDrawdownPeriods ( Series< DateTime, double >  curve,
int  periods = 5 
)
static

Gets the given drawdown periods from the equity curve and the set periods

Parameters
curveEquity curve
periodsTop N drawdown periods to get
Returns
Enumerable of DrawdownPeriod

Definition at line 253 of file DrawdownCollection.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

Property Documentation

◆ Start

DateTime QuantConnect.Report.DrawdownCollection.Start
get

Starting time of the drawdown collection

Definition at line 32 of file DrawdownCollection.cs.

◆ End

DateTime QuantConnect.Report.DrawdownCollection.End
get

Ending time of the drawdown collection

Definition at line 37 of file DrawdownCollection.cs.

◆ Periods

int QuantConnect.Report.DrawdownCollection.Periods
get

Number of periods to take into consideration for the top N drawdown periods. This will be the number of items contained in the Drawdowns collection.

Definition at line 43 of file DrawdownCollection.cs.

◆ Drawdowns

List<DrawdownPeriod> QuantConnect.Report.DrawdownCollection.Drawdowns
get

Worst drawdowns encountered

Definition at line 48 of file DrawdownCollection.cs.


The documentation for this class was generated from the following file: