You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
912 B
36 lines
912 B
import time
|
|
|
|
|
|
from huobi.connection.subscribe_client import SubscribeClient
|
|
from huobi.model.trade import *
|
|
from huobi.utils import *
|
|
|
|
|
|
class SubOrderUpdateV2Service:
|
|
def __init__(self, params):
|
|
self.params = params
|
|
|
|
def subscribe(self, callback, error_handler, **kwargs):
|
|
symbol_list = self.params["symbol_list"]
|
|
|
|
def subscription(connection):
|
|
for val in symbol_list:
|
|
connection.send(orders_update_channel(val))
|
|
time.sleep(0.01)
|
|
|
|
def parse(dict_data):
|
|
return default_parse(dict_data, OrderUpdateEvent, OrderUpdate)
|
|
|
|
SubscribeClient(**kwargs).execute_subscribe_v2(subscription,
|
|
parse,
|
|
callback,
|
|
error_handler,
|
|
is_trade=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|