If there any way to help on solving this problem?
Usually I do see a catchy price to trade with (and I am not sure how many other people are competing with me for the same order), still I go for placing order and if I am first then I will get my order executed otherwise my order will go "pending". Then I do assume that some other trader took that order and I am not lucky enough. I guess this is how usually all traders do assume and move-on to next best available prices. I mean there is no need to complex things rather than just going with what we have in practice for years.
One probable solution if you still look for addressing it:
It could be solved by being milli-second level of accuracy. Orders are being matched based on first-in, first-served. So, being more accurate in terms of time this could be easily solved. After milli-seconds, you may go for accuracy seeking in nano-second levels.