[Help please] Pyramiding, Multiple Positions of the same symbol and AllowSameBarExit

Dear Support,
Please allow a quick question.

I am back-testing a system that buy at Open and Sell, and Close, and AllowSameBarExit, and 4 open positions, with EOD data.

I have:
SetOption(“InitialEquity”,1000000 );
SetBacktestMode( backtestRegularRawMulti );

Buy= REF(O>1.001 * C,-1);
Sell = O * 1.001>C;

SetPositionSize( 50, spsShares );
SetPositionSize( 100, spsPercentOfPosition * ( buy == sigScaleOut ) );

It is strange that it does not sell the 4th open position at close when the 4th position is created on the same bar at open. Instead, the detailed log shows:
“Exit ignored because signal predates already processed event”. As a result of this, the system will only sell the 4th open position when the next Sell signal occurs.

I know the message simply means I cannot time travel. Please kindly suggest a workaround to handle such a situation.

Thank you very much and Merry Christmas.


Dear All,
Given the following buy and sell signals.
Day Buy Sell
1 1 0
2 1 0
3 1 1
With the following settings (allowing three open positions of the current symbol):
SetOption(“AllowSameBarExit”, True );
SetBacktestMode( backtestRegularRawMulti );
SetPositionSize(10, spsShares);

The buy order of Day#3 cannot be closed on the same day. I know this is the time travel problem, but is there a workaround code to close the third order on the same bar?

Thank you so much in advance.