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

Functions

double tsa::momentum (const series< double > &cl, size_t period)
 Returns the difference between the current value of the series and the value period bars ago. More...
 
double tsa::rate_of_change (const series< double > &series, size_t period)
 Returns the 'ROC' which is the percentage difference between the current value of the series and the value period bars ago. More...
 
double tsa::relative_strenght (const series< double > &series_a, const series< double > &series_b, size_t period)
 Returns the 'relative strength', which is a measure of how series_a out-performed or under-performed series_b over the given period. More...
 
double tsa::true_range (const series< double > &hi, const series< double > &lo, const series< double > &cl)
 Returns the 'true range' where the 'range' is the difference between the bar's high and low price, and the 'true range' is the range adjusted to include any overnight gaps. More...
 
double tsa::typical_price (double high, double low, double close)
 Returns the 'typical price', which is the average of a bar's high,low,close prices. (high + low + close) / 3.0. More...
 
double tsa::volatility (const series< double > &series, size_t period)
 This function calculates a measure of volatility by analyzing the price changes between bars over the given period. This value is then 'annualized'. For the 'annualization' to be accurate, the function must be given the correct numberOfIntervalsInYear. For 'daily' price series, the default numberOfIntervalsInYear of 252 can be used, which corresponds to the number of trading days (in the United States) per year. More...
 

Detailed Description

Function Documentation

double tsa::momentum ( const series< double > &  cl,
size_t  period 
)

Returns the difference between the current value of the series and the value period bars ago.

Parameters
clThe cl.
periodThe period.
Returns
A double.
double tsa::rate_of_change ( const series< double > &  series,
size_t  period 
)

Returns the 'ROC' which is the percentage difference between the current value of the series and the value period bars ago.

Parameters
seriesThe series.
periodThe period.
Returns
A double.
double tsa::relative_strenght ( const series< double > &  series_a,
const series< double > &  series_b,
size_t  period 
)

Returns the 'relative strength', which is a measure of how series_a out-performed or under-performed series_b over the given period.

Parameters
series_aThe series a.
series_bThe series b.
periodThe period.
Returns
A double.
double tsa::true_range ( const series< double > &  hi,
const series< double > &  lo,
const series< double > &  cl 
)

Returns the 'true range' where the 'range' is the difference between the bar's high and low price, and the 'true range' is the range adjusted to include any overnight gaps.

Parameters
hiThe higher.
loThe lower.
clThe cl.
Returns
A double.
double tsa::typical_price ( double  high,
double  low,
double  close 
)

Returns the 'typical price', which is the average of a bar's high,low,close prices. (high + low + close) / 3.0.

Parameters
highThe high.
lowThe low.
closeThe close.
Returns
A double.
double tsa::volatility ( const series< double > &  series,
size_t  period 
)

This function calculates a measure of volatility by analyzing the price changes between bars over the given period. This value is then 'annualized'. For the 'annualization' to be accurate, the function must be given the correct numberOfIntervalsInYear. For 'daily' price series, the default numberOfIntervalsInYear of 252 can be used, which corresponds to the number of trading days (in the United States) per year.

If used with intraday data, the numberOfIntervalsInYear will be roughly 252 * [num bars per day].

Parameters
seriesThe series.
periodThe period.
Returns
A double.