Initialise the DepthCacheManager :param client: Binance API client :type client: binance.Client :param loop: asyncio loop :param symbol: Symbol to create depth cache for :type symbol: string :param refresh_interval: Optional number of seconds between
(
self,
client,
symbol,
loop=None,
refresh_interval: Optional[int] = None,
bm=None,
limit=500,
conv_type=float,
ws_interval=None,
)
| 297 | |
| 298 | class DepthCacheManager(BaseDepthCacheManager): |
| 299 | def __init__( |
| 300 | self, |
| 301 | client, |
| 302 | symbol, |
| 303 | loop=None, |
| 304 | refresh_interval: Optional[int] = None, |
| 305 | bm=None, |
| 306 | limit=500, |
| 307 | conv_type=float, |
| 308 | ws_interval=None, |
| 309 | ): |
| 310 | """Initialise the DepthCacheManager |
| 311 | |
| 312 | :param client: Binance API client |
| 313 | :type client: binance.Client |
| 314 | :param loop: asyncio loop |
| 315 | :param symbol: Symbol to create depth cache for |
| 316 | :type symbol: string |
| 317 | :param refresh_interval: Optional number of seconds between cache refresh, use 0 or None to disable |
| 318 | :type refresh_interval: int |
| 319 | :param limit: Optional number of orders to get from orderbook |
| 320 | :type limit: int |
| 321 | :param conv_type: Optional type to represent price, and amount, default is float. |
| 322 | :type conv_type: function. |
| 323 | :param ws_interval: Optional interval for updates on websocket, default None. If not set, updates happen every second. Must be 0, None (1s) or 100 (100ms). |
| 324 | :type ws_interval: int |
| 325 | |
| 326 | """ |
| 327 | super().__init__(client, symbol, loop, refresh_interval, bm, limit, conv_type) |
| 328 | self._ws_interval = ws_interval |
| 329 | |
| 330 | async def _init_cache(self): |
| 331 | """Initialise the depth cache calling REST endpoint |