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 |
---|---|---|
Time |
series | |
int | n |
Returns
Type | Description |
---|---|
Time |
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 |
---|---|---|
Time |
asset | primary time series |
Time |
market | benchmark time series |
int | n | period |
Returns
Type | Description |
---|---|
Time |
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 |
---|---|---|
Time |
series | input series |
int | n | calculation period |
double | stdev | width in standard deviations |
Returns
Type | Description |
---|---|
Performance.Bollinger |
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 |
---|---|---|
Time |
series | input series |
int | period | period for highest high |
Returns
Type | Description |
---|---|
Time |
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 |
---|---|---|
Time |
series |
Returns
Type | Description |
---|---|
Time |
UlcerIndex(TimeSeriesFloat, int)
Calculate Ulcer Index over period.
Declaration
public static TimeSeriesFloat UlcerIndex(this TimeSeriesFloat series, int period)
Parameters
Type | Name | Description |
---|---|---|
Time |
series | input series |
int | period | period for highest high |
Returns
Type | Description |
---|---|
Time |
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 |
---|---|---|
Time |
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 |
---|---|
Time |
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 |
---|---|---|
Time |
series | |
int | n |
Returns
Type | Description |
---|---|
Time |
volatility time series |