Open cuneytkilic opened 1 year ago
In the response headers, there is a parameter X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)
which contains how much weight you used.
Now for spot it's usually 1200, for Futures its 2400, so you can easily calculate how much weight you have left by doing 2400 - X-MBX-USED-WEIGHT-...-... from the headers
and then you can add a timer that resets the usedWeight to 0 or reset your "speedLimiter" every beginning of the minute.
But what is best for you is to instead learn how to use userData
streams, listen to the ORDER_TRADE_UPDATE
event which sends you the status of the orders in your account
If you want easier documentation, I suggest using my library binance-lib
once v3.0.0
comes out with the new IntelliSense documentation (its coming out in a couple of days)
I am trying to coding a buy/sell strategy but i struggle with "max 2400 request" error. Basically, my program buys a coin and create limit order and then checks that order is new, filled, cancelled or expired. Program working fine about 8-12 hours. After that gives a max request error. I dont know, how to control, calculate or learn weight of a request.
Also i wonder that the following 2 request code example has the same weight of request or not ?
1-)
2-)