Programming with MBT

I’ve been porting an EA to MBT and I’m running into a problem when taking partial profits. When you take partial profit, a new ticket is made. I can’t get the thing to not do this in a normal manner… either it will continually sell and reopen positions till i get to an invalid lot size or just sell half the position… Not sure where the other half goes.

Anyone have experience dealing with MBT and this issue?

LethalXxXDose