| | |
| | | import time |
| | | |
| | | import constant |
| | | from l2 import l2_data_manager_new, l2_log |
| | | from l2.huaxin import huaxin_target_codes_manager |
| | | 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 |
| | | |
| | |
| | | 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: |
| | |
| | | # t1.setDaemon(True) |
| | | # t1.start() |
| | | # |
| | | |
| | | while True: |
| | | time.sleep(10) |