Administrator
2024-05-17 c5426cf0daddf83771530df702e5ddda47f46d59
撤单阈值修改
2个文件已修改
29 ■■■■ 已修改文件
constant.py 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constant.py
@@ -73,8 +73,15 @@
CACHE_PATH = f"{'D:' if is_windows() else '/home/userzjj'}/trade_cache"
# S撤
F_FAST_RATE = 0.25  # S快砸
F_FAST_RATE_WITH_MUST_BUY = 0.5  # S快砸加红
S_FAST_RATE = 0.25  # S快砸
S_FAST_RATE_WITH_MUST_BUY = 0.69  # S快砸加红
S_FAST_BIG_RATE = 0.3  # S猛砸
S_FAST_BIG_RATE_WITH_MUST_BUY = 0.6  # S猛砸加红
S_SLOW_RATE = 0.49  # S慢砸
S_SLOW_RATE_WITH_MUST_BUY = 0.79  # S慢砸加红
# H撤比例
H_CANCEL_RATE = 0.80  # H撤比例
l2/cancel_buy_strategy.py
@@ -350,7 +350,10 @@
        total_datas[real_place_order_info[0]]['val']['orderNo'], min_sell_money=min_sell_money)
        sell_order_num = sum([x[1] for x in sell_orders]) // 100
        rate = round(sell_order_num / total_num, 2)
        if rate > 0.49:
        threshold_rate = constant.S_SLOW_RATE
        if gpcode_manager.MustBuyCodesManager().is_in_cache(code):
            threshold_rate = constant.S_SLOW_RATE_WITH_MUST_BUY
        if rate > threshold_rate:
            return True, f"慢砸成交比例:{rate}/0.49  成交:{sell_order_num}/{total_num}"
        else:
            return False, f"尚未触发撤单比例:{rate}"
@@ -434,7 +437,14 @@
                    total_count, total_num = L2DataComputeUtil.compute_left_buy_order(code, trade_index,
                                                                                      real_order_index_info[0],
                                                                                      limit_up_price)
                    if total_deal_money / (total_num * limit_up_price * 100) >= 0.3:
                    if total_num==0:
                        total_num = 1
                    threshold_rate = constant.S_FAST_BIG_RATE
                    if gpcode_manager.MustBuyCodesManager().is_in_cache(code):
                        threshold_rate = constant.S_FAST_BIG_RATE_WITH_MUST_BUY
                    if total_deal_money / (total_num * limit_up_price * 100) >= threshold_rate:
                        # 大单成交额占总剩余总囊括的30%
                        return True, f"1s内大于{threshold_big_deal}大卖单({total_deal_money})"
                else:
@@ -488,9 +498,9 @@
            # 防止分母为0
            total_fast_money = 1
        rate = round(total_deal_money / total_fast_money, 2)
        threshold_rate = constant.F_FAST_RATE
        threshold_rate = constant.S_FAST_RATE
        if gpcode_manager.MustBuyCodesManager().is_in_cache(code):
            threshold_rate = constant.F_FAST_RATE_WITH_MUST_BUY
            threshold_rate = constant.S_FAST_RATE_WITH_MUST_BUY
        if total_deal_money >= threash_money_w * 10000 and rate >= threshold_rate:
            return True, f"近1s有大卖单({round(total_deal_money / 10000, 1)}万/{threash_money_w}万,成交占比:{total_deal_money}/{total_fast_money})"