- ago
Does anyone have any tips on how to select the best optimizer for a strategy, in general? Say you have a strategy that examines 4 or 5 different indicators, each of which have 2 or 3 Parameters. Is there a way to gauge when you should use Shrinking Window, or Bayesian, or Particle Swarm, etc?

Any general advice would be appreciated. Thanks!
0
1,321
Solved
13 Replies

Reply

Bookmark

Sort
- ago
#1
In order to answer such a question I recently conducted an interesting experiment:
I took the strategy "A Seventeen Liner" by WL veteran gbeltrame and replaced all constants in the strategies code with optimizable parameters:


This are 21 Parameters and an exhaustive optimization would take an impractical number of runs:


I ran various optimizations on 10 years of Dow30 Data. I requested 900 permutations from each optimizer and chose "APR" as Target metric.

Then I copied the "Tabular Results" to Excel, sorted for APR and put all lines in a single graph:


The Y-Axis shows APR in percent, the optimization goal.
The X-Axis shows number of Runs/Permutations.

Under the assumption that the optimzer algorithms try to achieve better and better APR values the curves from left to right show approximately the
path to success from run to run.
3
Best Answer
- ago
#2
The clear winner in such a scenario is the "SMAC" optimizer which reaches good results with 400 to 500 permutations, which is quite remarkable under these circumstances.

Second is "Shrinking Window" closely followed by "Particle Swarm" and "Bayesian".
All three need a significant higher number of permutatiosn to arrive at a parameter combination with results comparable to the "SMAC" optimizer.

Finally, the "Nelder-Mead" optimizer is not very useful in this scenario.
2
- ago
#3
I would choose x100 larger runs number if it helped to avoid curve-fitting.

Do you have OOS results for all these 5 options?
1
- ago
#4
Thank you very very much for this workup. This should definitely be published. And I'm going to have to look deeper into the SMAC algorithm and why it works so much better.

The only question remains, how would these optimizers fair if the number of parameters being optimized was cut in half or something? Would the results be similar or somewhat different?
0
- ago
#5
Another result that is interesting to look at, is what parameters' values do you have as a result of this different optimizers. It may happen they can be very-very far away from each other.

What I want to say is all of this has nothing close to strategy OOS robustness).

Still nice experiment).
0
- ago
#6
Here the same Information as above but this time orderd by "Run Number":

Y-Axis: APR
X-Axis: True Run Number

The SMAC Optimizer needs less than 100 Runs to find good Parameter sets.
The Shrinking Window Optimizer needs about 600 Runs to reach a similar region of good APR values.
4
- ago
#7
Thank you very much Dr. Koch for this study! Very interesting findings that I will now take into account.
0
- ago
#8
Where do I find SMAC and particle swarm optimizers?
0
- ago
#9
It's part of finantic.Optimizers:
https://www.wealth-lab.com/extension/detail/finantic.Optimizer

You can find more extensions developed by third parties in the footer:
https://www.wealth-lab.com/Extension

But look forward to build 4 finantic.Optimizers (to be released together with WL build 18 soon) which fixes a bug.
0
- ago
#10
I just ran SMAC vs shrinking window resulting in even more thoroughly detailed results (down to 6 decimals) and increased my win/loss percentage by 2% along with a quicker optimization time than shrinking window. Thank you for your info above as I plan on using SMAC.
2
- ago
#11
+2% OOS winrate or IS?)
0
- ago
#12
2% better win rate IS based on best OOS walk forward optimized parameters found. Then I also run a monte carlo simulation on trade order scramble to verify timing of the IS before I started live trading the strategy.
0
- ago
#13
DrKoch, would you be able to share with us the Configuration details you used for SMAC in these tests? When increasing the number of iterations, I'm never sure if I should be adjusting the other settings as well, or if it's fine to leave everything at default settings.
0

Reply

Bookmark

Sort