<< <%SKIN-STRTRANS-SYNTOC%> >> Navigation: Video Tutorial > Strategy Optimization |
In this tutorial, I'm going to show you how to create "inputs" and how to optimize the breakout system we created in the previous video.
The first input should obviously be the time when pending orders are placed. Edit condition...
and check the checkbox with the title "Add to inputs".
Add new input...
we will leave the suggested name...
and it appears in the list of appropriate inputs.
The number 10 has been replaced by the input name in violet.
Do the same with all other conditions that include the time of the day.
The input has already been created.
The next input we want to optimize is the Take Profit in Pips.
Add to inputs...
Add New Input...
and replace the suggested name.
Click OK three times. The Take Profit value has been replaced by a variable name.
The other conditions will be replaced quickly by clicking on the magic button.
And the last input we want to optimize is the Trailing Stop.
The number of bars determines how often the Stop Loss is moved. Add to inputs...
Add new input...
we will replace the suggested name with a more suitable one.
And the same for short positions.
Copy the source, replace the old source and compile it.
In the Strategy Tester, check Optimization.
In Expert Properties, we will set up optimization. Uncheck Genetic algorithm (if checked). If you have more parameters, I recommend you use genetic optimization, because it will be much faster.
In Inputs, we will choose some reasonable testing intervals.
The Time Hour will be tested with step 1 from 0 to 23.
The Take Profit in Pips will be tested with step 20 from 20 to 500.
The Stop Loss Interval will be tested with step 1 from 1 bar to 20 bars.
Choose an optimization date interval of at least a few years...
and start optimization. Depending on the number of parameters and intervals, optimization can take quite a while... from a few minutes up to millions of years.
As seen in the optimization graph, the various profitable parameter sets are concentrated around the Time Hour value of 20 o'clock. It is the darkest area.
I recommend you sort the optimization results by the drawdown percentage.
We are looking for a system with a stable equity. For example, a good set-up might be 20 o'clock, 200 pips, moving Stop Loss every single bar (double-click on the row).
These are the basics of system development, demonstrated on a simple system that can be improved. You can also experiment with different exit strategies, such as using the Average True Range indicator instead of the number of pips, and so on. This breakout system is also great for trading the news. It places two pending orders just before the news is released and catches the breakout on the long or short side.