Skip to content
Prev 13805 / 15274 Next

Optimizing Quanstrat MACD with apply.paramset returns combine error

OK, I figured this out.

The component.label argument in the add.distribution function needs to
match the labelargument from add.indicator. So in this particular
case, I changed my add.indicator to:

add.indicator(strategy.name, name = "MACD", arguments =
list(x=quote(Cl(mktdata))), label='MACD')

And then changed my add.distribution to:

add.distribution(strategy.name,
                 paramset.label = 'optEMA',
                 component.type = 'indicator',
                 component.label = 'MACD',
                 variable = list(nFast = 60:80),
                 label = 'NFAST')

add.distribution(strategy.name,
                 paramset.label = 'optEMA',
                 component.type = 'indicator',
                 component.label = 'MACD',
                 variable = list(nSlow = 180:200),
                 label = 'NSLOW')

Now, it runs. So the lesson learned for me is: pay attention to
parameter names/labels (especially if you copy-paste from an example
like I did).
On Tue, Mar 22, 2016 at 5:21 PM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote: