Class Performance
Collection of volatility-related indictors.
Inheritance
Inherited Members
Namespace: TuringTrader.SimulatorV2.Indicators
Assembly: TuringTrader.Simulator.dll
Syntax
public static class Performance
Methods
| Improve this Doc View SourceAverageTrueRange(TimeSeriesAsset, int)
Calculate Averaged True Range, as described here: https://en.wikipedia.org/wiki/Average_true_range.
Declaration
public static TimeSeriesFloat AverageTrueRange(this TimeSeriesAsset series, int n)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesAsset | series | |
int | n |
Returns
Type | Description |
---|---|
TimeSeriesFloat | average true range time series |
Beta(TimeSeriesFloat, TimeSeriesFloat, int)
Calculate beta of time series to benchmark.
Declaration
public static TimeSeriesFloat Beta(this TimeSeriesFloat asset, TimeSeriesFloat market, int n)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | asset | primary time series |
TimeSeriesFloat | market | benchmark time series |
int | n | period |
Returns
Type | Description |
---|---|
TimeSeriesFloat | beta time series |
BollingerBands(TimeSeriesFloat, int, double)
Calculate Bollinger Bands, as described here: https://en.wikipedia.org/wiki/Bollinger_Bands.
Declaration
public static Performance.BollingerT BollingerBands(this TimeSeriesFloat series, int n = 20, double stdev = 2)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
int | n | calculation period |
double | stdev | width in standard deviations |
Returns
Type | Description |
---|---|
Performance.BollingerT | Bollinger Band container of time series |
Drawdown(TimeSeriesFloat, int)
Calculate current drawdown from highest high in period.
Declaration
public static TimeSeriesFloat Drawdown(this TimeSeriesFloat series, int period)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
int | period | period for highest high |
Returns
Type | Description |
---|---|
TimeSeriesFloat | drawdown time series |
TrueRange(TimeSeriesAsset)
Calculate True Range, non averaged, as described here: https://en.wikipedia.org/wiki/Average_true_range.
Declaration
public static TimeSeriesFloat TrueRange(this TimeSeriesAsset series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesAsset | series |
Returns
Type | Description |
---|---|
TimeSeriesFloat |
UlcerIndex(TimeSeriesFloat, int)
Calculate Ulcer Index over period.
Declaration
public static TimeSeriesFloat UlcerIndex(this TimeSeriesFloat series, int period)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
int | period | period for highest high |
Returns
Type | Description |
---|---|
TimeSeriesFloat | ulcer index time series |
ValueAtRisk(TimeSeriesAsset, int, double)
Calculate Value-at-Risk at given percentile. The result is expressed as a fraction of the asset's value. A value of 0.1 equates to 10% risk.
Declaration
public static TimeSeriesFloat ValueAtRisk(this TimeSeriesAsset series, int days = 21, double percentile = 0.95)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesAsset | series | input time series |
int | days | of days to sample |
double | percentile | percentile of value at risk. A value of 0.99 represents the 99-th percentile |
Returns
Type | Description |
---|---|
TimeSeriesFloat | value at risk, expresed as a fraction of the asset value. A value of 0.1 equates to 10% risk |
Volatility(TimeSeriesFloat, int)
Calculate historical volatility, based on log-returns.
Declaration
public static TimeSeriesFloat Volatility(this TimeSeriesFloat series, int n = 10)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | |
int | n |
Returns
Type | Description |
---|---|
TimeSeriesFloat | volatility time series |