Open waileong94 opened 6 years ago
@waileong94 is there a reason you are using the older snow
and registerDoSNOW
rather than the newer parallel
and doParallel
package with registerDoParallel
?
If I use the parallel
package, things run as expected for me:
> registerDoParallel()
> resultsopt <- apply.paramset(strategy.st,
+ paramset.label = "forestopt",
+ portfolio.st = portfolio.st,
+ account.st = account.st,
+ nsamples = 0)
> resultsopt$tradeStats
myForestOptLabel Portfolio Symbol Num.Txns Num.Trades Net.Trading.PL Avg.Trade.PL Med.Trade.PL Largest.Winner Largest.Loser Gross.Profits Gross.Losses
1 8 Luxor.Opt.1 AAPL 113 56 2650885.5 47123.955 -34500.75 1405999 -1133001 13463971 -10825029
2 10 Luxor.Opt.2 AAPL 121 60 -31124.3 -2701.052 -52500.75 1405999 -1133001 12520972 -12683035
3 12 Luxor.Opt.3 AAPL 147 73 3143859.3 43656.611 -46000.10 2188999 -1047001 16946972 -13760039
Std.Dev.Trade.PL Std.Err.Trade.PL Percent.Positive Percent.Negative Profit.Factor Avg.Win.Trade Med.Win.Trade Avg.Losing.Trade Med.Losing.Trade
1 559261.7 74734.49 44.64286 55.35714 1.2437815 538558.8 513998.9 -349194.5 -239001.0
2 553068.9 71400.88 41.66667 58.33333 0.9872221 500838.9 386998.5 -362372.4 -259001.4
3 596202.7 69780.25 43.83562 56.16438 1.2316078 529592.9 309999.6 -335610.7 -308000.4
Avg.Daily.PL Med.Daily.PL Std.Dev.Daily.PL Std.Err.Daily.PL Ann.Sharpe Max.Drawdown Profit.To.Max.Draw Avg.WinLoss.Ratio Med.WinLoss.Ratio Max.Equity
1 47123.955 -34500.75 559261.7 74734.49 1.33760201 -2675006 0.990982974 1.542289 2.150614 4271893
2 -2701.052 -52500.75 553068.9 71400.88 -0.07752717 -3152090 -0.009874178 1.382111 1.494195 1351885
3 43656.611 -46000.10 596202.7 69780.25 1.16240196 -3182097 0.987983397 1.577998 1.006491 3546860
Min.Equity End.Equity
1 -1122012 2650885.5
2 -1808107 -31124.3
3 -2196121 3143859.3
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.10
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel graphics grDevices utils datasets stats methods base
other attached packages:
[1] doParallel_1.0.11 iterators_1.0.9 pander_0.6.1 knitr_1.20 quantstrat_0.14.3
[6] foreach_1.4.4 blotter_0.14.2 PerformanceAnalytics_1.5.2 FinancialInstrument_1.3.1 quantmod_0.4-13
[11] TTR_0.23-3 xts_0.10-2 zoo_1.8-1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 quadprog_1.5-5 lattice_0.20-35 codetools_0.2-15 digest_0.6.15 MASS_7.3-49 grid_3.4.4 curl_3.2 boot_1.3-20
[10] tools_3.4.4 yaml_2.1.19 compiler_3.4.4
It works now with doparallel and without makecluster in Ubuntu, but i still couldn't get it working in windows.
You'll need to be more specific about what error you're seeing. It works for me in Windows.
hi @waileong94 can you please confirm if this is working for you when using latest version of quantstrat, v0.16.1? keen to close this issue if it is. thanks!
I am having problem with running apply.paramset with doParallel/doSnow, i have tried it in Windows 10 and Linux. Reproducible example as follow:
This is the result run in sequentiel(without having registerDoSnow):
where as the following are the results with registerDoSNOW:
SessionInfo