python-binance
python-binance copied to clipboard
Unable to get a FULL response from create an order
Describe the bug I create an order via client.create_order() with the parameter newOrderRespType = 'FULL', but the result or when I get the order via client.get_all_orders() the order structure is 'RESULT'
To Reproduce resultSell = client.create_order(symbol='BTCUSDT', side='SELL', type='LIMIT', timeInForce='GTC', quantity=QUANTITY, price=PRICE, newClientOrderId = persoOrderId, newOrderRespType = 'FULL') // result is : {'symbol': 'BTCUSDT', 'orderId': XXXX, 'orderListId': -1, 'clientOrderId': 'XXXX', 'price': 'XXXX', 'origQty': 'XXXX', 'executedQty': 'XXXX', 'cummulativeQuoteQty': 'XXXX', 'status': 'FILLED', 'timeInForce': 'GTC', 'type': 'LIMIT', 'side': 'BUY', 'stopPrice': 'XXXX', 'icebergQty': 'XXXX', 'time': XXXX, 'updateTime': XXXX, 'isWorking': True, 'origQuoteOrderQty': 'XXXX'}
Expected behavior So the issue is that i don't get the array 'fills' which contain the commission price/asset;
Environment (please complete the following information):
- Python version: 3.6.1
- OS: Mac / Ubuntu
- python-binance version 0.7.5
@Bamorem I have reading the source code, I found the request client.create_order() is a plain post to binance API service. you can use curl to reproduce the result, see the different.
Hi @xiaods , yes i did create an order with curl and I see that it get's the fills parameters.
Is python-binance use the v3 by default or maybe i need to specify somewhere ?
I snippet from python-binance source code.
PUBLIC_API_VERSION = 'v1'
PRIVATE_API_VERSION = 'v3'
WITHDRAW_API_VERSION = 'v3'
MARGIN_API_VERSION = 'v1'
FUTURES_API_VERSION = 'v1'
@xiaods, just tested again and yes the create.order return me the fills parameter, but when i do a get order from the orderId once it has been FILLED I don't get the fills parameter anymore... is the fills param only of not completed orders ?
@Bamorem I think you need carefully compare the binance api result json. it is not python-binance's bug anymore I think so.
Hey guys, came across this string and I cannot get any response from an order let alone 'FULL'. I can't seem to find an example in the docs. What am i not grasping? If i print lmt_order i just get an empty dictionary. Any help appreciated!
lmt_order = client.create_test_order( symbol = 'BTCUSDT', side = 'BUY', type = 'LIMIT', timeInForce = 'GTC', quantity = foo, price = bar, newOrderRespType = 'FULL' )
Hey guys, came across this string and I cannot get any response from an order let alone 'FULL'. I can't seem to find an example in the docs. What am i not grasping? If i print lmt_order i just get an empty dictionary. Any help appreciated!
lmt_order = client.create_test_order( symbol = 'BTCUSDT', side = 'BUY', type = 'LIMIT', timeInForce = 'GTC', quantity = foo, price = bar, newOrderRespType = 'FULL' )
Upon further troubleshooting, the python-binance uses the requests library in case anyone finds this useful. print(client.response.json())
Hey guys, came across this string and I cannot get any response from an order let alone 'FULL'. I can't seem to find an example in the docs. What am i not grasping? If i print lmt_order i just get an empty dictionary. Any help appreciated!
lmt_order = client.create_test_order( symbol = 'BTCUSDT', side = 'BUY', type = 'LIMIT', timeInForce = 'GTC', quantity = foo, price = bar, newOrderRespType = 'FULL' )
Upon further troubleshooting, the python-binance uses the requests library in case anyone finds this useful. print(client.response.json())
You saved my life man! 4 hours of googling just to find your answer that FINALLY shows how to fking print the response to work with it further. Some of us want to save the order data into database guys at python-binance.
PLEASE add the response handling code into the official read-me