-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tradeGraphs will not render if more than two optimizing parameters are in a strategy #136
Comments
Hi @QuantDevHacks. So whats happening here, is reshape2::recast calls dcast() which calls cast(), both of which have My thinking at this point is to add a fun.aggregate=sum argument to our call to reshape2::recast. It works, so i will push the change shortly, and bump the version one minor increment. EDIT - on second thoughts...fun.aggregate=sum might not make sense for a statistic such as "Profit.To.Max.Draw", so passing it to the tradeGraphs() function definition might be necessary...since in some cases sum() makes sense, and in others perhaps mean() or median() makes more sense... |
Ok tested my change locally...this is the output... Would you mind testing @QuantDevHacks? The code to install the version with the last commit is The code i ran for the call to the newly defined tradeGraphs function is below... tradeGraphs(stats = results$tradeStats,
free.params = c("macd.sig","macd.fast"),
statistics = c("Profit.To.Max.Draw"),
fun.aggregate=mean) |
Apologies...i am too quick to type today...i think the optimal solution here is to not use recast() as we do not want any aggregating...this will require a bit more work... |
In the spirit of typing too fast, i think we do need to aggregate where there are duplicate column combinations...for example there are multiple observations in which macd.fast and macd.sig are equivalent...so how would we like to present that information...presumably mean or median makes sense. |
Ok @QuantDevHacks i have updated the default to use the Using your original example, please note you can benefit from parallel computation for the param search if you add the below 2 lines: library(doParallel)
registerDoParallel() And because we set the default to tradeGraphs(stats = results$tradeStats,
free.params = c("macd.sig","macd.fast"),
statistics = c("Profit.To.Max.Draw")) Appreciate your feedback. EDIT: With your permission i may add your example as a demo... |
Description
Ran a simple optimization of an MACD example using
apply.paramset(.)
, with three paramsets: Fast MA, Slow MA, and Signal MA. When finished, I tried usingtradeGraphs(.)
on pairs of paramsets, but this results in an error sayingAggregation function missing: defaulting to length
, and a plot showing a plane in the parameter space.quantstrat version is 0.16.9.
Remark: I have verified that I can generate plots from
tradeGraphs(.)
in cases where there are exactly two paramsets in the model.Expected behavior
Expected to be able to view plots of performance measures vs two paramsets chosen from the three that are used in the optimization.
Minimal, reproducible example
Session Info
The text was updated successfully, but these errors were encountered: