| | |
| | | |
| | | def test_trade(self): |
| | | threading.Thread(target=async_log_util.run_sync, daemon=True).start() |
| | | code = "600203" |
| | | code = "000026" |
| | | clear_trade_data(code) |
| | | l2.l2_data_util.load_l2_data(code) |
| | | total_datas = deepcopy(l2.l2_data_util.local_today_datas[code]) |
| | |
| | | |
| | | # 获取交易进度 |
| | | trade_progress_list, buy_queues = log_export.get_trade_progress(code) |
| | | trade_progress_list.reverse() |
| | | # jingxuan_ranks = KPLDataManager().get_from_file(kpl_util.KPLDataType.JINGXUAN_RANK, tool.get_now_date_str()) |
| | | # industry_ranks = KPLDataManager().get_from_file(kpl_util.KPLDataType.INDUSTRY_RANK, tool.get_now_date_str()) |
| | | # RealTimeKplMarketData().set_top_5_reasons(jingxuan_ranks) |
| | |
| | | |
| | | print("----------------处理位置", indexs) |
| | | for l2_m in l2_market_datas: |
| | | if l2_m["dataTimeStamp"] < int(total_datas[indexs[0]]["val"]["time"].replace(":", "")): |
| | | if int(str(l2_m["dataTimeStamp"])[:-3]) < int(total_datas[indexs[0]]["val"]["time"].replace(":", "")): |
| | | time_str = f"{l2_m['dataTimeStamp']}" |
| | | if time_str.startswith("9"): |
| | | time_str = "0" + time_str |
| | |
| | | l2_m["totalAskVolume"] * l2_m["avgAskPrice"]) |
| | | break |
| | | |
| | | for tp in trade_progress_list: |
| | | if int(tp[1].replace(":", "")) < int(total_datas[indexs[0]]["val"]["time"].replace(":", "")): |
| | | TradeBuyQueue().set_traded_index(code, tp[0]) |
| | | break |
| | | |
| | | l2.l2_data_manager_new.L2TradeDataProcessor.process_add_datas(code, total_datas[indexs[0]:indexs[1] + 1], 0, |
| | | 0) |
| | | |