| | |
| | | from log_module import log_export, async_log_util |
| | | from log_module.log import hx_logger_l2_transaction, logger_debug, logger_request_api |
| | | from strategy import data_cache |
| | | from strategy.kpl_data_manager import KPLStockOfMarketsPlateLogManager |
| | | from strategy.kpl_data_manager import KPLStockOfMarketsPlateLogManager, KPLMarketStockHeatLogManager |
| | | from strategy.trade_setting import TradeSetting |
| | | from trade import huaxin_trade_api, huaxin_trade_data_update |
| | | from trade.huaxin_trade_record_manager import DelegateRecordManager, DealRecordManager, MoneyManager, PositionManager |
| | |
| | | finally: |
| | | if use_time_list and use_time_list[-1][1] > 10: |
| | | logger_debug.warning(f"环境获取时间大于10s({request_id}):{use_time_list}") |
| | | |
| | | elif url.path == "/load_kpl_stock_of_markets_plate": |
| | | # 获取板块强度数据 |
| | | elif url.path == "/load_get_kpl_market_sift_plate": |
| | | # 加载数据 |
| | | KPLStockOfMarketsPlateLogManager().load_data() |
| | | response_data = json.dumps({"code": 0, "msg": "暂无内容"}) |
| | | elif url.path == "/get_kpl_stock_of_markets_plate": |
| | | elif url.path == "/get_kpl_market_sift_plate": |
| | | # 获取开盘啦流入板块详细信息 |
| | | print("==========get_kpl_market_sift_plate==========") |
| | | try: |
| | | time_str = params_dict.get("time") |
| | | if not time_str: |
| | | time_str = tool.get_now_time_str() |
| | | fdatas = KPLStockOfMarketsPlateLogManager().get_filter_log_datas() |
| | | response_data = json.dumps({"code": 1, "msg": "暂无内容"}) |
| | | for i in range(len(fdatas) - 1, -1, -1): |
| | | if fdatas[i][0] <= time_str: |
| | | response_data = json.dumps({"code": 0, "data": fdatas[i]}) |
| | | break |
| | | except Exception as e: |
| | | logging.exception(e) |
| | | response_data = json.dumps({"code": 1, "msg": str(e)}) |
| | | |
| | | # 获取个股强度数据 |
| | | elif url.path == "/load_get_kpl_market_stock_heat": |
| | | # 加载数据 |
| | | KPLMarketStockHeatLogManager().load_data() |
| | | response_data = json.dumps({"code": 0, "msg": "暂无内容"}) |
| | | elif url.path == "/get_get_kpl_market_stock_heat": |
| | | # 获取开盘啦流入板块详细信息 |
| | | print("==========get_kpl_stock_of_markets_plate==========") |
| | | try: |
| | | time_str = params_dict.get("time") |
| | | if not time_str: |
| | | time_str = tool.get_now_time_str() |
| | | fdatas = KPLStockOfMarketsPlateLogManager().get_filter_log_datas() |
| | | fdatas = KPLMarketStockHeatLogManager().get_filter_log_datas() |
| | | response_data = json.dumps({"code": 1, "msg": "暂无内容"}) |
| | | for i in range(len(fdatas) - 1, -1, -1): |
| | | if fdatas[i][0] <= time_str: |