| | |
| | | if has_single: |
| | | # 判断是否是板上买 |
| | | order_begin_pos.at_limit_up = cls.__is_at_limit_up_buy(code) |
| | | # -------------计算信号位到成交位的纯买额(过远则为无效位置)------------------- |
| | | if order_begin_pos.at_limit_up: |
| | | # 信号位是否有效 |
| | | pass |
| | | # 获取成交进度位置 |
| | | # trade_index, is_default = TradeBuyQueue().get_traded_index(code) |
| | | # if trade_index and not is_default: |
| | | # m_base_val = l2_trade_factor.L2PlaceOrderParamsManager.get_base_m_val(code) |
| | | # thresh_hold_num = m_base_val * 4 // (float(gpcode_manager.get_limit_up_price(code)) * 100) |
| | | # # 真实下单位到成交位置的纯买额 * 3 |
| | | # total_num = 0 |
| | | # for i in range(trade_index + 1, buy_single_index): |
| | | # data = total_datas[i] |
| | | # val = data["val"] |
| | | # if not L2DataUtil.is_limit_up_price_buy(val): |
| | | # continue |
| | | # left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2( |
| | | # code, |
| | | # data["index"], |
| | | # total_datas, |
| | | # local_today_canceled_buyno_map.get( |
| | | # code)) |
| | | # total_num += left_count * val["num"] |
| | | # if total_num > thresh_hold_num: |
| | | # break |
| | | # if total_num > thresh_hold_num: |
| | | # # 距离成交进度位置过远 |
| | | # l2_log.debug(code, |
| | | # f"获取的信号位无效(板上买,范围:{trade_index + 1}-{order_begin_pos.buy_single_index} 未成交总手{total_num}/阈值{thresh_hold_num})") |
| | | # return None |
| | | |
| | | # -----------------------------买入计算初始化,计算纯买额阈值----------------------- |
| | | cls.__last_buy_single_dict[code] = buy_single_index |
| | | new_get_single = True |
| | | order_begin_pos.num = 0 |
| | | order_begin_pos.count = 0 |
| | | order_begin_pos.buy_single_index = buy_single_index |
| | | # 调整闪电下单的买入阈值 |
| | | # 总卖额的1倍 |
| | | order_begin_pos.threshold_money = int(sell_info[1] * 1.0) |
| | | order_begin_pos.max_num_set = set() |
| | | |
| | | l2_log.debug(code, "获取到买入信号起始点:{} ,计算范围:{}-{} ,量比:{},是否板上买:{},数据:{} 模式:{}({}) 信号类型:{}", |
| | | buy_single_index, |
| | |
| | | |
| | | # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "计算m值大单") |
| | | |
| | | threshold_money, msg = cls.__get_threshmoney(code) |
| | | # threshold_money, msg = cls.__get_threshmoney(code) |
| | | |
| | | # _start_time = l2_data_log.l2_time(code, tool.get_now_timestamp() - _start_time, "m值阈值计算") |
| | | |
| | | # 买入纯买额统计 |
| | | new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new, not_buy_msg = None, None, None, None, [], "" |
| | | |
| | | # 设置为总卖额 |
| | | new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, threshold_money_new, max_num_set_new, not_buy_msg = cls.__sum_buy_num_for_order_active( |