[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Just tried my first simple medium level custom backtest and I have a quick question.


  • Date: Fri, 8 Jan 2010 21:11:35 -0800 (PST)
  • From: Potato Soup <potatosoupz@xxxxxxxxx>
  • Subject: [amibroker] Just tried my first simple medium level custom backtest and I have a quick question.

PureBytes Links

Trading Reference Links



So I took the template code for a backtest from the user knowledge base article. What I don't understand is why it changes the outcome of my trades even though I have no custom code in it. For instance, before inserting the custom backtest code, my AFL creates 30 trades. But with this added, it creates 34 trades, and 2 of them are on the same day.

Why would this following code modify the outcome of an AFL backtest:

SetCustomBacktestProc("");
if (Status("action") == actionPortfolio)
{
    //  Get backtester object
   bo = GetBacktesterObject();   

    // o pre-processing
    bo.PreProcess();
      
    // Loop through all bars
    for (i = 0; i < BarCount; i++)   
   {

        // Loop through all signals at this bar
       for (sig = bo.GetFirstSignal(i); sig; sig = bo.GetNextSignal(i))
       {   
            // Process trades at this bar
            bo.ProcessTradeSignals(i);   
       }   

        // Handle programmed stops at this bar
       bo.HandleStops(i);   

        // Update MAE/MFE stats for bar
       bo.UpdateStats(i, 1);   

        // Update stats at bar's end
       bo.UpdateStats(i, 2);   
   }   

    // Do post-processing
   bo.PostProcess();   
}
///// End of custom backtesting code




__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___