This section lists all the functions available within the domain specific language. Each function can be called stand-alone or in combination with other others as long as the grammar of the language is respected.
In the following list we assume the following shortcuts:
The function documentation is build from the source code, using the sphinx macro dyntslist defined in dynts.web.dyntsx.
a
a
a
First order differencing evaluated as
Typical usage:
delta(tiker)
delta(tiker,lag=5)
Or for calculating standard deviation on changes:
sd(delta(tiker))
parameter lag: | backward lag. Default 1. |
---|
Second order difference evaluated as
Typical usage:
delta2(tiker)
delta2(tiker,lag=5)
It is an optimised shortcut function equivalent to:
delta(delta(tiker))
delta(delta(tiker,lag=5),lag=5)
parameter lag: | backward lag. Default 1. |
---|
Calculate the logarithmic difference of a timeseries. This is the first order difference in log-space useful for evaluating percentage moments:
Typical usage:
ldelta(tiker)
ldelta(tiker,lag=5)
parameter lag: | backward lag. Default 1. |
---|
Calculate the natural logarithm of a timeseries. It applies to each value and return a timeseries with exactly the same dimensions.
Arithmetic moving average function simply defined by
parameter window w: | |
---|---|
the rolling window in units. Default 20 |
Moving median function.
Rolling Percentage range function.
This is a shortcut function for calculating the standard deviation of log-changes. Therefore:
Calculate the linear regression of one series with respect to one or more series. For example:
regr(GOOG,YHOO)
will calculate
There are two optional parameters:
A two-dimensional scatter for timeseries:
scatter(GOOG,YHOO)
will create Google versus Yahoo prices withe date reference.
Rolling standard deviation given by:
where var is the rolling variance (not in docs yet). Typical usage:
sd(tiker)
sd(tiker,window=40)
sd(tiker, window=40, scale = 252)
sd(ldelta(GOOG), window = 60, scale = 252)
parameter window: | |
---|---|
the rolling window in units. Default 20 | |
parameter scale: | |
Scaling constant. Default 1 |
This is a shortcut function for calculating the standard deviation of changes. Therefore:
Rolling Annualised Sharpe Ratio given by:
Typical usage:
sharpe(tiker)
sharpe(tiker,window=40)
parameter window: | |
---|---|
the rolling window in units. Default 20. |
Calculate the square root of a timeseries. It applies to each value and return a timeseries with exactly the same dimensions.
Calculate the square of a timeseries. It applies to each value and return a timeseries with exactly the same dimensions.
Rolling arithmetic average variance given by:
where is the rolling moving average.
Typical usage:
var(tiker)
var(tiker,window=40)
parameter window w: | |
---|---|
The rolling window in units. Default 20 | |
parameter ddof d: | |
Delta degree of freedom. Default 0 |
a