@cadmufasa, I am unfamiliar with the API but familiar with trading jargon etc.
I see your question was unanswered, so figured I would offer a little input which you can maybe use to get yourself farther along. I may have misunderstood your question. If so, I apologize.
I believe your misunderstanding has to do with the intention of a buy_stop order.
One handy trick to remember this is “STOP” is used to stop losses, not gains. So, if you are long, a stop loss will be a sell order BELOW where the market is. If you are short, a buy stop, will be above where the market is. “stopping” the bleeding.
So, you are trying to enter a buy_stop order and your “stop” price is being entered below the market. If that is the case, then the system will think, “oh no,” the market has risen above his stop price and he wants to “stop” the losses so we need to buy immediately.
I’m hoping that is sufficiently helpful. If you get that, then the next piece of the puzzle is the “limit” this has to do with the concept of “limiting” the market’s insanity. You just told the system, to buy the asset at any price above my stop order (in the case of a buy stop, or to sell at any price below my stop order). Well what if it is weird market and gaps down/up. It would be nice to “limit” the price that the buy/sell order is able to execute at. So, to use your example, you may want to buy if BTC crosses above 9407 but you are not willing to pay a penny higher than 9410 for example. If the price goes immediately through 9410 and other’s orders were in front of you, you won’t buy until it drops back below 9410.
Your order had a limit price below the buy stop which is actually fine, but kind of unorthodox. One way I taught myself to remember it for the regulatory exams was that BSL was on an upward ascending escalator and SSL was on a descending escalator. By that I mean, Current price < Buy_Stop price < Buy_Stop_Limit Price. and vice versa, Current Price > Sell_stop_price < Sell_stop_limit price.
Again, I don’t think you had a coding problem, just regular old order misunderstanding. Hopefully this was helpful.