Hi everyone, I just want to ask a methodological question about optimization. Let's say I have a simple SMA crossover strategy with stoploss and takeprofit implemented. This means that the strategy has 4 different parameters that can be optimized: 1) "Fast" SMA period (an integer) 2) "Slow" SMA period (an integer) 3) Stoploss Distance (either in ticks or %) 4) Takeprofit Distance (ticks/%) If the strategy was without stoploss and takeprofit rules, I could optimize by using the statistic of my choice, and plot it as a surface or heatmap. But, having 4 optimizable parameters prevent the use of surface plots or heatmaps for a "one-look" optimization. I am aware that optimizing several parameters makes the strategy more overfit to historical prices, but 4 parameters does not seem to be many, to me at least. The first solution that I could think of was dividing the parameter list 2 by 2 (fast&slow sma, SL/TP), and do optimization of these groups sequentially. So, I would plot heatmaps of Fast-SMA as x-axis, Slow-SMA as y-axis vs. a objective statistic. After choosing the optimal values for the SMAs, I would again, plot heatmaps or MAE&MFE charts to optimize SL/TP. But this solution might give different results when the groups' optimizations were applied in the reverse order (first the SL/TP and secondly the SMAs). All in all, I wanted to ask you how you optimize strategies with more than 2 variables and also, your thoughts about sequentially optimizing 2-parameter groups? Any comment or criticism is appreciated. Thanks.
ehbeehefak Take this with a pinch of salt, as my memories of "theoretical" optimisation is a bit far, and I have no docs around here. Basically, you want to maximize profits, while minimizing loss. These conditions will give you a sample of smas values. Now you have various "theoretical methods", but I used to like those based on "predictor-corrector" methods. But if you are really into programming with matlab, you can create a linear system, and use one of the algos for such system. But seriously, as you trade - right - why do you want to get into these optimizations of crossover systems????
I've done this for stocks using Excel Solver. EDIT: Sorry, my reply was delayed as it had to wait for moderator approval.
Thank you for the answer, smallStops. I think I may have explained the problem a bit vaguely, as English is not my first language. The problem I'm facing is about optimizing strategies with 3 or more parameters, whether it is a simple SMA crossover, or some crazy-complex strategy, it does not matter. I just used the SMA-crossover as an example. The problem faced with strategies that contain 3 or more parameters is that 3d plots like these (http://www.mathworks.com/matlabcent...tent/html/pairs-trading-sharpe-ratio-plot.png) are not possible, since 3d plots can only convey a results-matrix of 2 different parameters (in the example I gave, it was fast-sma and slow-sma parameters). Like, how would you graphically optimize Fast-sma, Slow-sma and Stoploss in the same plot? I hope I was able to clarify the problem.
Look where you can reduce parameters and do so. Example: substitute moving average crosses with trend speed. How to do that? Lots of ways but you are basically interested in an up or down signal over some lookback period X. Your target and stop params are really just parts of an overall approach which can be separated from the data mining for signals. Include a target and you are mean reversion trading. Remove the target and trail a stop and you are trend following. Use a time stop and you are capturing short term value opportunities. Optimize based on what you are trying to farm to remove as many variables as possible from your analysis.
lso, if I understand well, for each fast -slow sma value, you are running a strategy and extract the sharp ratio, that you plot ? Now you want to also include another variable the stop loss? Am I understanding correctly what you are trying to do?
So, I should decrease my parameters to a total of 2? Like I can create a new parameter like FastSMA period - SlowSMA period = SMAperiodDifference and optimize that? That might enable me to optimize SL or TP as well. Am I on the right path?