I'm building an automated betting application in which the user configures price thresholds on a market trigger.
Currently, some of the orders are being matched at prices much higher than the price requested due to the Best Execution feature. The desired behaviour would be for these orders to lapse as they are out of the user-specified bounds.
I thought that submitting a fill or kill order as well as the user turning off the Best Execution feature would fix this, but so far I'm seeing inconsistent results when submitting a back order with a requested price lower than the best available odds.
Sometimes the order lapses as expected, with a "BET_LAPSED_PRICE_IMPROVEMENT_TOO_LARGE" errorCode
Sometimes the order is successful and matches with the higher price, despite the best execution feature being disabled.
Does anyone have any advice on how I might achieve the desired behaviour?
Currently, some of the orders are being matched at prices much higher than the price requested due to the Best Execution feature. The desired behaviour would be for these orders to lapse as they are out of the user-specified bounds.
I thought that submitting a fill or kill order as well as the user turning off the Best Execution feature would fix this, but so far I'm seeing inconsistent results when submitting a back order with a requested price lower than the best available odds.
Sometimes the order lapses as expected, with a "BET_LAPSED_PRICE_IMPROVEMENT_TOO_LARGE" errorCode
Sometimes the order is successful and matches with the higher price, despite the best execution feature being disabled.
Does anyone have any advice on how I might achieve the desired behaviour?

