Administrator
2023-07-11 746f17693afdd41894dc43b5347a0f350776d3e1
华鑫适配
1个文件已修改
17 ■■■■■ 已修改文件
trade/huaxin/trade_server.py 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/trade_server.py
@@ -9,7 +9,8 @@
import time
import constant
from l2 import l2_data_manager_new, l2_log
from code_attribute import gpcode_manager
from l2 import l2_data_manager_new, l2_log, code_price_manager
from l2.huaxin import  huaxin_target_codes_manager
from log_module.log import hx_logger_l2_upload, hx_logger_contact_debug, hx_logger_trade_callback, \
    hx_logger_l2_orderdetail, hx_logger_l2_transaction, hx_logger_trade_debug, hx_logger_l2_market_data
@@ -163,6 +164,19 @@
                        data = data_json["data"]
                        code = data["code"]
                        data = data["data"]
                        time_str = f"{data['dataTimeStamp']}"
                        if time_str.startswith("9"):
                            time_str = "0" + time_str
                        time_str = time_str[:6]
                        time_str = f"{time_str[0:2]}:{time_str[2:4]}:{time_str[4:6]}"
                        buy_1_price, buy_1_volume = data["buy"][0]
                        sell_1_price, sell_1_volume = data["sell"][0]
                        limit_up_price = gpcode_manager.get_limit_up_price(code)
                        if limit_up_price is not None:
                            # 处理买1,卖1信息
                            code_price_manager.Buy1PriceManager.process(code, buy_1_price, time_str, limit_up_price,
                                                                        sell_1_price, sell_1_volume)
                        hx_logger_l2_market_data.info(f"{code}#{data}")
                        sk.sendall(json.dumps({"code": 0}).encode(encoding='utf-8'))
                else:
@@ -202,5 +216,6 @@
    #     t1.setDaemon(True)
    #     t1.start()
    #
    while True:
        time.sleep(10)