|
Lean
$LEAN_TAG$
|
Calculation of the Sharpe Ratio (SR) developed by William F. Sharpe. More...
Public Member Functions | |
| SharpeRatio (string name, int period, IRiskFreeInterestRateModel riskFreeRateModel) | |
| Creates a new Sharpe Ratio indicator using the specified periods More... | |
| SharpeRatio (int period, IRiskFreeInterestRateModel riskFreeRateModel) | |
| Creates a new Sharpe Ratio indicator using the specified periods More... | |
| SharpeRatio (string name, int period, PyObject riskFreeRateModel) | |
| Creates a new Sharpe Ratio indicator using the specified period using a Python risk free rate model More... | |
| SharpeRatio (int period, PyObject riskFreeRateModel) | |
| Creates a new Sharpe Ratio indicator using the specified period using a Python risk free rate model More... | |
| SharpeRatio (string name, int period, decimal riskFreeRate=0.0m) | |
| Creates a new Sharpe Ratio indicator using the specified periods More... | |
| SharpeRatio (int period, decimal riskFreeRate=0.0m) | |
| Creates a new SharpeRatio indicator using the specified periods More... | |
| override void | Reset () |
| Resets this indicator to its initial state More... | |
Public Attributes | |
| override bool | IsReady => Ratio.Samples > _period |
| Returns whether the indicator is properly initialized with data More... | |
Protected Member Functions | |
| override decimal | ComputeNextValue (IndicatorDataPoint input) |
| Computes the next value for this indicator from the given state. More... | |
Properties | |
| RateOfChange | RateOfChange [get] |
| RateOfChange indicator for calculating the sharpe ratio More... | |
| Identity | RiskFreeRate [get] |
| RiskFreeRate indicator for calculating the sharpe ratio More... | |
| IndicatorBase | Ratio [get, set] |
| Indicator to store the calculation of the sharpe ratio More... | |
| IndicatorBase | Numerator [get] |
| Indicator to store the numerator of the Sharpe ratio calculation More... | |
| int | WarmUpPeriod [get] |
| Required period, in data points, for the indicator to be ready and fully initialized. More... | |
Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider | |
| int | WarmUpPeriod [get] |
| Required period, in data points, for the indicator to be ready and fully initialized. More... | |
Calculation of the Sharpe Ratio (SR) developed by William F. Sharpe.
Reference: https://www.investopedia.com/articles/07/sharpe_ratio.asp Formula: S(x) = (Rx - Rf) / stdDev(Rx) Where: S(x) - sharpe ratio of x Rx - average rate of return for x Rf - risk-free rate
Definition at line 32 of file SharpeRatio.cs.
| QuantConnect.Indicators.SharpeRatio.SharpeRatio | ( | string | name, |
| int | period, | ||
| IRiskFreeInterestRateModel | riskFreeRateModel | ||
| ) |
Creates a new Sharpe Ratio indicator using the specified periods
| name | The name of this indicator |
| period | Period of historical observation for sharpe ratio calculation |
| riskFreeRateModel | Risk-free rate model |
Definition at line 80 of file SharpeRatio.cs.
| QuantConnect.Indicators.SharpeRatio.SharpeRatio | ( | int | period, |
| IRiskFreeInterestRateModel | riskFreeRateModel | ||
| ) |
Creates a new Sharpe Ratio indicator using the specified periods
| period | Period of historical observation for sharpe ratio calculation |
| riskFreeRateModel | Risk-free rate model |
Definition at line 103 of file SharpeRatio.cs.
| QuantConnect.Indicators.SharpeRatio.SharpeRatio | ( | string | name, |
| int | period, | ||
| PyObject | riskFreeRateModel | ||
| ) |
Creates a new Sharpe Ratio indicator using the specified period using a Python risk free rate model
| period | Period of historical observation for sharpe ratio calculation |
| riskFreeRateModel | Risk-free rate model |
Definition at line 113 of file SharpeRatio.cs.
| QuantConnect.Indicators.SharpeRatio.SharpeRatio | ( | int | period, |
| PyObject | riskFreeRateModel | ||
| ) |
Creates a new Sharpe Ratio indicator using the specified period using a Python risk free rate model
| period | Period of historical observation for sharpe ratio calculation |
| riskFreeRateModel | Risk-free rate model |
Definition at line 123 of file SharpeRatio.cs.
| QuantConnect.Indicators.SharpeRatio.SharpeRatio | ( | string | name, |
| int | period, | ||
| decimal | riskFreeRate = 0.0m |
||
| ) |
Creates a new Sharpe Ratio indicator using the specified periods
| name | The name of this indicator |
| period | Period of historical observation for sharpe ratio calculation |
| riskFreeRate | Risk-free rate for sharpe ratio calculation |
Definition at line 134 of file SharpeRatio.cs.
| QuantConnect.Indicators.SharpeRatio.SharpeRatio | ( | int | period, |
| decimal | riskFreeRate = 0.0m |
||
| ) |
Creates a new SharpeRatio indicator using the specified periods
| period | Period of historical observation for sharpe ratio calculation |
| riskFreeRate | Risk-free rate for sharpe ratio calculation |
Definition at line 144 of file SharpeRatio.cs.
|
protected |
Computes the next value for this indicator from the given state.
| input | The input given to the indicator |
Definition at line 154 of file SharpeRatio.cs.
| override void QuantConnect.Indicators.SharpeRatio.Reset | ( | ) |
Resets this indicator to its initial state
Definition at line 164 of file SharpeRatio.cs.
| override bool QuantConnect.Indicators.SharpeRatio.IsReady => Ratio.Samples > _period |
Returns whether the indicator is properly initialized with data
Definition at line 72 of file SharpeRatio.cs.
|
getprotected |
RateOfChange indicator for calculating the sharpe ratio
Definition at line 47 of file SharpeRatio.cs.
|
getprotected |
RiskFreeRate indicator for calculating the sharpe ratio
Definition at line 52 of file SharpeRatio.cs.
|
getsetprotected |
Indicator to store the calculation of the sharpe ratio
Definition at line 57 of file SharpeRatio.cs.
|
getprotected |
Indicator to store the numerator of the Sharpe ratio calculation
Definition at line 62 of file SharpeRatio.cs.
|
get |
Required period, in data points, for the indicator to be ready and fully initialized.
Definition at line 67 of file SharpeRatio.cs.