Administrator
2024-04-22 5de4f5031fac70ffced502048540ff5aa5beed2f
bug修复
3个文件已修改
15 ■■■■■ 已修改文件
l2/cancel_buy_strategy.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/data_server.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/data_export_util.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -1733,8 +1733,8 @@
                if dealing_info and str(dealing_info[0]) == str(val["orderNo"]):
                    total_left_num -= dealing_info[1] // 100
        limit_up_price = gpcode_manager.get_limit_up_price(code)
        if total_left_count <= THRESHOLD_COUNT and limit_up_price and total_left_num * float(
                limit_up_price) < 300 * 100:
        if total_left_count<=1 or (total_left_count <= THRESHOLD_COUNT and limit_up_price and total_left_num * float(
                limit_up_price) < 300 * 100):
            return True, f"剩余笔数({total_left_count})/金额({round(total_left_num * float(limit_up_price) * 100)})不足,成交进度:{trade_index},真实下单位置:{real_order_index}"
        return False, f"不满足撤单条件: 成交进度-{trade_index} 真实下单位置-{real_order_index} total_left_count-{total_left_count} total_left_num-{total_left_num}"
third_data/data_server.py
@@ -356,8 +356,9 @@
                ps_dict = dict([(k, v[0]) for k, v in parse_qs(url.query).items()])
                code = ps_dict['code']
                date = ps_dict.get('date')
                time_str = ps_dict.get('time')
                total_datas = l2_data_util.local_today_datas.get(code)
                if date:
                if date or time_str:
                    total_datas = None
                else:
                    date = tool.get_now_date_str()
utils/data_export_util.py
@@ -25,7 +25,7 @@
# 获取L2的数据
def get_l2_datas(code, today_datas=None, date=None):
def get_l2_datas(code, today_datas=None, date=None, max_time=None):
    if date is None:
        date = tool.get_now_date_str()
    datas = today_datas
@@ -48,7 +48,8 @@
    active_sell_set = active_sell_map.get(code)
    if not active_sell_set:
        active_sell_set = set()
    fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos, active_sell_set)
    fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos,
                            active_sell_set)
    return fdatas
@@ -61,7 +62,8 @@
    return fdatas
def export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos, active_sell_nos):
def export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos,
                   active_sell_nos):
    def find_process_index(index):
        for i in range(0, len(process_indexs)):
            if process_indexs[i][0] <= index <= process_indexs[i][1]: