hitbtc-com / hitbtc-api

HitBTC API
GNU Lesser General Public License v3.0
322 stars 152 forks source link

Create new order with type='stopLimit' returns 'code': 2022, 'message': 'Bad price' #241

Closed maxreis86 closed 4 years ago

maxreis86 commented 4 years ago

Hi guys,

I am trying to place a stopLimit order using the code below, but I got the error 'Bad price'. Everything was working perfectly and the error started this mornning with exacectely the same code. Something has been changed in the rest api. Can anyone help me please?

Python code:

import requests orderData = {'symbol':'BTCUSD', 'side': 'buy', 'type': 'stopLimit', 'quantity': '0.002', 'price': '8317.18', 'stopPrice': '8317.18'} r = requests.post('https://api.hitbtc.com/api/2/order', data = orderData, auth=('yyyy', 'xxxx')) print(r.json())

ERROR: {'error': {'code': 2022, 'message': 'Bad price'}}

Thank you guys!!

svanas commented 4 years ago

Confirmed. I am seeing the same error as a response to https://api.hitbtc.com/api/2/order trying to place a stop-loss order. Both stopLimit and stopMarket seem to be having this problem.

svanas commented 4 years ago

Docs tell us about 2022/Bad price: "See more details in error description field"

{"error":{"code":2022,"message":"Bad price"}}

Right.

hitbtc-com commented 4 years ago

Thank you, for your bug report. Bug is fixed.

svanas commented 4 years ago

@hitbtc-com when will you deploy the fix? we are still receiving Bad price errors (or Price is not a valid number when we place a stopMarket order without a price)

hitbtc-com commented 4 years ago

Now really fixed. Thanks for the detailed bug report.