Administrator
2023-09-25 23b133340079a85fd831c7cb2f407b88e3013550
处理交易成功数据由并行改为串行处理
2个文件已修改
24 ■■■■ 已修改文件
l2/cancel_buy_strategy.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -909,10 +909,10 @@
                                                                                                      total_data,
                                                                                                      _local_today_num_operate_map)
                canceled_count += total_data[wi]["re"] - left_count
                if wi == watch_indexes_list[-1] and left_count == 0:
                    # 离下单位置最近的一个撤单,必须触发撤单
                    l2_log.l_cancel_debug(code, f"计算范围:{start_index}-{end_index},临近撤单:{wi}")
                    return True, total_data[-1]
                # if wi == watch_indexes_list[-1] and left_count == 0:
                #     # 离下单位置最近的一个撤单,必须触发撤单
                #     l2_log.l_cancel_debug(code, f"计算范围:{start_index}-{end_index},临近撤单:{wi}")
                #     return True, total_data[-1]
            rate = round(canceled_count / total_count, 3)
            l2_log.l_cancel_debug(code, f"计算范围:{start_index}-{end_index},已撤单比例:{rate}")
trade/huaxin/huaxin_trade_server.py
@@ -345,22 +345,10 @@
                        if need_cancel:
                            L2TradeDataProcessor.cancel_buy(code, f"D撤:{msg}", source="d_cancel")
                    f2 = dask.delayed(LCancelBigNumComputer().set_trade_progress)(code,
                                                                                  buy_progress_index,
                                                                                  total_datas)
                    # f3 = dask.delayed(
                    #     deal_big_money_manager.DealComputeProgressManager().set_trade_progress)(
                    #     code,
                    #     buy_progress_index,
                    #     total_datas,
                    #     num_operate_map)
                    f4 = dask.delayed(
                        SecondCancelBigNumComputer().set_transaction_index)(
                    LCancelBigNumComputer().set_trade_progress(code, buy_progress_index, total_datas)
                    SecondCancelBigNumComputer().set_transaction_index(
                        code,
                        buy_progress_index)
                    dask.compute(f2, f4)
                else:
                    pass
            except Exception as e: