Closed mbellmbell closed 4 years ago
Hi! I know you told it, but i really guess you are not up to date with the lib! What is your example code? BR, Oliver
Thx. Here is example code:
from unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager
class BinanceWebSocketApiProcessStreams:
@staticmethod
def process_stream_data(received_stream_data_json):
print(received_stream_data_json)
def start():
binance_websocket_api_manager = BinanceWebSocketApiManager(BinanceWebSocketApiProcessStreams.process_stream_data)
binance_websocket_api_manager.create_stream({'aggTrade'}, {'BTCUSDT'})
if __name__ == '__main__':
start()
I have attached latest pip list file.
OK, it looks like def_process_stream_data() now requires stream_buffer_name param:
def process_stream_data(received_stream_data_json, stream_buffer_name=False):
The reason is work on my local machine is that I'm running an old version of Unicorn library that doesn't require param. I'm guessing if I upgrade local Unicorn version it will break as well.
Back in business. Thanks again.
Great! :+1:
just 4 info: process_stream_data() is overloading add_to_stream_buffer() and needs to get the same args: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api/unicorn_binance_websocket_api.html#unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager.BinanceWebSocketApiManager.add_to_stream_buffer
The way you use with the call back function was the first implementation, then I implemented the stream_buffer and i think its better to work with the stream_buffer! https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/example_stream_buffer.py https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/example_stream_buffer_extended.py
OK, thanks. Got it.
BTW, where is the fastest place to run to minimize network overhead to binance API? I'm noticing it takes about 250ms to place a trade (running on AWS East). I'm sure most of this is Binance processing, but trying to understand where I should be running to shave a few ms off of things as that has an impact on what I'm doing.
the examples seem to be outdated. processing class example fails
Which one? What error?
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
Select one:
Environment
Operating System? (include version)
Python Version Requirement
Exact Python Version?
Pip Version?
Dependencies
Run
pip list > pip_list.txt
and upload the file. pip_list.txt I have also upgraded to aiohttp 3.6.2 and same problem.UNICORN Binance WebSocket API Version?
Description of your issue
Things work fine on MacOS, but when install on Ubuntu 18.0, I get this error when starting up:
I was able to run simple example you have (3 + 4 lines of code) successfully. Not sure where to look for source of problem.