Class IndicatorsMomentum
Collection of momentum-based indicators.
Inheritance
Inherited Members
Namespace: TuringTrader.Indicators
Assembly: TuringTrader.Simulator.dll
Syntax
public static class IndicatorsMomentum
Methods
| Improve this Doc View SourceADX(Instrument, int, CacheId, string, int)
Calculate Average Directional Movement Index. https://en.wikipedia.org/wiki/Average_directional_movement_index
Declaration
public static ITimeSeries<double> ADX(this Instrument series, int n = 14, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
Instrument | series | input OHLC time series |
int | n | smoothing length |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | ADX time series |
CCI(Instrument, int, CacheId, string, int)
Calculate Commodity Channel Index of input time series, as described here: https://en.wikipedia.org/wiki/Commodity_channel_index
Declaration
public static ITimeSeries<double> CCI(this Instrument series, int n = 20, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
Instrument | series | input time series (OHLC) |
int | n | averaging length |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | CCI time series |
CCI(ITimeSeries<double>, int, CacheId, string, int)
Calculate Commodity Channel Index of input time series, as described here: https://en.wikipedia.org/wiki/Commodity_channel_index
Declaration
public static ITimeSeries<double> CCI(this ITimeSeries<double> series, int n = 20, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | averaging length |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | CCI time series |
LinRegression(ITimeSeries<double>, int, CacheId, string, int)
Calculate linear regression of time series.
Declaration
public static IndicatorsMomentum._Regression LinRegression(this ITimeSeries<double> series, int n, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | number of bars for regression |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
IndicatorsMomentum._Regression | regression parameters as time series |
LogMomentum(ITimeSeries<double>, int, CacheId, string, int)
Calculate logarithmic momentum: m = Ln(p[0] / p[n])
Declaration
public static ITimeSeries<double> LogMomentum(this ITimeSeries<double> series, int n = 21, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | number of bars for regression |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | log momentum, as time series |
LogRegression(ITimeSeries<double>, int, CacheId, string, int)
Calculate logarithmic regression of time series.
Declaration
public static IndicatorsMomentum._Regression LogRegression(this ITimeSeries<double> series, int n, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | number of bars for regression |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
IndicatorsMomentum._Regression | regression parameters as time series |
Momentum(ITimeSeries<double>, int, CacheId, string, int)
Calculate momentum, normalized to single bar: m = Ln(p[0] / p[n]) / n.
Declaration
public static ITimeSeries<double> Momentum(this ITimeSeries<double> series, int n = 21, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | number of bars for regression |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | log momentum, normalized to one day, as time series |
RSI(ITimeSeries<double>, int, CacheId, string, int)
Calculate Relative Strength Index, as described here: https://en.wikipedia.org/wiki/Relative_strength_index
Declaration
public static ITimeSeries<double> RSI(this ITimeSeries<double> series, int n = 14, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | smoothing period |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | RSI time series |
SimpleMomentum(ITimeSeries<double>, int, CacheId, string, int)
Calculate simple momentum: m = p[0] / p[n] - 1
Declaration
public static ITimeSeries<double> SimpleMomentum(this ITimeSeries<double> series, int n = 21, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | number of bars for regression |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | simple momentum, as time series |
StochasticOscillator(Instrument, int, CacheId, string, int)
Calculate Stochastic Oscillator, as described here: https://en.wikipedia.org/wiki/Stochastic_oscillator
Declaration
public static IndicatorsMomentum._StochasticOscillator StochasticOscillator(this Instrument series, int n = 14, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
Instrument | series | input time series (OHLC) |
int | n | oscillator period |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
IndicatorsMomentum._StochasticOscillator | Stochastic Oscillator as time series |
StochasticOscillator(ITimeSeries<double>, int, CacheId, string, int)
Calculate Stochastic Oscillator, as described here: https://en.wikipedia.org/wiki/Stochastic_oscillator
Declaration
public static IndicatorsMomentum._StochasticOscillator StochasticOscillator(this ITimeSeries<double> series, int n = 14, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | oscillator period |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
IndicatorsMomentum._StochasticOscillator | Stochastic Oscillator as time series |
TSI(ITimeSeries<double>, int, int, CacheId, string, int)
Calculate True Strength Index of input time series, as described here: https://en.wikipedia.org/wiki/True_strength_index
Declaration
public static ITimeSeries<double> TSI(this ITimeSeries<double> series, int r = 25, int s = 13, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | r | smoothing period for momentum |
int | s | smoothing period for smoothed momentum |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | TSI time series |
WilliamsPercentR(Instrument, int, CacheId, string, int)
Calculate Williams %R, as described here: https://en.wikipedia.org/wiki/Williams_%25R
Declaration
public static ITimeSeries<double> WilliamsPercentR(this Instrument series, int n = 10, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
Instrument | series | input time series (OHLC) |
int | n | period |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | Williams %R as time series |
WilliamsPercentR(ITimeSeries<double>, int, CacheId, string, int)
Calculate Williams %R, as described here: https://en.wikipedia.org/wiki/Williams_%25R
Declaration
public static ITimeSeries<double> WilliamsPercentR(this ITimeSeries<double> series, int n = 10, CacheId parentId = null, string memberName = "", int lineNumber = 0)
Parameters
Type | Name | Description |
---|---|---|
ITimeSeries<double> | series | input time series |
int | n | period |
CacheId | parentId | caller cache id, optional |
string | memberName | caller's member name, optional |
int | lineNumber | caller line number, optional |
Returns
Type | Description |
---|---|
ITimeSeries<double> | Williams %R as time series |