Description Usage Arguments Details Value
An xts matrix of an asset price and a binary timer is provided, along with a list of rules for converting the daily binary timer into equity curves. Each list objet in the set of rules corresponds to an equity curve. Both long only and long-short equity curves are returned.
1 | make_equitycurve(data, rules, Nlag = 1)
|
data |
An xts matrix consisting of 2 columns. The asset prices in the first column and an associated timer in the second column. The timer may be binary or trinary. If more than two columns are provided, only the first two are used. |
rules |
A list of rules associated with each equity curve to generate from the daily timer. Each list object consist of a named list which names the equity curve and contains the rules to construct that equity curve. The first item on each named list must be the name of the ruleset to follow, and other items are its arguments, which may be optional. Currently supported rules include the following:
|
Nlag |
Number of days to lag the timer. Default is 1. |
Supported rules include perioding endpoints with optional offsets, and a running sum of positives over a sliding window (sma rule), where the thresholds for an up or down call can be set independently enabling to implement hysteresis.
NOTE: Trinary timers are not yet supported.
Returns a list containting xts matrices of the timers, a long only equity curve and a long-short equity curve.
$long
An xts matrix containing the equity curves associated with each timer method, computed daily, and long when the post-processed timer is positive, or in cash otherwise (without earning any interest). The normalized asset price equity curve is also included to enable an easy comparison.
$longshort
An xts matrix containing the equity curves associated with each timer method, computed daily, and long when the post-processed timer is positive, or short otherwise. The normalized asset price equity curve is also included to enable an easy comparison.
$timers
An xts matrix containing the binary timers associated with each timer rule, computed daily.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.