Description Usage Arguments Value Author(s) Examples
Function to construct parameter constraint object. The returned value will be one of the inputs to the applyParameter function.
1 2 | setParameterConstraint(paramConstraintObj = list(), constraintLabel,
paramList, relationship)
|
paramConstraintObj |
the ParameterConstraint object to be updated, if missing, funtion will create a new one. |
constraintLabel |
string label to apply to the constraint. |
paramList |
the two name of the prameters as a list contains two strings. |
relationship |
relationship between the 1st parameter and 2nd one. ('gt' means 1st parameter > 2nd parameter). |
The returned object is a structure contains the constraints on pairs of parameters, if the input argument 'paramConstraintObj' is provided, the function update the input paramConstraintObj object and return the updated one. When specify the constraints of several pairs of parameters, usually the first returned object is passed to the next several call of the function as input argument 'paramConstraintObj'. See example.
Yu Chen
1 2 3 4 5 6 7 8 9 10 | #(For complete demo see parameterTestMACD.R)
#In a MACD strategy, we want to fast macd calcuated from less time periods (days)
#than slow macd signal:
## Not run:
x<-setParameterConstraint(constraintLabel='macdPC',
paramList=c('nFast','nSlow'),relationship='lt')
## End(Not run)
#The object x then can be used as one of the inputs to applyParameter function to specify the
#constraints between parameters.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.