| | |
| | | # coding=utf-8 |
| | | from __future__ import print_function, absolute_import, unicode_literals |
| | | import logging |
| | | import json |
| | | import os.path |
| | | # from log import logger |
| | | import threading |
| | | import time |
| | | |
| | |
| | | # 引入掘金桥梁API |
| | | import utils.juejin_api |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from log_module.log import logger_common, logger_kpl_jingxuan_in, logger_system |
| | | from huaxin_client.l2_data_transform_protocol import L2DataCallBack |
| | | from log_module.log import logger_common, logger_kpl_jingxuan_in, logger_system, logger_debug |
| | | # 引入开盘啦API模块 |
| | | # 引入全局变量模块 |
| | | # 引入定时器模块 |
| | |
| | | from huaxin_client import l2_market_client |
| | | from log_module import async_log_util |
| | | from trade import huaxin_trade_data_update |
| | | from utils import hx_qc_value_util |
| | | from utils import hx_qc_value_util, huaxin_util |
| | | |
| | | # 引入行情订阅模块 |
| | | # import subscribe_market |
| | |
| | | # print(f"all_stocks_all_K_line_property_dict== {type(data_cache.all_stocks_all_K_line_property_dict)}") |
| | | # 获取实时大盘指数行情线程 |
| | | threading.Thread(target=lambda: instant_time_market.index_market_current(), daemon=True).start() |
| | | |
| | | # instant_time_market.index_market_trend() |
| | | |
| | | # 开盘啦的涨停概念的回调函数 |
| | |
| | | else: |
| | | instant_time_market.set_current_info(datas) |
| | | |
| | | |
| | | class MyL2DataCallback(L2DataCallBack): |
| | | |
| | | def OnL2Transaction(self, code, datas): |
| | | if datas: |
| | | # 获取最近的成交价 |
| | | price, time_str = datas[-1][1], huaxin_util.convert_time(datas[-1][3]) |
| | | pass |
| | | |
| | | def OnMarketData(self, code, datas): |
| | | # logger_debug.info(f"收到L2Market数据:{datas}") |
| | | for d in datas: |
| | | code = d["securityID"] |
| | | buy1 = d["buy"][0] |
| | | |
| | | def OnRealTimeBuy1Info(self, code, buy1_info): |
| | | # buy1_info: [买1时间,买1价格, 原始买1量, 实时买1量] |
| | | async_log_util.info(logger_debug, f"OnRealTimeBuy1Info:{code}-{buy1_info}") |
| | | # L1DataProcessor.excute_sell_rule(code, buy1_info[3], buy1_info[1], "l2-real") |
| | | |
| | | |
| | | # 加载开盘啦板块日志数据 |
| | | kpl_data_manager.KPLStockOfMarketsPlateLogManager() |
| | | |
| | | |
| | | # 启动异步日志 |
| | | threading.Thread(target=async_log_util.run_sync, daemon=True).start() |