Comments (11)
Opening a large amount of websockets at once is bad too, I have mine in a loop so one gets opened every 350ms
from node-binance-api.
I love this repo. You did a great job. Thank you.
not related, any idea where to find a list of all the pairs on binance?
from node-binance-api.
Thank you for the kind words!
Yes, there are a few different ways.
This one is very useful:
exchangeInfo(): Pull minimum order size, quantity, etc.
//minNotional = minimum order value (price * quantity)
binance.exchangeInfo(function(data) {
let minimums = {};
for ( let obj of data.symbols ) {
let filters = {minNotional:0.001,minQty:1,maxQty:10000000,stepSize:1,minPrice:0.00000001,maxPrice:100000};
for ( let filter of obj.filters ) {
if ( filter.filterType == "MIN_NOTIONAL" ) {
filters.minNotional = filter.minNotional;
} else if ( filter.filterType == "PRICE_FILTER" ) {
filters.minPrice = filter.minPrice;
filters.maxPrice = filter.maxPrice;
} else if ( filter.filterType == "LOT_SIZE" ) {
filters.minQty = filter.minQty;
filters.maxQty = filter.maxQty;
filters.stepSize = filter.stepSize;
}
}
minimums[obj.symbol] = filters;
}
console.log(minimums);
fs.writeFile("minimums.json", JSON.stringify(minimums, null, 4), function(err){});
});
or you can subscribe to the 24h price change statistics
// For all symbols:
binance.websockets.prevDay(false, function(response) {
console.log(response);
});
// For a specific symbol:
binance.websockets.prevDay('BNBBTC', function(response) {
console.log(response);
});
You can get all symbols with the prices function
binance.prices(function(ticker) {
console.log("prices()", ticker);
console.log("Price of BNB: ", ticker.BNBBTC);
});
from node-binance-api.
Thank you for the report, I am testing this change for the next version
depth: function(symbol, callback, limit = 100) {
publicRequest(base+"v1/depth", {symbol:symbol, limit:limit}, function(data) {
if ( typeof data.bids !== "undefined" && typeof data.asks !== "undefined" ) {
return callback.call(this, depthData(data), symbol);
}
});
},
from node-binance-api.
I am still getting the issue after making this new change.
from node-binance-api.
might be here
const depthData = function(data) { // Used for /depth endpoint
let bids = {}, asks = {}, obj;
for ( obj of data.bids ) {
bids[obj[0]] = parseFloat(obj[1]);
}
for ( obj of data.asks ) {
asks[obj[0]] = parseFloat(obj[1]);
}
return {bids:bids, asks:asks};
}
from node-binance-api.
try this:
const depthData = function(data) { // Used for /depth endpoint
let bids = {}, asks = {}, obj;
if ( typeof data.bids !== "undefined" ) {
for ( obj of data.bids ) {
bids[obj[0]] = parseFloat(obj[1]);
}
}
if ( typeof data.asks !== "undefined" ) {
for ( obj of data.asks ) {
asks[obj[0]] = parseFloat(obj[1]);
}
}
return {bids:bids, asks:asks};
}
from node-binance-api.
I am getting this error return that's why:
{ code: -1003, msg: 'Way too many requests; IP banned until 1514259308510.' }
from node-binance-api.
Try to handle almost all your logic through websockets, then it's free
i try to only make requests when posting orders or cancelling them
from node-binance-api.
I am only using websockets but I am opening 50 of them.
from node-binance-api.
Your ban should be over in a few minutes
new Date(1514259308510).toLocaleString()
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 HOT 1
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.