Lean  $LEAN_TAG$
QuantConnect.Statistics.StatisticsBuilder Class Reference

The StatisticsBuilder class creates summary and rolling statistics from trades, equity and benchmark points More...

Static Public Member Functions

static StatisticsResults Generate (List< Trade > trades, SortedDictionary< DateTime, decimal > profitLoss, List< ISeriesPoint > pointsEquity, List< ISeriesPoint > pointsPerformance, List< ISeriesPoint > pointsBenchmark, List< ISeriesPoint > pointsPortfolioTurnover, decimal startingCapital, decimal totalFees, int totalOrders, CapacityEstimate estimatedStrategyCapacity, string accountCurrencySymbol, SecurityTransactionManager transactions, IRiskFreeInterestRateModel riskFreeInterestRateModel, int tradingDaysPerYear)
 Generates the statistics and returns the results More...
 
static IEnumerable< KeyValuePair< DateTime, double > > CreateBenchmarkDifferences (IEnumerable< KeyValuePair< DateTime, decimal >> points, DateTime fromDate, DateTime toDate)
 Yields pairs of date and percentage change for the period More...
 
static IEnumerable< KeyValuePair< DateTime, double > > PreprocessPerformanceValues (IEnumerable< KeyValuePair< DateTime, decimal >> points)
 Skips the first two entries from the given points and divides each entry by 100 More...
 

Detailed Description

The StatisticsBuilder class creates summary and rolling statistics from trades, equity and benchmark points

Definition at line 29 of file StatisticsBuilder.cs.

Member Function Documentation

◆ Generate()

static StatisticsResults QuantConnect.Statistics.StatisticsBuilder.Generate ( List< Trade trades,
SortedDictionary< DateTime, decimal >  profitLoss,
List< ISeriesPoint pointsEquity,
List< ISeriesPoint pointsPerformance,
List< ISeriesPoint pointsBenchmark,
List< ISeriesPoint pointsPortfolioTurnover,
decimal  startingCapital,
decimal  totalFees,
int  totalOrders,
CapacityEstimate  estimatedStrategyCapacity,
string  accountCurrencySymbol,
SecurityTransactionManager  transactions,
IRiskFreeInterestRateModel  riskFreeInterestRateModel,
int  tradingDaysPerYear 
)
static

Generates the statistics and returns the results

Parameters
tradesThe list of closed trades
profitLossTrade record of profits and losses
pointsEquityThe list of daily equity values
pointsPerformanceThe list of algorithm performance values
pointsBenchmarkThe list of benchmark values
pointsPortfolioTurnoverThe list of portfolio turnover daily samples
startingCapitalThe algorithm starting capital
totalFeesThe total fees
totalOrdersThe total number of transactions
estimatedStrategyCapacityThe estimated capacity of this strategy
accountCurrencySymbolThe account currency symbol
transactionsThe transaction manager to get number of winning and losing transactions
riskFreeInterestRateModelThe risk free interest rate model to use
tradingDaysPerYearThe number of trading days per year


Returns
Returns a StatisticsResults object

Definition at line 51 of file StatisticsBuilder.cs.

Here is the caller graph for this function:

◆ CreateBenchmarkDifferences()

static IEnumerable<KeyValuePair<DateTime, double> > QuantConnect.Statistics.StatisticsBuilder.CreateBenchmarkDifferences ( IEnumerable< KeyValuePair< DateTime, decimal >>  points,
DateTime  fromDate,
DateTime  toDate 
)
static

Yields pairs of date and percentage change for the period

Parameters
pointsThe values to calculate percentage change for
fromDateStarting date (inclusive)
toDateEnding date (inclusive)
Returns
Pairs of date and percentage change

Definition at line 336 of file StatisticsBuilder.cs.

Here is the caller graph for this function:

◆ PreprocessPerformanceValues()

static IEnumerable<KeyValuePair<DateTime, double> > QuantConnect.Statistics.StatisticsBuilder.PreprocessPerformanceValues ( IEnumerable< KeyValuePair< DateTime, decimal >>  points)
static

Skips the first two entries from the given points and divides each entry by 100

Parameters
pointsThe values to divide by 100
Returns
Pairs of date and performance value divided by 100

Definition at line 379 of file StatisticsBuilder.cs.

Here is the caller graph for this function:

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