Positionsizing from custom backtest procedure


I have used a custom backtest procedure to set my positionsize during the backtest.
However, the positionsize does not seem to get applied.
Is it possible to set positionsize for each bar in the custom backtest phase and how ?

Here is a snippet using mid level cbt, it produces a single trade.

Buy = Sell = Short = Cover = 0 ; 
Buy [0] = 1; 


if (Status("action") == actionPortfolio) 
    bo = GetBacktesterObject();	//  Get backtester object
    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 ) )
            sig.PosSize = 10000; 
        bo.ProcessTradeSignals( i );	//  Process trades at bar (always required)
    bo.PostProcess();	//  Do post-processing (always required)

Also make sure you look at the help for SetPositionSize() so that you understand how position sizes are encoded. The value that you assign to sig.PosSize or specify in the bo.EnterTrade() method must be encoded values.