Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
Financial Indicators (DSL)

Functions

sref< double > tsa::AD (sref< double > &open, sref< double > &highs, sref< double > &lows, sref< double > &closes, sref< double > vol)
 
sref< double > tsa::AD (sref< double > &highs, sref< double > &lows, sref< double > &closes, sref< double > &vol)
 
sref< double > tsa::ADX (sref< double > highs, sref< double > lows, sref< double > closes, size_t period, size_t period_smooth)
 Average Directional Index by Welles Wilder. More...
 
series_tuple< double > tsa::BANDPASSFILTER (sref< double > data, size_t period, double bandwidth)
 Returns Bandpass Filter. More...
 
series_tuple< double > tsa::BB (sref< double > highs, sref< double > lows, sref< double > closes, size_t period, double stdev=2.0)
 Bollinger Bands are volatility bands located a given standard deviation above and below the moving average. They were developed by John Bollinger. More...
 
series_tuple< double > tsa::BEAR_POWER (sref< double > highs, sref< double > lows, sref< double > closes, size_t period=13)
 Returns the 'Bear Power' as developed by Alexander Elder. More...
 
series_tuple< double > tsa::BULL_POWER (sref< double > highs, sref< double > lows, sref< double > closes, size_t period=13)
 Returns the 'Bull Power' as developed by Alexander Elder. More...
 
sref< double > tsa::BUTTERWORTHMA (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Butterworth MA, 2 poles. More...
 
sref< double > tsa::BUTTERWORTHMA (sref< double > data, size_t period, size_t max_period)
 Returns Static Butterworth MA, 2 poles. More...
 
sref< double > tsa::BUTTERWORTHMA_3P (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Butterworth MA, 3 poles. More...
 
sref< double > tsa::BUTTERWORTHMA_3P (sref< double > data, size_t period, size_t max_period)
 Returns Static Butterworth MA, 3 poles. More...
 
sref< double > tsa::CCI (sref< double > highs, sref< double > lows, sref< double > closes, size_t period)
 Returns the Commodity Channel Index (CCI) as developed by Donald Lambert. It represents the difference of the current price and an average over the given period adjusted by the average deviation from the average over the given period. More...
 
sref< double > tsa::CGO (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Center of Gravity Oscillator (CGO), dynamic period. More...
 
sref< double > tsa::CGO (sref< double > data, size_t period, size_t max_period)
 Returns Center of Gravity Oscillator (CGO), static period. More...
 
sref< double > tsa::CGO_ADAPTIVE (sref< double > data, double alpha)
 Returns Adapptive Center of Gravity Oscillator (CGO). More...
 
sref< double > tsa::CHAIKIN_ADL (sref< double > highs, sref< double > lows, sref< double > closes, sref< double > volumes)
 'Chaiking Accumulation Distribution'. Measures the cummulative 'Money Flow Volume' (CHAIKIN_MFV()) into and out of a security. More...
 
sref< double > tsa::CHAIKIN_MF (sref< double > highs, sref< double > lows, sref< double > closes, sref< double > volumes, size_t period)
 'Chaikin Money Flow'. Represents the 'Money Flow Volume' (CHAIKING_MFV()) over a given period of time. More...
 
sref< double > tsa::CHAIKIN_MFV (sref< double > highs, sref< double > lows, sref< double > closes, sref< double > volumes)
 'Chaikin Money Flow Volume'. Measures the amount of money flowing into and out of a traded security on a given price bar. More...
 
sref< double > tsa::CHAIKIN_OSC (sref< double > highs, sref< double > lows, sref< double > closes, sref< double > volumes, size_t period)
 Returns the 'Chaikin Oscilator'. More...
 
sref< double > tsa::CHAIKIN_VOLAT (sref< double > highs, sref< double > lows, size_t period)
 Returns the 'Chaikin Volatility'. More...
 
sref< double > tsa::CYBERCYCLE (sref< double > data, double alpha)
 Returns Cyber Cycle. More...
 
sref< double > tsa::CYBERCYCLE_ADAPTIVE (sref< double > data, double alpha)
 Returns Adaptive Cyber Cycle. More...
 
sref< double > tsa::CYBERCYCLE_P (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Cyber Cycle with period. More...
 
sref< double > tsa::CYBERCYCLE_P (sref< double > data, size_t period, size_t max_period)
 Returns Static Cyber Cycle with period. More...
 
sref< double > tsa::DCMA (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic DCMA. More...
 
sref< double > tsa::DCMA (sref< double > data, size_t period, size_t max_period)
 Returns Static DCMA. More...
 
sref< double > tsa::DECYCLEROSC (sref< double > data, size_t hp_period1, size_t hp_period2)
 Returns Decycler Oscillator (CAT). More...
 
sref< double > tsa::DI_DN (sref< double > highs, sref< double > lows, sref< double > closes, size_t period)
 
sref< double > tsa::DI_UP (sref< double > highs, sref< double > lows, sref< double > closes, size_t period)
 
sref< double > tsa::DM_DN (sref< double > highs, sref< double > lows, size_t period)
 
sref< double > tsa::DM_DN_RAW (sref< double > highs, sref< double > low)
 
sref< double > tsa::DM_UP (sref< double > highs, sref< double > lows, size_t period)
 
sref< double > tsa::DM_UP_RAW (sref< double > highs, sref< double > low)
 
sref< double > tsa::DMI (sref< double > highs, sref< double > lows, sref< double > closes, size_t period)
 
sref< size_t > tsa::DOMINANTCYCLEPERIOD_AC (sref< double > close)
 Returns Autocorrelation Dominant Cycle Period. More...
 
sref< size_t > tsa::DOMINANTCYCLEPERIOD_HILBERT (sref< double > data)
 Returns Dominant Cycle Period using the Hilbert Transform. More...
 
sref< size_t > tsa::DOMINANTCYCLEPERIOD_HOMODYNE (sref< double > data)
 Returns Dominant Cycle Period using Homodyne Discriminator. More...
 
sref< double > tsa::EASE_OF_MOV (sref< double > highs, sref< double > lows, sref< double > vol, size_t smooth_period)
 Ease of Movement. More...
 
sref< double > tsa::EASE_OF_MOV_RAW (sref< double > highs, sref< double > lows, sref< double > vol)
 Ease of Movement (Raw) More...
 
sref< double > tsa::EMA_WILDER (sref< double > data, size_t period)
 Exponential moving average by Welles Wilder. Differs from regular EMA(). More...
 
sref< double > tsa::FISHERCGO (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Fisher Center of Gravity Oscillator (FCGO). More...
 
sref< double > tsa::FISHERCGO (sref< double > data, size_t period, size_t max_period)
 Returns Fisher Center of Gravity Oscillator (FCGO). More...
 
sref< double > tsa::FISHERRVI (sref< double > op, sref< double > hi, sref< double > lo, sref< double > cl, sref< size_t > period, size_t max_period)
 Returns Dynamic Fisher Relative Vigour Index (FISHERRVI). More...
 
sref< double > tsa::FISHERRVI (sref< double > op, sref< double > hi, sref< double > lo, sref< double > cl, size_t period, size_t max_period)
 Returns Static Fisher Relative Vigour Index (FISHERRVI). More...
 
sref< double > tsa::FISHERTRANSFORM (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Fisher Transform. More...
 
sref< double > tsa::FISHERTRANSFORM (sref< double > data, size_t period, size_t max_period)
 Returns Static Fisher Transform. More...
 
sref< double > tsa::FORCE_INDEX (sref< double > closes, sref< double > volumes, size_t period)
 Returns the 'Force Index'. It represents a smoothing of the value returned by RAW_FORCE_INDEX(). More...
 
sref< double > tsa::FORCE_INDEX_RAW (sref< double > closes, sref< double > volumes)
 Returns the 'Raw Force Index'. It represents the price change from the previous bar multiplied by volume, to provide a measure of 'force'. Developed by Alexander Elder. More...
 
series_tuple< double > tsa::HILBERT_OSC (sref< double > data)
 Returns Ehlers' Hilbet Oscillator. More...
 
sref< double > tsa::IFISHERCYBERCYCLE (sref< double > data, double alpha)
 Returns Inverse Fisher Cyber Cycle. More...
 
sref< double > tsa::IFISHERCYBERCYCLE_P (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Inverse Fisher Cyber Cycle with period. More...
 
sref< double > tsa::IFISHERCYBERCYCLE_P (sref< double > data, size_t period, size_t max_period)
 Returns Static Inverse Fisher Cyber Cycle with period. More...
 
sref< double > tsa::ITREND_RST (sref< double > data)
 Returns Instantaneous Trendline. More...
 
sref< double > tsa::KALMANMA (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Kalman MA. More...
 
sref< double > tsa::KALMANMA (sref< double > data, size_t period, size_t max_period)
 Returns Static Kalman MA. More...
 
sref< double > tsa::LAGUERREMA (sref< double > data, double gamma)
 Returns Laguerre MA. More...
 
sref< double > tsa::LAGUERRERSI (sref< double > data, double gamma)
 Returns Laguerre RSI. More...
 
series_tuple< double > tsa::MACD (sref< double > closes, size_t short_period=12, size_t long_period=26, size_t signal_period=9)
 Moving Average Convergence Divergence (MACD) as developed by Thomas Aspray. It measures the difference between two moving averages. The indicator is often shown as a histogram which is the difference between the MACD and a signal line (moving average of MACD). More...
 
series_tuple< double > tsa::MAMA_FAMA (sref< double > data, double fast_limit, double slow_limit)
 Returns Ehlers' MAMA and FAMA. More...
 
sref< double > tsa::MASS_INDEX (sref< double > closes, size_t avg_period=9, size_t avg_of_avg_period=9, size_t ratio_sum_period=25)
 Mass Index. A measure of range expansion developed by Donald Dorsey. More...
 
sref< double > tsa::MFI (sref< double > highs, sref< double > lows, sref< double > closes, sref< double > vol, size_t period=14)
 Money Flow Index. More...
 
sref< double > tsa::ROOFINGFILTER (sref< double > data, size_t lp_period, size_t hp_period)
 Returns Roofing Filter. More...
 
sref< double > tsa::RSI (sref< double > data, size_t period)
 Relative Strength Index. More...
 
sref< double > tsa::RSI_MOD (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Modified RSI. More...
 
sref< double > tsa::RSI_MOD (sref< double > data, size_t period, size_t max_period)
 Returns Static Modified RSI. More...
 
sref< double > tsa::RVI (sref< double > op, sref< double > hi, sref< double > lo, sref< double > cl, sref< size_t > period, size_t max_period)
 Returns Dynamic Relative Vigour Index (RVI). More...
 
sref< double > tsa::RVI (sref< double > op, sref< double > hi, sref< double > lo, sref< double > cl, size_t period, size_t max_period)
 Returns Static Relative Vigour Index (RVI). More...
 
sref< double > tsa::RVI_ADAPTIVE (sref< double > op, sref< double > hi, sref< double > lo, sref< double > cl, double alpha)
 Returns Adaptive Relative Vigour Index (RVI). More...
 
sref< double > tsa::SAM (sref< double > data, double alpha, size_t cutoff)
 Returns Smoothed Adative Momentum (SAM). More...
 
series_tuple< double > tsa::SINEWAVE_RST (sref< double > data)
 Returns Ehlers' Sinewave. More...
 
sref< double > tsa::SNR_HILBERT (sref< double > high, sref< double > low, size_t period)
 Returns Static SNR (HILBERT). More...
 
sref< double > tsa::SNR_RST (sref< double > high, sref< double > low)
 Returns Signal to Noise Ratio (SNR). More...
 
sref< double > tsa::SRSI (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic SRSI. More...
 
sref< double > tsa::SRSI (sref< double > data, size_t period, size_t max_period)
 Returns Static SRSI. More...
 
series_tuple< double > tsa::STOCH (sref< double > highs, sref< double > lows, sref< double > closes, size_t period, size_t k_smooth_period=3, size_t d_smooth_period=3)
 Returns the 'smoothed' Stochastic K and D where K is a smoothed version of the Stochastic-Oscillator (STOCH_OSC()) and D is a smoothed version on K. More...
 
sref< double > tsa::STOCH_OSC (sref< double > highs, sref< double > lows, sref< double > closes, size_t period)
 Returns the Stochastic Oscillator (raw Stochastic) as developed by George C. Lane. It measures the current price in relation to the given period's price range. More...
 
sref< double > tsa::STOCHASTIC_MOD (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Modified Stochastic. More...
 
sref< double > tsa::STOCHASTIC_MOD (sref< double > data, size_t period, size_t max_period)
 Returns Static Modified Stochastic. More...
 
sref< double > tsa::SUPERSMOOTHERMA (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Supersmoother MA. More...
 
sref< double > tsa::SUPERSMOOTHERMA (sref< double > data, size_t period, size_t max_period)
 Returns Static Supersmoother MA. More...
 
sref< double > tsa::SUPERSMOOTHERMA_3P (sref< double > data, sref< size_t > period, size_t max_period)
 Returns Dynamic Supersmoother MA, 3 poles. More...
 
sref< double > tsa::SUPERSMOOTHERMA_3P (sref< double > data, size_t period, size_t max_period)
 Returns Static Supersmoother MA, 3 poles. More...
 
sref< double > tsa::TP (sref< double > highs, sref< double > lows, sref< double > closes)
 Alias for TYPICAL_PRICE(). More...
 
series_tuple< double > tsa::TRIX (sref< double > closes, size_t smooth_1_period=15, size_t smooth_2_period=15, size_t smooth_3_period=15, size_t signal_period=9)
 TRIX. Represents the percent-rate-of-change of a triple exponentially smoothed average. Developed by Jack Hutson. More...
 
sref< double > tsa::TRUE_RANGE (sref< double > highs, sref< double > lows, sref< double > closes)
 Returns the 'true range'. More...
 
sref< double > tsa::TSI (sref< double > series, size_t smooth_1_period=25, size_t smooth_2_period=13)
 'True Strenght Indicator'. A momentum oscillator developed by William Blau. More...
 
sref< double > tsa::TWIGGS_MF (sref< double > highs, sref< double > lows, sref< double > closes, sref< double > vol, size_t period=14)
 Twiggs Money Flow. More...
 
sref< double > tsa::TYPICAL_PRICE (sref< double > highs, sref< double > lows, sref< double > closes)
 Returns the 'typical price'. ((hi + lo + cl) / 3.0). More...
 
sref< double > tsa::ULCER_INDEX (sref< double > closes, size_t period=14)
 Ulcer Index. More...
 
sref< double > tsa::ULTIMATE_OSC (sref< double > highs, sref< double > lows, sref< double > closes, size_t short_period=7, size_t medium_period=14, size_t long_period=28)
 'Ultimate Oscillator'. Developed by Larry Williams.It is a momentum indicators designed to capture the momentum across multiple timeframes. More...
 
sref< double > tsa::VOLATILITY (sref< double > data, size_t period, size_t num_intervals_in_year)
 Returns the annualized volatility over the given period. More...
 
sref< double > tsa::VOLATILITY_ALT (sref< double > data, size_t period)
 Alternative Volatility calculated as: STDEVP(close, period) / AVERAGE(close, period);. More...
 
sref< double > tsa::WILLIAMS_R (sref< double > highs, sref< double > lows, sref< double > closes, size_t period=14)
 Returns the 'Williams R' indicator as developed by Larry Williams. It represents the inverse of the stochastic indicator STOCH(). More...
 

Detailed Description

Function Documentation

sref< double > tsa::ADX ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period,
size_t  period_smooth 
)

Average Directional Index by Welles Wilder.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period over which the indicator is calculated.
period_smoothThe period with which the raw indicator is smoothed.
Returns
A sref<double>
series_tuple< double > tsa::BANDPASSFILTER ( sref< double >  data,
size_t  period,
double  bandwidth 
)

Returns Bandpass Filter.

This particular Bandpass Filter was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Bandpass Filter
bpfilter.png
Parameters
dataData series
periodPeriod, normally set to 20.
bandwidthBandwidth factor, normally set to 0.3.
Returns
series_tuple<double>
series_tuple< double > tsa::BB ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period,
double  stdev = 2.0 
)

Bollinger Bands are volatility bands located a given standard deviation above and below the moving average. They were developed by John Bollinger.

Note that the function returns a tuple of 3 series named 'upper', 'lower' and 'avg' respectively. In order to access each individual series use operator() as in:

auto bb = BB(in.high, in.low, in.close, 20, 2.0);
auto up_band = bb("upper");
auto avg = bb("avg");
auto low_band = bb("lower");
Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period.
stdevThe standard deviation multiplier. The default value is 2.0.
Returns
A series_tuple<double>
series_tuple< double > tsa::BEAR_POWER ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period = 13 
)

Returns the 'Bear Power' as developed by Alexander Elder.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period.
Returns
A series_tuple<double>
series_tuple< double > tsa::BULL_POWER ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period = 13 
)

Returns the 'Bull Power' as developed by Alexander Elder.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period.
Returns
A series_tuple<double>
sref< double > tsa::BUTTERWORTHMA ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Butterworth MA, 2 poles.

Butterworth MA is a well known moving average. This particular implementation is by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Dynamic Butterworth MA, 2 poles
dbma.png
Parameters
dataData series
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::BUTTERWORTHMA ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Butterworth MA, 2 poles.

Butterworth MA is a well known moving average. This particular implementation is by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Static Butterworth MA, 2 poles
sbma.png
Parameters
dataData series
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::BUTTERWORTHMA_3P ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Butterworth MA, 3 poles.

Butterworth MA is a well known moving average. This particular implementation is by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Dynamic Butterworth MA, 3 poles
dbma3p.png
Parameters
dataData series
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::BUTTERWORTHMA_3P ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Butterworth MA, 3 poles.

Butterworth MA is a well known moving average. This particular implementation is by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Static Butterworth MA, 3 poles
sbma3p.png
Parameters
dataData series
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::CCI ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period 
)

Returns the Commodity Channel Index (CCI) as developed by Donald Lambert. It represents the difference of the current price and an average over the given period adjusted by the average deviation from the average over the given period.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period.
Returns
A sref<double>
sref< double > tsa::CGO ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Center of Gravity Oscillator (CGO), dynamic period.

CGO was created by John Ehlers. It's a momentum type oscillator with little lag. TSAPI provides a normalised version which oscillates around zero. This is the dynamic period version.

Dynamic Center of Gravity Oscillator
dcgo.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum Lookback period.
Returns
sref<double>
sref< double > tsa::CGO ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Center of Gravity Oscillator (CGO), static period.

CGO was created by John Ehlers. It's a momentum type oscillator with little lag. TSAPI provides a normalised version which oscillates around zero. This is the static period version.

Static Center of Gravity Oscillator
scgo.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum Lookback period.
Returns
sref<double>
sref< double > tsa::CGO_ADAPTIVE ( sref< double >  data,
double  alpha 
)

Returns Adapptive Center of Gravity Oscillator (CGO).

CGO was created by John Ehlers. It's a momentum type oscillator with little lag. TSAPI provides a normalised version which oscillates around zero. This adaptive version is from the book "Cybernetic Analysis for Stocks and Futures".

Adaptive Center of Gravity Oscillator
acgo.png
Parameters
dataData series.
alphaSmoothing factor, usually set to 0.07.
Returns
sref<double>
sref< double > tsa::CHAIKIN_ADL ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
sref< double >  volumes 
)

'Chaiking Accumulation Distribution'. Measures the cummulative 'Money Flow Volume' (CHAIKIN_MFV()) into and out of a security.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
volumesThe volume.
Returns
A sref<double>
sref< double > tsa::CHAIKIN_MF ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
sref< double >  volumes,
size_t  period 
)

'Chaikin Money Flow'. Represents the 'Money Flow Volume' (CHAIKING_MFV()) over a given period of time.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
volumesThe volumes.
periodThe period.
Returns
A sref<double>
sref< double > tsa::CHAIKIN_MFV ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
sref< double >  volumes 
)

'Chaikin Money Flow Volume'. Measures the amount of money flowing into and out of a traded security on a given price bar.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
volumesThe volumes.
Returns
A sref<double>
sref<double> tsa::CHAIKIN_OSC ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
sref< double >  volumes,
size_t  period 
)

Returns the 'Chaikin Oscilator'.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
volumesThe volumes.
periodThe period.
Returns
A sref<double>
sref< double > tsa::CHAIKIN_VOLAT ( sref< double >  highs,
sref< double >  lows,
size_t  period 
)

Returns the 'Chaikin Volatility'.

Parameters
highsThe highs.
lowsThe lows.
periodThe period.
Returns
A sref<double>
sref< double > tsa::CYBERCYCLE ( sref< double >  data,
double  alpha 
)

Returns Cyber Cycle.

Cyber Cycle was created by John Ehlers. It extracts, in a simple way, the cycle component of a data series.

Cyber Cycle
ccycle.png
Parameters
dataData series.
alphaSmoothing factor, 0.07 normally used.
Returns
sref<double>
sref< double > tsa::CYBERCYCLE_ADAPTIVE ( sref< double >  data,
double  alpha 
)

Returns Adaptive Cyber Cycle.

Cyber Cycle was created by John Ehlers. It extracts, in a simple way, the cycle component of a data series. This adaptive version is from the book "Cybernetic Analysis for Stocks and Futures".

Adaptive Cyber Cycle
accycle.png
Parameters
dataData series.
alphaSmoothing factor, 0.07 normally used.
Returns
sref<double>
sref< double > tsa::CYBERCYCLE_P ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Cyber Cycle with period.

Cyber Cycle was created by John Ehlers. It extracts, in a simple way, the cycle component of a data series. This is a TSAPI version using a lookback period instead of alpha smoothing factor. A period of 14 is about the same as an alpha of 0.07.

Cyber Cycle with period
dccycle_p.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::CYBERCYCLE_P ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Cyber Cycle with period.

Cyber Cycle was created by John Ehlers. It extracts, in a simple way, the cycle component of a data series. This is a TSAPI version using a lookback period instead of alpha smoothing factor. A period of 14 is about the same as an alpha of 0.07.

Cyber Cycle with period
sccycle_p.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::DCMA ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic DCMA.

Distance Coefficent MA (DCMA) was created by John Ehlers. It's an adaptive type of MA. It uses the distance between current and previous prices to adjust the MA coefficients making it more responsive in a fast market.

Dynamic DCMA
ddcma.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::DCMA ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static DCMA.

Distance Coefficent MA (DCMA) was created by John Ehlers. It's an adaptive type of MA. It uses the distance between current and previous prices to adjust the MA coefficients making it more responsive in a fast market.

Static DCMA
sdcma.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::DECYCLEROSC ( sref< double >  data,
size_t  hp_period1,
size_t  hp_period2 
)

Returns Decycler Oscillator (CAT).

Decycler Oscillator was created by John Ehlers. This code is from the code in the book "Cycle Analytics for Traders" by John Ehlers.

Decycler Oscillator (CAT)
dcoscc.png
Parameters
dataData series
hpperiod1Highpass period 1, usually set to 30.
hpperiod2Highpass period 2, usually set to 60.
Returns
sref<double>
sref< size_t > tsa::DOMINANTCYCLEPERIOD_AC ( sref< double >  close)

Returns Autocorrelation Dominant Cycle Period.

Autocorrelation Dominant Cycle Period is a well known Spectral Analysis method. This particular implementation was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Autocorrelation Dominant Cycle Period
acdcp.png
Parameters
closeClose Data series
Returns
sref<size_t>
sref< size_t > tsa::DOMINANTCYCLEPERIOD_HILBERT ( sref< double >  data)

Returns Dominant Cycle Period using the Hilbert Transform.

Dominant Cycle Period using the Hilbert Transform was created by John Ehlers. TSAPI is using the version from S&C November 2000, which is slightly different from the original version. This version is preferred by John Ehlers.

Dominant Cycle Period Hilbert
dcp_hilbert.png
Parameters
dataData series.
Returns
sref<double>
sref< size_t > tsa::DOMINANTCYCLEPERIOD_HOMODYNE ( sref< double >  data)

Returns Dominant Cycle Period using Homodyne Discriminator.

Dominant Cycle Period using the Homodyne Discriminator was created by John Ehlers. The code is from the book "Rocket Science For Traders" by John Ehlers.

Dominant Cycle Period Homodyne
dcp_homodyne.png
Parameters
dataData series.
Returns
sref<double>
sref< double > tsa::EASE_OF_MOV ( sref< double >  highs,
sref< double >  lows,
sref< double >  vol,
size_t  smooth_period 
)

Ease of Movement.

Parameters
highsThe highs.
lowsThe lows.
volThe volume.
smooth_periodThe smooth period.
Returns
A sref<double>
sref< double > tsa::EASE_OF_MOV_RAW ( sref< double >  highs,
sref< double >  lows,
sref< double >  vol 
)

Ease of Movement (Raw)

Parameters
highsThe highs.
lowsThe lows.
volThe volume.
Returns
A sref<double>
sref< double > tsa::EMA_WILDER ( sref< double >  data,
size_t  period 
)

Exponential moving average by Welles Wilder. Differs from regular EMA().

Parameters
dataThe data.
periodThe period.
Returns
A sref<double>
sref< double > tsa::FISHERCGO ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Fisher Center of Gravity Oscillator (FCGO).

CGO was created by John Ehlers. It's a momentum type oscillator with little lag. TSAPI provides a normalised version which oscillates around zero. Fisher Transform will normalize the values of CGO between -1 and 1 and make the pdf (probability density function) of the returned values Gaussian.

Dynamic Fisher Center of Gravity Oscillator
dfcgo.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum Lookback period.
Returns
sref<double>
sref< double > tsa::FISHERCGO ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Fisher Center of Gravity Oscillator (FCGO).

CGO was created by John Ehlers. It's a momentum type oscillator with little lag. TSAPI provides a normalised version which oscillates around zero. Fisher Transform will normalize the values of CGO between -1 and 1 and make the pdf (probability density function) of the returned values Gaussian.

Static Fisher Center of Gravity Oscillator
sfcgo.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum Lookback period.
Returns
sref<double>
sref< double > tsa::FISHERRVI ( sref< double >  op,
sref< double >  hi,
sref< double >  lo,
sref< double >  cl,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Fisher Relative Vigour Index (FISHERRVI).

RVI was created by John Ehlers. It's a momentum type oscillator, returning the relationship between wick and body of a candle. Fisher Transform will normalize the values of RVI between -1 and 1 and make the pdf (probability density function) of the returned values Gaussian.

Dynamic Fisher Relative Vigor Index
dfrvi.png
Parameters
openOpen series.
highHigh series.
lowLow series.
closeClose series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::FISHERRVI ( sref< double >  op,
sref< double >  hi,
sref< double >  lo,
sref< double >  cl,
size_t  period,
size_t  max_period 
)

Returns Static Fisher Relative Vigour Index (FISHERRVI).

RVI was created by John Ehlers. It's a momentum type oscillator, returning the relationship between wick and body of a candle. Fisher Transform will normalize the values of RVI between -1 and 1 and make the pdf (probability density function) of the returned values Gaussian.

Static Fisher Relative Vigor Index
sfrvi.png
Parameters
openOpen series.
highHigh series.
lowLow series.
closeClose series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::FISHERTRANSFORM ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Fisher Transform.

Fisher Transform was introduced to the trading community by John Ehlers. Fisher Transform will normalize the values between -1 and 1 and make the pdf (probability density function) of the returned values Gaussian.

Dynamic Fisher Transform
dftransform.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::FISHERTRANSFORM ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Fisher Transform.

Fisher Transform was introduced to the trading community by John Ehlers. Fisher Transform will normalize the values between -1 and 1 and make the pdf (probability density function) of the returned values Gaussian.

Static Fisher Transform
sftransform.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::FORCE_INDEX ( sref< double >  closes,
sref< double >  volumes,
size_t  period 
)

Returns the 'Force Index'. It represents a smoothing of the value returned by RAW_FORCE_INDEX().

Parameters
closesThe closes.
volumesThe volumes.
periodThe period.
Returns
A sref<double>
sref< double > tsa::FORCE_INDEX_RAW ( sref< double >  closes,
sref< double >  volumes 
)

Returns the 'Raw Force Index'. It represents the price change from the previous bar multiplied by volume, to provide a measure of 'force'. Developed by Alexander Elder.

Parameters
closesThe closes.
volumesThe volumes.
Returns
A sref<double>
series_tuple< double > tsa::HILBERT_OSC ( sref< double >  data)

Returns Ehlers' Hilbet Oscillator.

The Hilbert Oscillator was develoed by John Ehlers. This indicator could be used to identify turning points. The code is from the book "Cybernetic Analysis for Stocks and Futures" by John Ehlers.

Hilbert Oscillator
hilbertosc.png
Parameters
dataData series.
Returns
series_tuple<double>
sref< double > tsa::IFISHERCYBERCYCLE ( sref< double >  data,
double  alpha 
)

Returns Inverse Fisher Cyber Cycle.

Cyber Cycle created by John Ehlers. It extracts, in a simple way, the cycle component of a data series. Inverse Fisher Transform will normalize the values of Cyber Cycle between -1 and 1.

Inverse Fisher Cyber Cycle
ifccycle.png
Parameters
dataData series.
alphaSmoothing factor, 0.07 normally used.
Returns
sref<double>
sref< double > tsa::IFISHERCYBERCYCLE_P ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Inverse Fisher Cyber Cycle with period.

Cyber Cycle created by John Ehlers. It extracts, in a simple way, the cycle component of a data series. Inverse Fisher Transform will normalize the values of Cyber Cycle between -1 and 1. This is a TSAPI version using a lookback period instead of alpha smoothing factor. A period of 14 is about the same as an alpha of 0.07.

Dynamic Inverse Fisher Cyber Cycle with period
difccycle_p.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::IFISHERCYBERCYCLE_P ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Inverse Fisher Cyber Cycle with period.

Cyber Cycle created by John Ehlers. It extracts, in a simple way, the cycle component of a data series. Inverse Fisher Transform will normalize the values of Cyber Cycle between -1 and 1. This is a TSAPI version using a lookback period instead of alpha smoothing factor. A period of 14 is about the same as an alpha of 0.07.

Dynamic Inverse Fisher Cyber Cycle with period
difccycle_p.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::ITREND_RST ( sref< double >  data)

Returns Instantaneous Trendline.

Instantaneous Trendline was created by John Ehlers. The code is from the book "Rocket Science For Traders" by John Ehlers.

Instantaneous Trendline
itrend.png
Parameters
dataData series.
Returns
sref<double>
sref< double > tsa::KALMANMA ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Kalman MA.

Kalman MA is a well known moving average. In the past it was used for tracking in missiles.

Dynamic Kalman MA
dkalmanma.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::KALMANMA ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Kalman MA.

Kalman MA is a well known moving average. In the past it was used for tracking in missiles.

Static Kalman MA
skalmanma.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::LAGUERREMA ( sref< double >  data,
double  gamma 
)

Returns Laguerre MA.

Laguerre MA was introduced to the trading community by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Laguerre MA
lma.png
Parameters
dataData series
gammasmoothing factor, usually set to 0.5.
Returns
sref<double>
sref< double > tsa::LAGUERRERSI ( sref< double >  data,
double  gamma 
)

Returns Laguerre RSI.

Laguerre RSI was introduced to the trading community by John Ehlers. It's based on the Laguerre MA. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Laguerre RSI
lrsi.png
Parameters
dataData series
gammasmoothing factor, usually set to 0.5.
Returns
sref<double>
series_tuple< double > tsa::MACD ( sref< double >  closes,
size_t  short_period = 12,
size_t  long_period = 26,
size_t  signal_period = 9 
)

Moving Average Convergence Divergence (MACD) as developed by Thomas Aspray. It measures the difference between two moving averages. The indicator is often shown as a histogram which is the difference between the MACD and a signal line (moving average of MACD).

Note that the function returns a tuple of 3 series named 'macd', 'signal' and 'hist' respectively. In order to access each individual series use operator() as in:

auto tuple = MACD(mkt.close, 12, 26, 9);
auto macd = tuple("macd");
auto signal = tuple("signal");
auto hist = tuple("hist");

.

Parameters
closesThe closes.
short_periodThe short period.
long_periodThe long period.
signal_periodThe signal period.
Returns
A series_tuple<double>
series_tuple< double > tsa::MAMA_FAMA ( sref< double >  data,
double  fast_limit,
double  slow_limit 
)

Returns Ehlers' MAMA and FAMA.

Mother of All Moving Averages (MAMA) and Following Adaptive Moving Average (FAMA) was created by John Ehlers. The code is from the book "Cybernetic Analysis for Stocks and Futures" by John Ehlers.

Mother of All Moving Averages
mama.png
Parameters
dataData series.
fast_limitMax value, usually 0.5.
slow_limitMin value, usually 0.05.
Returns
series_tuple<double>
sref< double > tsa::MASS_INDEX ( sref< double >  closes,
size_t  avg_period = 9,
size_t  avg_of_avg_period = 9,
size_t  ratio_sum_period = 25 
)

Mass Index. A measure of range expansion developed by Donald Dorsey.

Parameters
closesThe closes.
avg_periodThe average period.
avg_of_avg_periodThe average of average period.
ratio_sum_periodThe ratio sum period.
Returns
A sref<double>
sref< double > tsa::MFI ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
sref< double >  vol,
size_t  period = 14 
)

Money Flow Index.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
volThe volume.
periodThe period.
Returns
A sref<double>
sref< double > tsa::ROOFINGFILTER ( sref< double >  data,
size_t  lp_period,
size_t  hp_period 
)

Returns Roofing Filter.

Roofing Filter was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Roofing Filter
rfilter.png
Parameters
dataData series
periodLowpass period, normally set to 10.
periodHighpass period, normally set to 48.
Returns
sref<double>
sref< double > tsa::RSI ( sref< double >  data,
size_t  period 
)

Relative Strength Index.

Parameters
dataThe data series.
periodThe period.
Returns
A sref<double>
sref< double > tsa::RSI_MOD ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Modified RSI.

Modified RSI was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Dynamic Modified RSI
dmrsi.png
Parameters
dataData series
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::RSI_MOD ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Modified RSI.

Modified RSI was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Static Modified RSI
smrsi.png
Parameters
dataData series
periodStatic lookback period, normally set to 20.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::RVI ( sref< double >  op,
sref< double >  hi,
sref< double >  lo,
sref< double >  cl,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Relative Vigour Index (RVI).

RVI was created by John Ehlers. It's a momentum type oscillator, returning the relationship between wick and body of a candle.

Dynamic Relative Vigour Index
drvi.png
Parameters
openOpen series.
highHigh series.
lowLow series.
closeClose series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::RVI ( sref< double >  op,
sref< double >  hi,
sref< double >  lo,
sref< double >  cl,
size_t  period,
size_t  max_period 
)

Returns Static Relative Vigour Index (RVI).

RVI was created by John Ehlers. It's a momentum type oscillator, returning the relationship between wick and body of a candle.

Static Relative Vigour Index
srvi.png
Parameters
openOpen series.
highHigh series.
lowLow series.
closeClose series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::RVI_ADAPTIVE ( sref< double >  op,
sref< double >  hi,
sref< double >  lo,
sref< double >  cl,
double  alpha 
)

Returns Adaptive Relative Vigour Index (RVI).

RVI was created by John Ehlers. It's a momentum type oscillator, returning the relationship between wick and body of a candle. This adaptive version is from the book "Cybernetic Analysis for Stocks and Futures".

Adaptive Relative Vigour Index
arvi.png
Parameters
openOpen series.
highHigh series.
lowLow series.
closeClose series.
alphaSmoothing factor, usually set to 0.07.
Returns
sref<double>
sref< double > tsa::SAM ( sref< double >  data,
double  alpha,
size_t  cutoff 
)

Returns Smoothed Adative Momentum (SAM).

Smoothed Adative Momentum was created by John Ehlers. It's basically just momentum but smoothed and made adaptive. This version is from the book "Cybernetic Analysis for Stocks and Futures".

Smoothed Adaptive Momentum
sam.png
Parameters
dataData series.
alphaSmoothing factor, 0.07 normally used.
cutoffPeriod cutoff, 8 is normally used
Returns
sref<double>
series_tuple< double > tsa::SINEWAVE_RST ( sref< double >  data)

Returns Ehlers' Sinewave.

The Sinewave was develoed by John Ehlers. This indicator could be used to identify turning points. The code is from the book "Rocket Sience For Traders" by John Ehlers.

Sinewave
sinewave.png
Parameters
dataData series.
Returns
series_tuple<double>
sref< double > tsa::SNR_HILBERT ( sref< double >  high,
sref< double >  low,
size_t  period 
)

Returns Static SNR (HILBERT).

Signal to Noise Ratio (SNR) using the Hilbert Transform was created by John Ehlers. In the TSAPI version the lookback period can be changed. Ehlers used a fixed 7 bar lookback period for normalizing input data. A SNR value above 6 dB indicates the signal is twice as strong as the noise. Noise is defined as High-Low range.

Static SNR Hilbert
snr_hilbert.png
Parameters
dataData series.
periodStatic lookback period, usually set to 7.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::SNR_RST ( sref< double >  high,
sref< double >  low 
)

Returns Signal to Noise Ratio (SNR).

Signal to Noise Ratio (SNR) using the Homodyne Discriminator was created by John Ehlers. A SNR value above 6 dB indicates the signal is twice as strong as the noise. Noise is defined as High-Low range. The code is from the book "Rocket Science For Traders" by John Ehlers.

SNR Hilbert
snr_hilbert.png
Parameters
dataData series.
periodLookback period, normally set to 7.
Returns
sref<double>
sref< double > tsa::SRSI ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic SRSI.

Smoothed RSI (SRSI) was created by John Ehlers. Please note that Ehlers version of RSI is not calculated exactly the same way as the original RSI.

Dynamic SRSI
srsi.png
Parameters
dataData series.
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::SRSI ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static SRSI.

Smoothed RSI (SRSI) was created by John Ehlers. Please note that Ehlers version of RSI is not calculated exactly the same way as the original RSI.

SRSI
srsi.png
Parameters
dataData series.
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
series_tuple< double > tsa::STOCH ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period,
size_t  k_smooth_period = 3,
size_t  d_smooth_period = 3 
)

Returns the 'smoothed' Stochastic K and D where K is a smoothed version of the Stochastic-Oscillator (STOCH_OSC()) and D is a smoothed version on K.

Note that the function returns a tuple of 2 series named 'K', 'D' respectively. In order to access each individual series use operator() as in:

auto tuple = STOCH(mkt.high, mkt.low, mkt.close, 3, 3);
auto k = tuple("K");
auto d = tuple("D");

.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period.
k_smooth_periodThe K smooth period.
d_smooth_periodThe D smooth period.
Returns
A series_tuple<double>
sref< double > tsa::STOCH_OSC ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period 
)

Returns the Stochastic Oscillator (raw Stochastic) as developed by George C. Lane. It measures the current price in relation to the given period's price range.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period.
Returns
A sref<double>
sref< double > tsa::STOCHASTIC_MOD ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Modified Stochastic.

Modified Stochastic was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Dynamic Modified Stochastic
dmstoc.png
Parameters
dataData series
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::STOCHASTIC_MOD ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Modified Stochastic.

Modified Stochastic was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Static Modified Stochastic
smstoc.png
Parameters
dataData series
periodStatic lookback period, normally set to 20.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::SUPERSMOOTHERMA ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Supersmoother MA.

Supersmoother MA was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Dynamic Supersmoother MA
dssma.png
Parameters
dataData series
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::SUPERSMOOTHERMA ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Supersmoother MA.

Supersmoother MA was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Static Supersmoother MA
sssma.png
Parameters
dataData series
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::SUPERSMOOTHERMA_3P ( sref< double >  data,
sref< size_t >  period,
size_t  max_period 
)

Returns Dynamic Supersmoother MA, 3 poles.

Supersmoother MA was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Dynamic Supersmoother MA, 3 poles
dssma3p.png
Parameters
dataData series
periodDynamic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::SUPERSMOOTHERMA_3P ( sref< double >  data,
size_t  period,
size_t  max_period 
)

Returns Static Supersmoother MA, 3 poles.

Supersmoother MA was created by John Ehlers. The code is from the book "Cycle Analytics for Traders" by John Ehlers.

Static Supersmoother MA, 3 poles
sssma3p.png
Parameters
dataData series
periodStatic lookback period.
max_periodMaximum lookback period.
Returns
sref<double>
sref< double > tsa::TP ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes 
)

Alias for TYPICAL_PRICE().

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
Returns
A sref<double>
series_tuple< double > tsa::TRIX ( sref< double >  closes,
size_t  smooth_1_period = 15,
size_t  smooth_2_period = 15,
size_t  smooth_3_period = 15,
size_t  signal_period = 9 
)

TRIX. Represents the percent-rate-of-change of a triple exponentially smoothed average. Developed by Jack Hutson.

Parameters
closesThe closes.
smooth_1_periodThe smooth 1 period.
smooth_2_periodThe smooth 2 period.
smooth_3_periodThe smooth 3 period.
signal_periodThe signal period.
Returns
A series_tuple<double>
sref< double > tsa::TRUE_RANGE ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes 
)

Returns the 'true range'.

Calculated as: a = hi[0] - lo[0]; b = hi[0] - cl[1]; c = cl[1] - lo[0]; true_range = max( max(a, b), c);

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
Returns
A sref<double>
sref< double > tsa::TSI ( sref< double >  series,
size_t  smooth_1_period = 25,
size_t  smooth_2_period = 13 
)

'True Strenght Indicator'. A momentum oscillator developed by William Blau.

Parameters
seriesThe series
smooth_1_periodThe first period smooth.
smooth_2_periodThe second period smooth.
Returns
A sref<double>
sref< double > tsa::TWIGGS_MF ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
sref< double >  vol,
size_t  period = 14 
)

Twiggs Money Flow.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
volThe volume.
periodThe period.
Returns
A sref<double>
sref< double > tsa::TYPICAL_PRICE ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes 
)

Returns the 'typical price'. ((hi + lo + cl) / 3.0).

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
Returns
A sref<double>
sref< double > tsa::ULCER_INDEX ( sref< double >  closes,
size_t  period = 14 
)

Ulcer Index.

Parameters
closesThe closes.
periodThe period.
Returns
A sref<double>
sref< double > tsa::ULTIMATE_OSC ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  short_period = 7,
size_t  medium_period = 14,
size_t  long_period = 28 
)

'Ultimate Oscillator'. Developed by Larry Williams.It is a momentum indicators designed to capture the momentum across multiple timeframes.

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
short_periodThe short period.
medium_periodThe medium period.
long_periodThe long period.
Returns
A sref<double>
sref< double > tsa::VOLATILITY ( sref< double >  data,
size_t  period,
size_t  num_intervals_in_year 
)

Returns the annualized volatility over the given period.

A return value of 0.15 corresponds to an annualized volatility of 15%.

Parameters
dataThe data.
periodThe period.
num_intervals_in_yearNumber of intervals in years.
Returns
A sref<double>
sref< double > tsa::VOLATILITY_ALT ( sref< double >  data,
size_t  period 
)

Alternative Volatility calculated as: STDEVP(close, period) / AVERAGE(close, period);.

Parameters
dataThe data.
periodThe period.
Returns
A sref<double>
sref< double > tsa::WILLIAMS_R ( sref< double >  highs,
sref< double >  lows,
sref< double >  closes,
size_t  period = 14 
)

Returns the 'Williams R' indicator as developed by Larry Williams. It represents the inverse of the stochastic indicator STOCH().

Parameters
highsThe highs.
lowsThe lows.
closesThe closes.
periodThe period.
Returns
A sref<double>