| | |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | if limit_up_price is None: |
| | | raise Exception("涨停价无法获取") |
| | | limit_up_price = float(limit_up_price) |
| | | |
| | | threshold_num = None |
| | | # 大目标手数(满足这个就不需要看安全笔数) |
| | | threshold_max_num = None |
| | | |
| | | # 目标订单数量 |
| | | threshold_count = cls.__l2PlaceOrderParamsManagerDict[code].get_safe_count() |
| | | |
| | | # 最大间隔时间ms |
| | | max_space_time_ms = cls.__l2PlaceOrderParamsManagerDict[code].get_time_range() * 1000 |
| | | |
| | | # ----------------调整板上下单的m值与安全笔数---------------- |
| | | if at_limit_up: |
| | | # 板上买,获取最近一次闪电下单的总卖额 |
| | |
| | | # 总卖的一半作为m值 |
| | | threshold_num = int(sell_data[1] / (limit_up_price * 100)) // 2 |
| | | threshold_max_num = 1 |
| | | # 信号为之前有待成交的大单(不是正在成交) |
| | | trade_index,is_default = cls.__TradeBuyQueue.get_traded_index(code) |
| | | if not is_default and trade_index is not None: |
| | | temp_big_num = int(30000/limit_up_price) |
| | | 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 |
| | | # 判断是否有大单未成交 |
| | | if temp_big_num > val["num"]: |
| | | 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)) |
| | | if left_count > 0: |
| | | # 安全笔数与囊括时间范围修改 |
| | | threshold_count = 3 |
| | | max_space_time_ms = 9*1000 |
| | | break |
| | | |
| | | |
| | | |
| | | if not threshold_num: |
| | | # 目标手数 |
| | |
| | | threshold_max_num = int(threshold_num * 1.2) |
| | | |
| | | # place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code) |
| | | # 目标订单数量 |
| | | threshold_count = cls.__l2PlaceOrderParamsManagerDict[code].get_safe_count() |
| | | |
| | | |
| | | # buy_single_time_seconds = L2DataUtil.get_time_as_second(total_datas[buy_single_index]["val"]["time"]) |
| | | |
| | | # 可以触发买,当有涨停买信号时才会触发买 |
| | | trigger_buy = True |
| | | |
| | | # 最大间隔时间ms |
| | | max_space_time_ms = cls.__l2PlaceOrderParamsManagerDict[code].get_time_range() * 1000 |
| | | |
| | | # 如果大单含有率大于50%,则时间囊括范围提高到3s |
| | | if max_num_set and origin_count: |
| | | if len(max_num_set) / origin_count > 0.5: |