-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
market orders aren't working #2
Comments
Thank you for the report! I have verified it works with the following code: const binance = require('node-binance-api');
binance.options({
'APIKEY':'key',
'APISECRET':'secret'
});
//Placing a MARKET order
var symbol = "BNBBTC", quantity = 1;
binance.buy(symbol, quantity, 0, {type:"MARKET"}); |
great thanks! nice work on all this btw.
while i have your ear, could i make a feature request? (forgive me if this
is implemented and I'm being an idiot, also possible.)
i want to be able to trigger a second order after an order is completed,
but as far as i can tell, i can't make use of the json response from
binance on trade completion. basically i'd just like binance.buy/sell to
return the callback like binance.cancel does, i think.
thx again!
…On Thu, Oct 19, 2017 at 10:35 PM, Jon Eyrick ***@***.***> wrote:
Thank you for the report!
I created an update that fixes this issue. Please issue an npm update in
your project directory.
I have verified it works with the following code:
const binance = require('node-binance-api');binance.options({
'APIKEY':'key',
'APISECRET':'secret'
});//Placing a MARKET ordervar symbol = "BNBBTC", quantity = 1;binance.buy(symbol, quantity, 0, {type:"MARKET"});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AfaupLTcZZNq27E6meFQcMjVoBRmPiQWks5suDEzgaJpZM4P_-Mo>
.
|
Thank you! |
Thank you for the suggestion! I added callbacks to buy/sell functions and added a shortcut to make market orders easier. Now you can chain orders together. var quantity = 1;
binance.marketBuy("BNBBTC", quantity, function(response) {
console.log("Market Buy response", response);
// Now you can limit sell with a stop loss, etc.
}); Any other features/bugs/suggestions let me know and I will be happy to help. If you open it as a new issue I will see it sooner. Thanks again! |
Here are some new examples Limit Buyvar quantity = 5, price = 0.00402030;
binance.buy("BNBETH", quantity, price, {}, function(response) {
console.log("Limit Buy response", response);
console.log("order id: " + response.orderId);
});
Market Buyvar quantity = 1;
binance.marketBuy("BNBBTC", quantity, function(response) {
console.log("Market Buy response", response);
console.log("order id: " + response.orderId)
// Now you can limit sell with a stop loss, etc.
});
Please navigate to your project directory and issue an |
Hi, the example code to place a market order doesn't work—I'm not sure why, but it seems to be sending price information, which the api isn't expecting. Limit orders work fine.
Here's the error code I receive:
BUY(BNBBTC,1,0) { code: -1104,
msg: 'Not all sent parameters were not read; read '9' parameter(s) but was sent '10'.' }
The text was updated successfully, but these errors were encountered: