Comments (5)
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 order
var symbol = "BNBBTC", quantity = 1;
binance.buy(symbol, quantity, 0, {type:"MARKET"});
from node-binance-api.
from node-binance-api.
Thank you!
And great idea. I will work on this and keep you updated
from node-binance-api.
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!
from node-binance-api.
Here are some new examples
Limit Buy
var quantity = 5, price = 0.00402030;
binance.buy("BNBETH", quantity, price, {}, function(response) {
console.log("Limit Buy response", response);
console.log("order id: " + response.orderId);
});
Limit Buy response { symbol: 'BNBETH',
orderId: 4480717,
clientOrderId: 'te38xGILZUXrPZHnTQPH6h',
transactTime: 1509049732437,
price: '0.00402030',
origQty: '5.00000000',
executedQty: '5.00000000',
status: 'FILLED',
timeInForce: 'GTC',
type: 'LIMIT',
side: 'BUY' }
//order id: 4480717
Market Buy
var 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.
});
Market Buy response {
symbol: 'BNBETH',
orderId: 4480553,
clientOrderId: 'rCGiCG08PGy7AwvbrG5d83',
transactTime: 1509049376261,
price: '0.00000000',
origQty: '1.00000000',
executedQty: '1.00000000',
status: 'FILLED',
timeInForce: 'GTC',
type: 'MARKET',
side: 'BUY' }
//order id: 4480553
Please navigate to your project directory and issue an npm update
Or run the command npm install node-binance-api --save
from node-binance-api.
Related Issues (20)
- 502 Bad Gateway
- futures api HOT 1
- 100% trading in the market using the .marketBuy function HOT 2
- Has anyone had and solved the problem with 1006 and !ticker@arr (ETIMEDOUT)? HOT 1
- All future functions are giving same error HOT 2
- Docker: Socket connection timeout
- Get historical Candle stick Data HOT 1
- Margin order doesn't have the same behaviour as futuresOrder
- Get funding balance
- can i monitor more than one account via stream?
- Binance API
- how to fix: code: -2019, msg: 'Margin is insufficient.' HOT 1
- Closing one WebSocket connection inadvertently closes another
- futuresCountdownCancel not All
- How about implement trailingDelta?
- Websocket - Binance Websocket.chart is not working 2024 HOT 3
- Asimetrik (Ed25519 ve RSA) genel-özel anahtar çiftleri oluşturmaya yönelik talimatları görüntüleyin. HOT 1
- WHIBITW HOT 1
- Trigger callback when order trigger HOT 1
- receiverOnMessage() does not work for TONUSDT
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-binance-api.