Administrator
2024-04-19 25d100b3b1702c23b4e9cc04e7e83c2f05a6ddaf
添加S撤日志/L后重新囊括放开
3个文件已修改
32 ■■■■■ 已修改文件
l2/cancel_buy_strategy.py 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/test_sell.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/tool.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py
@@ -305,7 +305,7 @@
                m = x[1] * x[2]
                if max_money < m:
                    max_money = m
                total_deal_money += x[1] * x[2]
                total_deal_money += m
        if max_money >= 4990000:
            return True, f"有大于499w大卖单({max_money})"
@@ -386,16 +386,16 @@
            if need_cancel:
                return need_cancel, cancel_msg
            # S后撤取消
            if self.__latest_process_sell_order_no.get(code) != big_sell_order_info[1][-1][0]:
                # 不处理重复的卖单
                # 获取最新的成交时间
                latest_trade_time = l2_huaxin_util.convert_time(big_sell_order_info[1][-1][4][0])
                if tool.trade_time_sub(latest_trade_time,
                                       total_datas[order_begin_pos.buy_single_index]['val']['time']) >= 180:
                    self.__compute_down_cancel_watch_index(code, big_sell_order_info, total_datas)
            # if self.__latest_process_sell_order_no.get(code) != big_sell_order_info[1][-1][0]:
            #     # 不处理重复的卖单
            #     # 获取最新的成交时间
            #     latest_trade_time = l2_huaxin_util.convert_time(big_sell_order_info[1][-1][4][0])
            #     if tool.trade_time_sub(latest_trade_time,
            #                            total_datas[order_begin_pos.buy_single_index]['val']['time']) >= 180:
            #         self.__compute_down_cancel_watch_index(code, big_sell_order_info, total_datas)
            return False, "不满足撤单条件"
        finally:
            self.__latest_process_sell_order_no[code] = big_sell_order_info[1][-1][0]
            # self.__latest_process_sell_order_no[code] = big_sell_order_info[1][-1][0]
            pass
    def need_cancel_for_down(self, code, start_index, end_index):
@@ -1311,7 +1311,7 @@
                changed = False
        # 保存数据
        if changed:
            l2_log.l_cancel_debug(code, f"设置成交位临近撤单监控范围:{watch_indexes} 计算范围:{start_index}-{end_index}")
            l2_log.l_cancel_debug(code, f"L前监控范围:{watch_indexes} 计算范围:{start_index}-{end_index}")
            self.__set_near_by_trade_progress_indexes(code, buy_single_index, watch_indexes)
        self.__last_l_up_compute_info[code] = (time.time(), watch_indexes)
test/test_sell.py
@@ -149,4 +149,12 @@
if __name__ == '__main__':
    statistic_sell_order()
    # s
    real_order_time_ms = "09:30:47" + ".{0:0>3}".format(220)
    big_sell_order_info = [1809599, [[7351750, 208000, 8.7, (11042670, 527268), (11042670, 527275)]]]
    max_money = 0
    for x in big_sell_order_info[1]:
        deal_time = l2_huaxin_util.convert_time(x[4][0], with_ms=True)
        if real_order_time_ms:
            if tool.trade_time_sub_with_ms(deal_time, real_order_time_ms) >= 0:
                print("123123")
utils/tool.py
@@ -159,7 +159,7 @@
def get_time_as_millionsecond(time_str):
    s_str, ms_str = time_str.split(".")
    ts = s_str.split(":")
    return int(ts[0]) * 3600 + int(ts[1]) * 60 + int(ts[2]) * 1000 + int(ms_str)
    return (int(ts[0]) * 3600 + int(ts[1]) * 60 + int(ts[2])) * 1000 + int(ms_str)
# 将秒数格式化为时间