Can we plot signals from manual trades that was coded in CBT mode?

I’m trying to get a trade that’s coded in CBT such as bo.entertrade, exittrade, scaletrade to a chart but the plot function didn’t work — Or I might do something wrong. (Signals aren’t generated from AFL in 1st pass). Is it possible and how to do it?

And question no.2 is how can I see or control amibroker to show all of these manually traded in a tradelist?

Thank you very much in advance. :smiley:

You could plot them if you placed them in Static variable (in the custom backtest code) and later, in your chart, you use PlotShapes(). Something along these lines:

// your CBT code
if( Status( "action" ) == actionPortfolio )
    ...  your CBT .....

    for( i = 0; i < BarCount; i ++ )
        if( ...your buy ... )
            b[ i ] = 1;

        if( ...your sell.. )
            s[ i ] = 1;

    StaticVarSet( "xtrabuy", b );
    StaticVarSet( "xtrasell", s );

// your indicator
PlotShapes( shapeUpArrow * StaticVarGet("xtrabuy"), colorGreen );
PlotShapes( shapeDownArrow * StaticVarGet("xtrasell"), colorRed );

Thank you Tomasz :slight_smile: