About open positions?

SetOption("UseCustomBacktestProc", True );

barDates = DateTime();

if( Status("action") == actionPortfolio ) 
{ 
   bo = GetBacktesterObject(); 
   bo.PreProcess(); 

   for( bar = 0; bar < BarCount; bar++ ) 
   {
    barDate = barDates[bar];
     OpenPos = "";
     OpenPosCnt = 0;
     for( pos = bo.GetFirstOpenPos(); pos; pos = bo.GetNextOpenPos() ) 
      {
       OpenPos += pos.Symbol + ",";
       OpenPosCnt++;
      }
      _TRACE( NumToStr(barDate, formatDateTime) + " OpenPos( " + OpenPosCnt + " 
):" + OpenPos );
      
      
    bo.ProcessTradeSignals( bar ); 
    } 
    bo.PostProcess(); 
}

--- In [email protected], "raskoks" <rask...@...> wrote:
>
> Hi,
> I wonder how to use 
> bo = GetBacktesterObject();
> and maybe loop like this:
> 
>  for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() ) 
>      { 
>           // trade variable now holds Trade object
> 
>      }
> 
> Too find information about current bactester position.
> I need to know for every bar information about position (long,short) because 
> some signals shoud be use only when i have long and some for shorts.
> Maybe someone can help mi with this kind of problem.
> 
> Best regards
> raskoks
>


Reply via email to