Administrator
2024-07-08 c26a3c55ffa6231678a1a9b16990de22baef8234
P撤守护时间与大单有关
3个文件已修改
31 ■■■■ 已修改文件
code_attribute/gpcode_manager.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/cancel_buy_strategy.py 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code_attribute/gpcode_manager.py
@@ -619,6 +619,13 @@
    return limit_up_price
def get_limit_up_price_as_num(code):
    limit_up_price = get_limit_up_price(code)
    if limit_up_price:
        return round(float(limit_up_price), 2)
    return None
def get_limit_up_price_cache(code):
    if code in __limit_up_price_dict:
        return __limit_up_price_dict[code]
l2/cancel_buy_strategy.py
@@ -423,13 +423,23 @@
        total_datas = local_today_datas.get(code)
        # 是否是下单3分钟内
        sub_time = tool.trade_time_sub(total_datas[-1]['val']['time'], total_datas[real_order_index]['val']['time'])
        if sub_time > 30:
            return False, "下单超过30s"
        if sub_time > 60:
            return False, "下单超过60s"
        limit_up_price = gpcode_manager.get_limit_up_price_as_num(code)
        # 判断累计大单数量
        min_money = l2_data_util.get_big_money_val(limit_up_price, tool.is_ge_code(code))
        total_count, total_num = L2DataComputeUtil.compute_left_buy_order(code, trade_index, real_order_index,
                                                                          limit_up_price, min_money)
        if sub_time <= 2:
            return False, "下单在2s内"
        min_time_s, max_time_s = 2, 30
        if total_num * limit_up_price >= 299 * 100:
            min_time_s, max_time_s = 30, 60
        limit_up_price = gpcode_manager.get_limit_up_price(code)
        if sub_time <= min_time_s:
            return False, f"下单在{min_time_s}s内"
        if sub_time > max_time_s:
            return False, f"下单超过{max_time_s}s"
        # 计算我们后面的大单与涨停纯买额
        total_left_num = 0
trade/huaxin/huaxin_trade_server.py
@@ -777,8 +777,8 @@
    # 持仓刷新
    huaxin_trade_data_update.add_position_list()
    # 定时持仓刷新
    schedule.every().day.at("09:00:00").do(huaxin_trade_data_update.add_position_list)
    schedule.every().day.at("09:10:00").do(huaxin_trade_data_update.add_position_list)
    # schedule.every().day.at("09:00:00").do(huaxin_trade_data_update.add_position_list)
    # schedule.every().day.at("09:10:00").do(huaxin_trade_data_update.add_position_list)
    schedule.every().day.at("15:10:00").do(zyltgb_util.update_all_zylt_volumes)
    schedule.every().day.at("08:00:01").do(history_k_data_manager.update_history_k_bars)
    schedule.every().day.at("08:30:01").do(history_k_data_manager.update_history_k_bars)