BTCMarkets / API

API
119 stars 30 forks source link

Price is outside of market range #82

Closed caleb-vear closed 6 years ago

caleb-vear commented 6 years ago

From time to time I've been trying to submit an order to buy or sell and gotten an error back with code 3 and the message Price is outside of market range.

I'm a little unsure why this is as when I check the order book there are orders on the opposite side with the same price I'm using.

For example earlier today I was trying to place a Limit ASK on BTC/AUD with the price set to 20602.06 but I was rejected with the Price is outside of market range error. I was finally able to submit the same order with the price set to 20637 instead. That doesn't seem to be a very big difference so I'm wondering how I can calculate what price will be considered outside the market range.

longzheng commented 6 years ago

+1 also experiencing this issue.

I was also seeing the Price is outside of market range for a limit ASK when there are already orders with a lower price. I was able to successfully submit the same order manually using the web interface.

wsdefghjk-23124 commented 6 years ago

+1 getting this lately.

piotrszul commented 6 years ago

+1 seems to happen as @longzheng wrote , when the ASK limit is below the highest BID.
But it's a valid and a useful order and can be submitted from the web interface. Could you please fix? Or is the Market order type supposed to be used in this case - but will it stop at the provided price?

wsdefghjk-23124 commented 6 years ago

So i went trough my logs and here is more information (unsure if this is still happening as I modified the my code to only use 'market' so orders will go through).

I have received the error Price is outside of market range for ASK orders that are within the range of [bestBid:bestAsk], for example:

Type Price bestBid bestAsk
limit 21015.42 20900.01 21015.43
limit 21499.99 21402.91 21500.00
meeeee12 commented 6 years ago

+1 for this issue.

justin-ngin commented 6 years ago

Hi all,

A fix for this was deployed over the weekend. Please feel free to reopen and let us know if you start receiving the error again, but for now I'm going to close this issue.

Thanks & regards, Justin