Statistics
Algorithm Statistics
Get Values
To get the StatisticsResults
, use the Statistics
member of the algorithm class.
var sharpe = Statistics.TotalPerformance.PortfolioStatistics.SharpeRatio;
sharpe = self.Statistics.TotalPerformance.PortfolioStatistics.SharpeRatio
To get the value of a custom statistic while your algorithm runs, index the Summary
member with the statistic name. The values in the Summary
dictionary are strings, so you may need to cast the value that returns to a different data type.
var value = Statistics.Summary["name"];
value = self.Statistics.Summary["name"]
The following table describe other ways to get the statistics after your backtest completes:
Deployment Target | Access Tools |
---|---|
QuantConnect Cloud |
|
Local |
|