Show Arrows for Actual Trades ignoring CBT

Signals filtered out in CBT still appear on chart as Actual Trades:

image

SetOption ("AllowSameBarExit" , False ) ;
Sell = Short = Cover  = 0 ;
buy = 1;
ApplyStop( stopTypeNBar, stopModeBars, 10, True );

PositionSize = 10000;

SetCustomBacktestProc( "" );
if( Status( "action" ) == actionPortfolio )
{
    bo = GetBacktesterObject();
    bo.PreProcess();	//  Do pre-processing (always required)

    for ( i = 0; i < BarCount; i++)	//  Loop through all bars
    {
        for (sig = bo.GetFirstSignal( i ); sig; sig = bo.GetNextSignal( i ) )
        {	
            pos = bo.FindOpenPos ( sig.Symbol ) ;
            if ( pos ) 
            sig.Price = -1; 
        }	
        
        bo.ProcessTradeSignals( i );	//  Process trades at bar (always required)
    }	  

       
    bo.PostProcess();	//  Do post-processing (always required)

}

What "show arrows for actual trades" does is running Equity(1) - i.e. single security backtester to evaluate trades. Therefore it does not reflect your CBT / portfolio coding. Only "Show current trade arrows" shows CBT trades.

3 Likes

Does this also apply when using SetBacktestMode( backtestRotational ) ?

Because current trade arrows are the only ones I can get to appear from a rotational backtest.

Sorry to restart an old topic. But I have been searching for answers.

What I said and what you said is pretty much the same.