Administrator
2024-02-01 b990127a76ac46f778744a7a234cc69ca34a89ad
深圳打折修改/主动撤单规则修改
2个文件已修改
27 ■■■■■ 已修改文件
l2/l2_data_manager_new.py 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_server.py 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -436,8 +436,8 @@
                    cls.__process_order(code, start_index, end_index, capture_timestamp, is_first_code)
                else:
                    # 未挂单,时间相差不大才能挂单
                    if tool.trade_time_sub(latest_time, "09:32:00") < 0 or l2.l2_data_util.L2DataUtil.is_same_time(now_time_str, latest_time):
                        cls.__process_not_order(code, start_index, end_index, capture_timestamp, is_first_code)
                    #if tool.trade_time_sub(latest_time, "09:32:00") < 0 or l2.l2_data_util.L2DataUtil.is_same_time(now_time_str, latest_time):
                    cls.__process_not_order(code, start_index, end_index, capture_timestamp, is_first_code)
            async_log_util.info(logger_l2_process, "code:{} 处理数据范围: {}-{} 处理时间:{} 截图时间戳:{}", code,
                                add_datas[0]["index"],
@@ -1313,12 +1313,10 @@
                    #     # 股价新高或者逼近前高
                    #     order_begin_pos.threshold_money = int(sell_info[1])
                    # else:
                    if float(total_datas[buy_single_index]["val"]["price"]) >= 3 and cls.volume_rate_info[code][
                        0] > 0.3 and sell_info[1] > 2000 * 10000 and int(
                        tool.get_now_time_str().replace(":", "")) < int("100000"):
                        # 暂时打8折
                        # order_begin_pos.threshold_money = int(sell_info[1] * 0.8)
                        # 深证总卖大于1000万的票,m值打5折
                    # if float(total_datas[buy_single_index]["val"]["price"]) >= 3 and cls.volume_rate_info[code][
                    #     0] > 0.3 and sell_info[1] > 2000 * 10000 and int(
                    #     tool.get_now_time_str().replace(":", "")) < int("100000"):
                    if sell_info[1] > 2000 * 10000:
                        if code.find('00') == 0:
                            # 深圳首次下单打折
                            place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code)
trade/huaxin/huaxin_trade_server.py
@@ -522,6 +522,11 @@
def __cancel_buy_for_too_far():
    while True:
        try:
            # 获取账户可用资金
            account_available_money = trade_manager.AccountAvailableMoneyManager().get_available_money_cache()
            if account_available_money is not None and account_available_money > constant.BUY_MONEY_PER_CODE:
                continue
            can_cancel_codes = []
            current_delegates = huaxin_trade_record_manager.DelegateRecordManager().list_current_delegates()
            for c in current_delegates:
                if int(c["direction"]) != huaxin_util.TORA_TSTP_D_Buy:
@@ -566,8 +571,12 @@
                    buy1_money = 0
                if buy1_money > 0:
                    total_left_money = total_left_num * 100 * float(limit_up_price)
                    if total_left_money > buy1_money * 2 / 3:
                        l2_data_manager_new.L2TradeDataProcessor.cancel_buy(code, "下单距离太远")
                    rate = total_left_money / buy1_money
                    if rate > 0.66:
                        can_cancel_codes.append((code, rate))
            if can_cancel_codes:
                can_cancel_codes.sort(key=lambda x: x[1], reverse=True)
                l2_data_manager_new.L2TradeDataProcessor.cancel_buy(can_cancel_codes[0][0], "下单距离太远")
        except Exception as e:
            logger_debug.exception(e)
        finally: