Lean  $LEAN_TAG$
QuantConnect.Statistics.PortfolioStatistics Class Reference

The PortfolioStatistics class represents a set of statistics calculated from equity and benchmark samples More...

Public Member Functions

 PortfolioStatistics (SortedDictionary< DateTime, decimal > profitLoss, SortedDictionary< DateTime, decimal > equity, SortedDictionary< DateTime, decimal > portfolioTurnover, List< double > listPerformance, List< double > listBenchmark, decimal startingCapital, IRiskFreeInterestRateModel riskFreeInterestRateModel, int tradingDaysPerYear, int? winCount=null, int? lossCount=null)
 Initializes a new instance of the PortfolioStatistics class More...
 
 PortfolioStatistics ()
 Initializes a new instance of the PortfolioStatistics class More...
 

Properties

decimal AverageWinRate [get, set]
 The average rate of return for winning trades More...
 
decimal AverageLossRate [get, set]
 The average rate of return for losing trades More...
 
decimal ProfitLossRatio [get, set]
 The ratio of the average win rate to the average loss rate More...
 
decimal WinRate [get, set]
 The ratio of the number of winning trades to the total number of trades More...
 
decimal LossRate [get, set]
 The ratio of the number of losing trades to the total number of trades More...
 
decimal Expectancy [get, set]
 The expected value of the rate of return More...
 
decimal StartEquity [get, set]
 Initial Equity Total Value More...
 
decimal EndEquity [get, set]
 Final Equity Total Value More...
 
decimal CompoundingAnnualReturn [get, set]
 Annual compounded returns statistic based on the final-starting capital and years. More...
 
decimal Drawdown [get, set]
 Drawdown maximum percentage. More...
 
decimal TotalNetProfit [get, set]
 The total net profit percentage. More...
 
decimal SharpeRatio [get, set]
 Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk. More...
 
decimal ProbabilisticSharpeRatio [get, set]
 Probabilistic Sharpe Ratio is a probability measure associated with the Sharpe ratio. It informs us of the probability that the estimated Sharpe ratio is greater than a chosen benchmark More...
 
decimal SortinoRatio [get, set]
 Sortino ratio with respect to risk free rate: measures excess of return per unit of downside risk. More...
 
decimal Alpha [get, set]
 Algorithm "Alpha" statistic - abnormal returns over the risk free rate and the relationshio (beta) with the benchmark returns. More...
 
decimal Beta [get, set]
 Algorithm "beta" statistic - the covariance between the algorithm and benchmark performance, divided by benchmark's variance More...
 
decimal AnnualStandardDeviation [get, set]
 Annualized standard deviation More...
 
decimal AnnualVariance [get, set]
 Annualized variance statistic calculation using the daily performance variance and trading days per year. More...
 
decimal InformationRatio [get, set]
 Information ratio - risk adjusted return More...
 
decimal TrackingError [get, set]
 Tracking error volatility (TEV) statistic - a measure of how closely a portfolio follows the index to which it is benchmarked More...
 
decimal TreynorRatio [get, set]
 Treynor ratio statistic is a measurement of the returns earned in excess of that which could have been earned on an investment that has no diversifiable risk More...
 
decimal PortfolioTurnover [get, set]
 The average Portfolio Turnover More...
 
decimal ValueAtRisk99 [get, set]
 The 1-day VaR for the portfolio, using the Variance-covariance approach. Assumes a 99% confidence level, 1 year lookback period, and that the returns are normally distributed. More...
 
decimal ValueAtRisk95 [get, set]
 The 1-day VaR for the portfolio, using the Variance-covariance approach. Assumes a 95% confidence level, 1 year lookback period, and that the returns are normally distributed. More...
 

Detailed Description

The PortfolioStatistics class represents a set of statistics calculated from equity and benchmark samples

Definition at line 30 of file PortfolioStatistics.cs.

Constructor & Destructor Documentation

◆ PortfolioStatistics() [1/2]

QuantConnect.Statistics.PortfolioStatistics.PortfolioStatistics ( SortedDictionary< DateTime, decimal >  profitLoss,
SortedDictionary< DateTime, decimal >  equity,
SortedDictionary< DateTime, decimal >  portfolioTurnover,
List< double >  listPerformance,
List< double >  listBenchmark,
decimal  startingCapital,
IRiskFreeInterestRateModel  riskFreeInterestRateModel,
int  tradingDaysPerYear,
int?  winCount = null,
int?  lossCount = null 
)

Initializes a new instance of the PortfolioStatistics class

Parameters
profitLossTrade record of profits and losses
equityThe list of daily equity values
portfolioTurnoverThe algorithm portfolio turnover
listPerformanceThe list of algorithm performance values
listBenchmarkThe list of benchmark values
startingCapitalThe algorithm starting capital
riskFreeInterestRateModelThe risk free interest rate model to use
tradingDaysPerYearThe number of trading days per year
winCountThe number of wins, including ITM options with profitLoss less than 0. If this and lossCount are null, they will be calculated from profitLoss
lossCountThe number of losses

Definition at line 204 of file PortfolioStatistics.cs.

Here is the call graph for this function:

◆ PortfolioStatistics() [2/2]

QuantConnect.Statistics.PortfolioStatistics.PortfolioStatistics ( )

Initializes a new instance of the PortfolioStatistics class

Definition at line 316 of file PortfolioStatistics.cs.

Property Documentation

◆ AverageWinRate

decimal QuantConnect.Statistics.PortfolioStatistics.AverageWinRate
getset

The average rate of return for winning trades

Definition at line 36 of file PortfolioStatistics.cs.

◆ AverageLossRate

decimal QuantConnect.Statistics.PortfolioStatistics.AverageLossRate
getset

The average rate of return for losing trades

Definition at line 42 of file PortfolioStatistics.cs.

◆ ProfitLossRatio

decimal QuantConnect.Statistics.PortfolioStatistics.ProfitLossRatio
getset

The ratio of the average win rate to the average loss rate

If the average loss rate is zero, ProfitLossRatio is set to 0

Definition at line 49 of file PortfolioStatistics.cs.

◆ WinRate

decimal QuantConnect.Statistics.PortfolioStatistics.WinRate
getset

The ratio of the number of winning trades to the total number of trades

If the total number of trades is zero, WinRate is set to zero

Definition at line 56 of file PortfolioStatistics.cs.

◆ LossRate

decimal QuantConnect.Statistics.PortfolioStatistics.LossRate
getset

The ratio of the number of losing trades to the total number of trades

If the total number of trades is zero, LossRate is set to zero

Definition at line 63 of file PortfolioStatistics.cs.

◆ Expectancy

decimal QuantConnect.Statistics.PortfolioStatistics.Expectancy
getset

The expected value of the rate of return

Definition at line 69 of file PortfolioStatistics.cs.

◆ StartEquity

decimal QuantConnect.Statistics.PortfolioStatistics.StartEquity
getset

Initial Equity Total Value

Definition at line 75 of file PortfolioStatistics.cs.

◆ EndEquity

decimal QuantConnect.Statistics.PortfolioStatistics.EndEquity
getset

Final Equity Total Value

Definition at line 81 of file PortfolioStatistics.cs.

◆ CompoundingAnnualReturn

decimal QuantConnect.Statistics.PortfolioStatistics.CompoundingAnnualReturn
getset

Annual compounded returns statistic based on the final-starting capital and years.

Also known as Compound Annual Growth Rate (CAGR)

Definition at line 88 of file PortfolioStatistics.cs.

◆ Drawdown

decimal QuantConnect.Statistics.PortfolioStatistics.Drawdown
getset

Drawdown maximum percentage.

Definition at line 94 of file PortfolioStatistics.cs.

◆ TotalNetProfit

decimal QuantConnect.Statistics.PortfolioStatistics.TotalNetProfit
getset

The total net profit percentage.

Definition at line 100 of file PortfolioStatistics.cs.

◆ SharpeRatio

decimal QuantConnect.Statistics.PortfolioStatistics.SharpeRatio
getset

Sharpe ratio with respect to risk free rate: measures excess of return per unit of risk.

With risk defined as the algorithm's volatility

Definition at line 107 of file PortfolioStatistics.cs.

◆ ProbabilisticSharpeRatio

decimal QuantConnect.Statistics.PortfolioStatistics.ProbabilisticSharpeRatio
getset

Probabilistic Sharpe Ratio is a probability measure associated with the Sharpe ratio. It informs us of the probability that the estimated Sharpe ratio is greater than a chosen benchmark

See https://www.quantconnect.com/forum/discussion/6483/probabilistic-sharpe-ratio/p1

Definition at line 115 of file PortfolioStatistics.cs.

◆ SortinoRatio

decimal QuantConnect.Statistics.PortfolioStatistics.SortinoRatio
getset

Sortino ratio with respect to risk free rate: measures excess of return per unit of downside risk.

With risk defined as the algorithm's volatility

Definition at line 122 of file PortfolioStatistics.cs.

◆ Alpha

decimal QuantConnect.Statistics.PortfolioStatistics.Alpha
getset

Algorithm "Alpha" statistic - abnormal returns over the risk free rate and the relationshio (beta) with the benchmark returns.

Definition at line 128 of file PortfolioStatistics.cs.

◆ Beta

decimal QuantConnect.Statistics.PortfolioStatistics.Beta
getset

Algorithm "beta" statistic - the covariance between the algorithm and benchmark performance, divided by benchmark's variance

Definition at line 134 of file PortfolioStatistics.cs.

◆ AnnualStandardDeviation

decimal QuantConnect.Statistics.PortfolioStatistics.AnnualStandardDeviation
getset

Annualized standard deviation

Definition at line 140 of file PortfolioStatistics.cs.

◆ AnnualVariance

decimal QuantConnect.Statistics.PortfolioStatistics.AnnualVariance
getset

Annualized variance statistic calculation using the daily performance variance and trading days per year.

Definition at line 146 of file PortfolioStatistics.cs.

◆ InformationRatio

decimal QuantConnect.Statistics.PortfolioStatistics.InformationRatio
getset

Information ratio - risk adjusted return

(risk = tracking error volatility, a volatility measures that considers the volatility of both algo and benchmark)

Definition at line 153 of file PortfolioStatistics.cs.

◆ TrackingError

decimal QuantConnect.Statistics.PortfolioStatistics.TrackingError
getset

Tracking error volatility (TEV) statistic - a measure of how closely a portfolio follows the index to which it is benchmarked

If algo = benchmark, TEV = 0

Definition at line 160 of file PortfolioStatistics.cs.

◆ TreynorRatio

decimal QuantConnect.Statistics.PortfolioStatistics.TreynorRatio
getset

Treynor ratio statistic is a measurement of the returns earned in excess of that which could have been earned on an investment that has no diversifiable risk

Definition at line 166 of file PortfolioStatistics.cs.

◆ PortfolioTurnover

decimal QuantConnect.Statistics.PortfolioStatistics.PortfolioTurnover
getset

The average Portfolio Turnover

Definition at line 172 of file PortfolioStatistics.cs.

◆ ValueAtRisk99

decimal QuantConnect.Statistics.PortfolioStatistics.ValueAtRisk99
getset

The 1-day VaR for the portfolio, using the Variance-covariance approach. Assumes a 99% confidence level, 1 year lookback period, and that the returns are normally distributed.

Definition at line 179 of file PortfolioStatistics.cs.

◆ ValueAtRisk95

decimal QuantConnect.Statistics.PortfolioStatistics.ValueAtRisk95
getset

The 1-day VaR for the portfolio, using the Variance-covariance approach. Assumes a 95% confidence level, 1 year lookback period, and that the returns are normally distributed.

Definition at line 186 of file PortfolioStatistics.cs.


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