I got the call to look for offsetting in an unbalanced position wrong so the function is not being called in 1n.
This does have the virtue of being harmless, so try the attached on demo to check the code is working properly.
Or, do a search for //Offsetting in Recovery - around line 4800, and copy this over the top of the relevant block of code:
Code: Select all
//Offsetting in Recovery
if (UseOffsettingForBalanceRecovery)
{
//AllowComplexSingleSidedOffsets is the input used in CanTradesBeOffset(), so
//Ssave the user input
bool OldAllowComplex = AllowComplexSingleSidedOffsets;//Save the user input
AllowComplexSingleSidedOffsets = AllowComplexSingleSidedOffsetsRecovery;
CanTradesBeOffset(0);
//Restore the user's input
AllowComplexSingleSidedOffsets = OldAllowComplex;
//In case any trade closures failed
if (ArraySize(ForceCloseTickets) > 0)
{
MopUpTradeClosureFailures();
return;
}//if (ArraySize(ForceCloseTickets) > 0)
}//if (UseOffsettingForBalanceRecovery)