r - 158 Symbols in Quantstrat; No trades -


i've tested code against individual symbols , small groups of symbols. i'm finding more symbols add fewer trades get. instance, if include first 5 symbols, of them seem have @ least 1 trade. if expand 20 or few symbols have trades none of symbols in first group have trades anymore.

i'm looking execute strategy on list of 158 symbols.

i've added parallel package. not seem help. i'm using guy yollin's luxor (macd) example.

my initial applystrategy was:

out <- applystrategy(strategy=strategy.st,                     portfolios=portfolio.st,                     parameters=list(nfast=fastma,                                     nslow=slowma,                                     nsig=signalma,                                     matype=matype),                     debug=true,                     verbose=true) 

the above returns no errors, no trades either (again, tested on smaller samples trades).

my attempt foreach/parallel package was:

foreach (i=1:length(symbols)) %dopar%   out <- applystrategy(strategy=strategy.st,                     portfolios=portfolio.st,                     parameters=list(nfast=fastma,                                     nslow=slowma,                                     nsig=signalma,                                     matype=matype),                     symbols=c(symbols[i]),                     debug=true,                     verbose=true) 

this piece of code returns following error:

error in foreach(i = 1:length(symbols)) %dopar% out <- applystrategy(strategy = strategy.st, : target of assignment expands non-language object

so, naturally i'm @ loss. can symbols individually (did yesterday) took forever , know can simpler.

sample script uploaded dropbox

any advice appreciated!


Comments