Hi, I am trying to place an order market type. I am using node-binance-api.
The function I am using need several parameter such as the market crypto price, and the quantity. I estimate the quantity by dividing the my current balance over the market price. But I am keep getting an error. Please, any help, it’s greatly appreciated!
binance.prices(function (error, ticker) {
var price = ticker.BNBBTC;
Getting list of current balances
binance.balance(function (error, balances) {
//console.log("balances()", balances);
if (typeof balances.ETH !== "undefined") {
var CurBala = balances.ETH.available;
var quantity=CurBala/price;
//binance.buy(symbol, quantity, price, type);
binance.buy("ETHBTC", quantity, price, "MARKET")
} }
});
Could you please give me more details, I really appreciate your help!
1. There’s a function called marketBuy: is this function exist in node-binance-api package or where? Could you guide me to a resource explain this function?
2.----
3. Need to pay attention to decimal part since you use divide to get your qty: sorry I am not sure how I need to pay attention to that?
Need to pay attention to decimal part since you use divide to get your qty: sorry I am not sure how I need to pay attention to that? - For e.g., if the quantity is 1.001 after dividing but if that trading pair can only allow two digit decimal, this’d be rejected. You can get the details from /api/v3/exchangeInfo regarding the step size.