braverock / quantstrat

289 stars 114 forks source link

Parallelize applyStrategy across symbols using the foreach construct inside apply.paramset #124

Open jaymon0703 opened 4 years ago

jaymon0703 commented 4 years ago

Description

Parallelize applyStrategy using the code in apply.paramsets for multiple symbols, as opposed to just what we are currently doing, which is to parallelize param.combos. The strategy results will not be directly visible in the same portfolio, but if the user sees value in viewing the results individually then the 4-8+ times speed-up in strategy execution should prove valuable especially for testing many symbols at once.

Original motivation for this feature enhancement comes from https://stackoverflow.com/questions/63429617/how-do-i-replace-quantstrat-for-loop-with-mclapply-parallelized/63451991#63451991 and subsequent discussions with @braverock.

Expected behavior

Execute applyStrategy in parallel, using the foreach construct in apply.paramset().