Class Basic
Collection of basic indicators.
Inheritance
Inherited Members
Namespace: TuringTrader.SimulatorV2.Indicators
Assembly: TuringTrader.Simulator.dll
Syntax
public static class Basic
Methods
| Improve this Doc View SourceAbsReturn(TimeSeriesFloat)
Calculate absolute return as r = v[0] - v[1].
Declaration
public static TimeSeriesFloat AbsReturn(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series of absolute returns |
AbsValue(TimeSeriesFloat)
Calculate absolute value of time series.
Declaration
public static TimeSeriesFloat AbsValue(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series of absolute values |
Const(Algorithm, double)
Create time series with constant value.
Declaration
public static TimeSeriesFloat Const(this Algorithm algo, double value)
Parameters
Type | Name | Description |
---|---|---|
Algorithm | algo | parent algorithm |
double | value | value |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series |
Const(TimeSeriesFloat, double)
Create time series with constant value.
Declaration
public static TimeSeriesFloat Const(this TimeSeriesFloat series, double value)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | parent series |
double | value | value |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series |
Delay(TimeSeriesFloat, int)
Delay time series.
Declaration
public static TimeSeriesFloat Delay(this TimeSeriesFloat series, int n)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
int | n | delay |
Returns
Type | Description |
---|---|
TimeSeriesFloat | delayed time series |
Exp(TimeSeriesFloat)
Calculate exp of time series.
Declaration
public static TimeSeriesFloat Exp(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | exp time series |
Highest(TimeSeriesFloat, int)
Return highest value in given period.
Declaration
public static TimeSeriesFloat Highest(this TimeSeriesFloat series, int n)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
int | n | observation period |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series of highest values |
Log(TimeSeriesFloat)
Calculate natural logarithm of time series.
Declaration
public static TimeSeriesFloat Log(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | log time series |
LogReturn(TimeSeriesFloat)
Calculate logarithmic return as r = log(v[0] / v[1]).
Declaration
public static TimeSeriesFloat LogReturn(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series of log returns |
Lowest(TimeSeriesFloat, int)
Return lowest value in given period.
Declaration
public static TimeSeriesFloat Lowest(this TimeSeriesFloat series, int n)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
int | n | observation period |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series of highest values |
Range(TimeSeriesFloat, int)
Return value range in given period.
Declaration
public static TimeSeriesFloat Range(this TimeSeriesFloat series, int n)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
int | n | observation period |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series of range values |
RelReturn(TimeSeriesFloat)
Return relative return, calculated as r = v[0] / v[1] - 1.
Declaration
public static TimeSeriesFloat RelReturn(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | time series of linear returns |
Sqrt(TimeSeriesFloat)
Calculate square root of time series.
Declaration
public static TimeSeriesFloat Sqrt(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | square root time series |
Square(TimeSeriesFloat)
Calculate square of time series.
Declaration
public static TimeSeriesFloat Square(this TimeSeriesFloat series)
Parameters
Type | Name | Description |
---|---|---|
TimeSeriesFloat | series | input series |
Returns
Type | Description |
---|---|
TimeSeriesFloat | squared time series |