Comments (4)
@skeller88 initial depth has been increased in later versions, also updated to open the socket and buffer messages before requesting book from REST API.
from python-binance.
Hi @skeller88 I have saved some notes from Telegram around the Binance Depth Cache which may be helpful. I'm not completely sure what you're asking for though. Does my DepthCache Class not follow this process? Or are you just interested in better documentation around it?
https://gist.github.com/sammchardy/5515afe1dff84475098f669a62558860
from python-binance.
Yes, that's helpful. I was initially confused until I realized that order book deltas are actually absolute, not relative.
I'm confused by this statement in the Telegram notes:
But yes, if the order book shifts 500 levels up from when you got it, you will be missing levels.
If the order book shifted 500 levels up, does that mean 500 price levels? Wouldn't all of those shifts in price levels be sent through the depth channel?
Your DepthCache class follows the process for keeping things in sync, yea. The only issue I see is since the initial order book snapshot you get only has a depth of 10, it's more likely that the depth channel will get deltas that are many levels away from the other orders in the DepthCache. For example, say the initial snapshot of bids is
49
...
40
The depth channel could get a bid for 56, and you wouldn't know that there are already bids for 52 and 53. That's not ideal because then you have a skewed view of the order book. So if it's not too much memory, getting a 100 level initial snapshot seems better. What do you think?
from python-binance.
@skeller88 sorry I missed your comment, yes I'll have a look at increasing the depth of the initial fetch to improve that snapshot.
from python-binance.
Related Issues (20)
- Cant import ThreadedWebsocketManager
- Websockets RuntimeError "This event loop is already running" HOT 7
- get_current_order_count fails with KeyError: 'data' HOT 1
- user data stream in futures HOT 1
- Accessing the Mark Price HOT 1
- Fix the comment to describe refresh_interval
- endpoint issue HOT 1
- Multiple User socket streams HOT 1
- Close all orders if one fails HOT 1
- dateparser is unmaintained
- Does testnet work with the .us tld?
- Futures endpoint brings coins that are not in the Binance list
- Differentiate between spot/margin/isolated accounts on user data streams.
- binance.exceptions.BinanceAPIException: APIError(code=-1021): Timestamp for this request was 1000ms ahead of the server's time HOT 1
- Inaccurate prices with get_klines HOT 2
- I am getting this type of error HOT 1
- Binance future Minimum Qnt.. get minimum position size fetch or calculate in python HOT 1
- Correct way of implementing daily PnL query? HOT 6
- Portfolio margin support HOT 1
- Binance Testnet user_socket() problem.
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 python-binance.