I'm trying to create a simple scalping bot for horse racing but the problem I'm having is that sometimes it will fire 2 lays into the market at the same time.
I've tried the following
It's a simple bot trying to place an offset with greening, fill or kill bet
Set unmatched bets on selection to 0
Time since active fill or kill >1 seconds on selection
Matched bet amounts - The selections total amount of bet backs is equal to the selections total amount of lay bets
But still, it keeps firing 2 bets on the same selection at the same time, it even does this if I have an unmatched back bet up!
It will also fire single lay bets into the market when I have an unmatched back open.
This is not a 100% occurrence but it happens enough to frustrate me
I've studied the logs and just can't understand what is happening

I've tried so many different settings but still can't stop it happening
So yeah, the basic problem is the bot keeps firing lay bets into the market even if I have an unmatched back bet open and sometimes fires 2 lay bets in at the same time.
This is pre race