Description Usage Arguments Details Value Author(s) See Also
This function allows user to analyze signals independently from rules.
1 2 3 | apply.paramset.signal.analysis(strategy.st, paramset.label, portfolio.st,
sigcol, sigval, on, forward.days, cum.sum = TRUE, include.day.of.signal,
obj.fun, decreasing, mktdata = NULL, verbose = TRUE)
|
strategy.st |
an object of type 'strategy' to add the indicator to |
paramset.label |
a label uniquely identifying the paramset within the strategy |
portfolio.st |
text name of the portfolio to associate the order book with |
sigcol |
column name to check for signal |
sigval |
signal value to match against |
on |
the periods endpoints to find as a character string |
forward.days |
days to exit post signal |
cum.sum |
whether to use cumsum on price changes |
include.day.of.signal |
whether to include the day of signal generation |
obj.fun |
objective function for determining goodness of each paramset |
decreasing |
how to sort the obj.fun output values |
mktdata |
market data |
verbose |
whether to output processing messages |
This function is similar to applyParameter
but includes additionally applySignal
wrapped within it. To use it, the user
will need to initially define the distribution and constraints by using add.distribution
and add.distribution.constraint
.
More generally, the function is designed to generate signals across various parameter combinations defined within the distribution and constraints. Afterwards it extract the next N day price changes for further anlaysis.
The parameter on
allows user to calculate post signal returns in different frequencies. Different signals have different timeframes effectiveness.
forward.days
lets the user select the number of post signal days to analyze results.
To determine the goodness of a parameter set relative to all others, we let the user specify their own objective function (via parameter obj.func
)
that will be used to calculate an objective value representing each parameter. These will then be sorted from best to worst. The
objective function will take in a single matrix ret.mat
of price changes. Each row represents an individual signal
while each column represents periods/post signal.
See demo 'signalAnalysisExample1.R' & 'signalAnalysisExample2.R'
A list of objects that contains the results
List of signals named by parameter combination. Each object within the list is a XTS object with columns being assets and rows being signals.
List of list. Sorted by parameter combination and then by asset. Contains matrix of next day returns; columns are period (N day look ahead) and rows are signals
List of list. Sorted by Asset and then by parameter combinations. Contains same matrix as sigret.by.paramset
List of signal statistics as calculated via custom user defined fitness function. Sorted by assets.
Michael Guan
add.distribution
add.distribution.constraint
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.