如何在quantStrat中应用long only add.distribution参数集-param.combo[[param.label]]中的simpleError
我正在应用与luxor演示中类似的添加分配规则,而我的策略只有很长的位置 整个策略都是有效的,但当应用参数集时,我会出现以下错误: TakeProfit长47 0.047 取profitlong 47 0.047计算表达式的结果: 参数组合[[param.label]]中的simpleError:下标超出范围 已获取任务47的结果numvalue:47,numResults:47,stopped:FALSE 返回状态错误评估#48:$param.combo 我试图根据简单的takeProfit规则进行分配(从stopLoss或trailingStop获得相同的结果): 并应用该集合:如何在quantStrat中应用long only add.distribution参数集-param.combo[[param.label]]中的simpleError,r,quantstrat,R,Quantstrat,我正在应用与luxor演示中类似的添加分配规则,而我的策略只有很长的位置 整个策略都是有效的,但当应用参数集时,我会出现以下错误: TakeProfit长47 0.047 取profitlong 47 0.047计算表达式的结果: 参数组合[[param.label]]中的simpleError:下标超出范围 已获取任务47的结果numvalue:47,numResults:47,stopped:FALSE 返回状态错误评估#48:$param.combo 我试图根据简单的takeProfit规
results <- apply.paramset(strategy.st, paramset.label='TakeProfit', portfolio.st=portfolio.st, account.st=account.st, nsamples=.nsamples, verbose=TRUE)
这是与相同的错误。它是固定的“信号”组件类型,但不是“链”。现在应该从开始修复它。这看起来类似于。请将
sessionInfo()
的输出添加到您的问题中。你好,Joshua。感谢您的回复,它似乎与bug有关,尽管我没有得到任何带有单个参数的有效输出-只是问题标题中的“simpleError”消息。使用两个参数似乎效果不错。我非常专注于至少运行一个参数,所以我从未想过用两个参数完全复制这个示例。刚刚更新到1669版,对于单个参数来说效果非常好。非常感谢您的更新/修复@艾伦:很高兴能帮忙。谢谢你的报道!
add.distribution(strategy.st,
paramset.label = 'TakeProfit',
component.type = 'chain',
component.label = 'TakeProfitLONG',
variable = list(threshold = .TakeProfit),
label = 'TakeProfitLONG'
)
results <- apply.paramset(strategy.st, paramset.label='TakeProfit', portfolio.st=portfolio.st, account.st=account.st, nsamples=.nsamples, verbose=TRUE)
results <- fe %dopar% { ... }
install.param.combo <- function(strategy, param.combo, paramset.label)
R version 3.1.2 (2014-10-31)
Platform: i486-pc-linux-gnu (32-bit)
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lattice_0.20-29 iterators_1.0.7 downloader_0.3
[4] quantstrat_0.9.1665 foreach_1.4.2 blotter_0.9.1644
[7] PerformanceAnalytics_1.4.3574 FinancialInstrument_1.2.0 quantmod_0.4-3
[11] TTR_0.22-0.1 xts_0.9-7 zoo_1.7-12
loaded via a namespace (and not attached):
[1] codetools_0.2-9 compiler_3.1.2 digest_0.6.7 grid_3.1.2 tools_3.1.2