Lean
$LEAN_TAG$
|
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... | |
The PortfolioStatistics class represents a set of statistics calculated from equity and benchmark samples
Definition at line 30 of file PortfolioStatistics.cs.
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
profitLoss | Trade record of profits and losses |
equity | The list of daily equity values |
portfolioTurnover | The algorithm portfolio turnover |
listPerformance | The list of algorithm performance values |
listBenchmark | The list of benchmark values |
startingCapital | The algorithm starting capital |
riskFreeInterestRateModel | The risk free interest rate model to use |
tradingDaysPerYear | The number of trading days per year |
winCount | The number of wins, including ITM options with profitLoss less than 0. If this and lossCount are null, they will be calculated from profitLoss |
lossCount | The number of losses |
Definition at line 204 of file PortfolioStatistics.cs.
QuantConnect.Statistics.PortfolioStatistics.PortfolioStatistics | ( | ) |
Initializes a new instance of the PortfolioStatistics class
Definition at line 316 of file PortfolioStatistics.cs.
|
getset |
The average rate of return for winning trades
Definition at line 36 of file PortfolioStatistics.cs.
|
getset |
The average rate of return for losing trades
Definition at line 42 of file PortfolioStatistics.cs.
|
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.
|
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.
|
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.
|
getset |
The expected value of the rate of return
Definition at line 69 of file PortfolioStatistics.cs.
|
getset |
Initial Equity Total Value
Definition at line 75 of file PortfolioStatistics.cs.
|
getset |
Final Equity Total Value
Definition at line 81 of file PortfolioStatistics.cs.
|
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.
|
getset |
Drawdown maximum percentage.
Definition at line 94 of file PortfolioStatistics.cs.
|
getset |
The total net profit percentage.
Definition at line 100 of file PortfolioStatistics.cs.
|
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.
|
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.
|
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.
|
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.
|
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.
|
getset |
Annualized standard deviation
Definition at line 140 of file PortfolioStatistics.cs.
|
getset |
Annualized variance statistic calculation using the daily performance variance and trading days per year.
Definition at line 146 of file PortfolioStatistics.cs.
|
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.
|
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.
|
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.
|
getset |
The average Portfolio Turnover
Definition at line 172 of file PortfolioStatistics.cs.
|
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.
|
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.