node-binance-api
node-binance-api copied to clipboard
Market Buy using Total instead of Amount (or Quantity)
As the title mentions, how do I place a buy order using the Total Instead of mentioning the Quantity. Please see screenshot below for reference.
The documentation does not have an example of this type of order.
Hello,
This is done by the parameter quoteOrderQty
of the endpoint POST /api/v3/order
(see documentation here : https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#new-order--trade).
But looks like this is not implemented yet (see node-binance-api.js:366
).
Hello, This is done by the parameter
quoteOrderQty
of the endpointPOST /api/v3/order
(see documentation here : https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#new-order--trade).But looks like this is not implemented yet (see
node-binance-api.js:366
).
Yes, I saw that. ended up using this library: https://github.com/Ashlar/binance-api-node
Hello, This is done by the parameter
quoteOrderQty
of the endpointPOST /api/v3/order
(see documentation here : https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#new-order--trade).But looks like this is not implemented yet (see
node-binance-api.js:366
).
@jaggedsoft will this be implemented soon?
@cheezeburger Add this in the order function.
if (opt.type == 'MARKET' && typeof flags.quoteOrderQty !== 'undefined') {
opt.quoteOrderQty = flags.quoteOrderQty
delete opt.quantity;
}
quoteOrderQty didn't implemented to Futures APi on Binance side, so we have to wait to implement on them.
PS: https://dev.binance.vision/t/is-there-a-plan-to-introduce-quoteorderqty-option-in-margin-and-futures-market-orders/742/7
How do I structure the query for a market buy using quoteorderQty? Ive tried every combination I can think of but keep getting "{"code":-1104,"msg":"Not all sent parameters were read; errors
unfortunately it's still not implemented on Binance API yet
I thought the snippet shown by shivchawla above, and has been added to my code resolved it?
EDIT: I managed to solve it, in case anyone else is looking for it, this is the required syntax -
binance.marketBuy("BTCUSDT", quantity, {type:'MARKET', quoteOrderQty: amount}, function(error, response) { console.info("Market Buy response", response); console.info("order id: " + response.orderId); });
quantity needs to be input, however it is ignored by the query
@Lippa73 Its giving me undefined
response. Are you sure its working for node-binance-api
?