make_mltimer: Converts the output list of a machine learning predictor into...

Description Usage Arguments Value

Description

Converts the output list of a machine learning predictor into a timer

Usage

1
make_mltimer(mlresults, prices, rules, trade_day = 1)

Arguments

mlresults

The output list generated by a wfo machine learning asset price predictor.

prices

An xts matrix containing the price of the asset being timed using the predictions of the machine learner. This should be a one column xts matrix.

rules

A list of equity curves to generate from the 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. For details on the supported rules, see function make_equitycurve.

trade_day

Specified when the timer trade is executed. trade_day = 1 means the trade is executed at the close of day when the timer is calculated. trade_day = 2 means at the next close, and so on.

Value

Returns a list containing the folloring xts matrices:

$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.

$timers

An xts matrix containing the binary timers associated with each timer method, computed daily, indicating one when the post-processed timer is positive, or zero otherwise.


jeanmarcgp/xtsanalytics documentation built on May 19, 2019, 12:38 a.m.