XTO 0.59% 7,143.1 s&p/asx 100

I just added some optimization code to the Backtest and...

  1. 883 Posts.
    lightbulb Created with Sketch. 1048
    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.


    https://hotcopper.com.au/data/attachments/1410/1410689-8ff3ac22206db472b08daef86e6e51bc.jpg


    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.


 
watchlist Created with Sketch. Add XTO (ASX) to my watchlist
arrow-down-2 Created with Sketch. arrow-down-2 Created with Sketch.