I just added some optimization code to the Backtest and increased the Initial capital to $100,000. And then ran the Amibroker Optimizer.
// trade stops
ApplyStop(stopTypeLoss, stopModePercent, Optimize( "max. loss stop level", 5, 2, 30, 1 ), True );
ApplyStop(stopTypeProfit, stopModePercent, Optimize( "max. profit stop level", 10, 2, 30, 1 ), True );
This code instructs the backtester to run an individual backtest for stop loss % levels from 2% to 30% in increments of 1%. and to do the same for the profit stop %'s. It runs a backtest for each combination. In the end a total of 840 portfolio backtests. The optimizer backtest took 227.89 seconds ( 3.8 minutes ). It turns out that the optimum settings are stop loss% = 27% and profit stop% = 8%.
A 3D plot of the CAR/MDD vs the profit% and stop% is shown below. The best thing about these plots is that you can see how the results drop dramatically from the optimum level with small changes in the settings, and specifically the profit stop level in this case. This suggests that even though the system would potentially be profitable you wouldn't expect it to be very stable.
This is good stuff Sci! I haven't played around with this functionality before, but I think I'm hooked now. So easy and so powerful. I'm looking forward to testing some real systems now.
- Forums
- Charts
- Systems
I just added some optimization code to the Backtest and...
-
-
- There are more pages in this discussion • 5 more messages in this thread...
You’re viewing a single post only. To view the entire thread just sign in or Join Now (FREE)
Featured News
Add XTO (ASX) to my watchlist
(20min delay)
|
|||||
Last
7,143.1 |
Change
41.600(0.59%) |
Mkt cap ! n/a |
Open | High | Low |
7,101.5 | 7,159.7 | 7,101.5 |
Featured News
XTO (ASX) Chart |