Especially in high frequency trading, you may have a situation where you have a buy limit order @ $100, but a split of the second later, you place a sell limit order @ $100. Your order would cross, and the exchanges complain about that... some brokers as well. How do you deal with this issue? My current approach is via priority stack. Orders to get into the position are always of lower priority comparing to orders to take profit or cut the loss. If self-trading scenario happens.... I prevent it by canceling entry order and going ahead with stop loss or take profit orders.... this seems messy to me... any bright ideas out there?