Limit positon size how to?

my bot keeps increasing on the long side i only want it to hold upto 1 long and 1 short position at a time it bought up 10 8 shares over the course of 1 min how do i fix this i have
// Remove surplus trade signals to have less rows in Scan and Exploration
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

and i am still getting surplus trade signals i need to know how to fix
here is the line i used for the signal it bought 13 contracts and sold 1 in 1 min
// 2. This variant shows all generated BTO signals.
//C2TradingSignal(sigBTO, sigfilter = Buy,amount=1,TypeOfSymbol =InstrmntFuture);
//C2TradingSignal(sigSTO, sigfilter = Short,amount=1,TypeOfSymbol =InstrmntFuture);
// C2TradingSignal(sigBTC, sigfilter = Cover,amount=1,TypeOfSymbol =InstrmntFuture);
//C2TradingSignal(sigSTC, sigfilter = Sell,Amount=1,TypeOfSymbol =InstrmntFuture);