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

[amibroker] Missing Transaction Date from Detailed Backtest Report



PureBytes Links

Trading Reference Links

When I run the following low level Backtest report (in detail mode)  the
transaction date is not printed. Does anybody know why? Recently someone
else asked a similar question and Tomasz responded to it. For the life
me I can not find that thread. Any help is much appreciated.

SetCustomBacktestProc("");
MaxBuys = 3;
MaxHoldingPer = 14;
MinHoldingPer = 2;
TradeDate = DateTime();
if( Status("action") == actionPortfolio )
{
    bo = GetBacktesterObject();
    bo.PreProcess();
    for( i = 0; i < BarCount; i++ )
   {
   cntBuys = 0;

  // look at new signals AND Exclude signals if they exceed maxBuys
   for( sig = bo.GetFirstSignal(i); sig; sig = bo.GetNextSignal(i) )
   {
   OpenPos = bo.FindOpenPos( sig.Symbol );
  // check for entry signal and long signal
    if( sig.IsEntry() )
    {
     if( cntBuys > MaxBuys )
     {
                 sig.PosSize = 0;
      }
              else if( IsNull(OpenPos))
     {
                 cntBuys = cntBuys + 1;
      bo.EnterTrade( i, sig.Symbol, True, sig.Price, sig.PosSize,
sig.PosScore);
     }
         }
    if( Sig.IsExit() AND OpenPos AND OpenPos.BarsInTrade >=
MinHoldingPer)
     bo.ExitTrade( i, OpenPos.symbol, sig.Price, 1);

   }
   for( OP = bo.GetFirstOpenPos(); OP; OP =bo.GetNextOpenPos() )
   {
    if ( OP.BarsInTrade >= MaxHoldingPer)
    bo.ExitTrade( i, OP.Symbol, OP.GetPrice(i, "C"), 1);
   }
  bo.HandleStops(i);
  bo.UpdateStats(i,1);
  bo.UpdateStats(i,2);
    }
  bo.PostProcess();
}





Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/