| | |
| | | transaction_progress, cancel_buy_strategy, place_order_single_data_manager |
| | | from l2.cancel_buy_strategy import DCancelBigNumComputer, \ |
| | | LatestCancelIndexManager, \ |
| | | NewGCancelBigNumComputer, JCancelBigNumComputer |
| | | NewGCancelBigNumComputer, JCancelBigNumComputer, L2DataComputeUtil |
| | | from l2.l2_data_manager import L2DataException, OrderBeginPosInfo |
| | | from l2.l2_data_util import local_today_datas, L2DataUtil, local_today_num_operate_map, local_today_buyno_map, \ |
| | | local_latest_datas, local_today_canceled_buyno_map, local_today_sellno_map |
| | |
| | | # # 14:00:00后只打老大的回封 |
| | | # return False, True, f"14:00:00不打回封" |
| | | |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | limit_up_price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | |
| | | if constant.MIN_CODE_PRICE < float(limit_up_price) < constant.MAX_CODE_PRICE: |
| | | if constant.MIN_CODE_PRICE < limit_up_price < constant.MAX_CODE_PRICE: |
| | | # 满足条件的单价 |
| | | pass |
| | | elif float(limit_up_price) > constant.MAX_CODE_PRICE: |
| | | elif limit_up_price > constant.MAX_CODE_PRICE: |
| | | # HighIncreaseCodeManager().add_code(code) |
| | | # 小市值高股价可买 |
| | | zyltgb = global_util.zyltgb_map.get(code) |
| | | if zyltgb > 25e8 or float(limit_up_price) > constant.MAX_SUBSCRIPT_CODE_PRICE: |
| | | if zyltgb > 25e8 or limit_up_price > constant.MAX_SUBSCRIPT_CODE_PRICE: |
| | | return False, True, f"股价大于{constant.MAX_CODE_PRICE}块/小于{constant.MIN_CODE_PRICE}块" |
| | | else: |
| | | return False, True, f"股价小于{constant.MIN_CODE_PRICE}块" |
| | |
| | | min_money=min_money) |
| | | if left_count < 1: |
| | | return False, False, f"没有已挂或者成交的大单" |
| | | place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code) |
| | | # 第一和第二次下单都必须要有至少一笔未成交/待成交的大单 |
| | | # 计算大单 |
| | | if place_order_count < 2: |
| | | trade_index, is_default = transaction_progress.TradeBuyQueue().get_traded_index(code) |
| | | if trade_index is None: |
| | | trade_index = 0 |
| | | total_datas = local_today_datas.get(code) |
| | | min_money = l2_data_util.get_big_money_val(limit_up_price, tool.is_ge_code(code)) |
| | | left_count, left_num = L2DataComputeUtil.compute_left_buy_order(code, trade_index, |
| | | total_datas[-1]["index"], |
| | | limit_up_price, min_money) |
| | | if left_count < 1: |
| | | return False, False, f"第{place_order_count+1}下单无待成交的大单" |
| | | |
| | | # 暂时注释想买单功能 |
| | | if not cls.__WantBuyCodesManager.is_in_cache(code): |
| | |
| | | |
| | | @classmethod |
| | | def can_buy_first_new(cls, code, limit_up_price): |
| | | |
| | | now_timestamp = int(tool.get_now_time_str().replace(":", "")) |
| | | # 判断板块 |
| | | # (可以买的板块列表, 是否是独苗, 消息简介,可买的强势主线, 板块关键词) |
| | |
| | | # 后排,满足自由流通市值需要下单 |
| | | return True, False, can_buy_result[2] |
| | | else: |
| | | place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code) |
| | | |
| | | if place_order_count > 0: |
| | | return True, False, "之前下过单" |
| | | if not can_buy_result[0]: |
| | |
| | | return None, buy_nums, buy_count, ii, max_buy_num_set, f"【{i}】信号不连续,囊括时间-{max_space_time_ms}ms" |
| | | # 涨停买 |
| | | if L2DataUtil.is_limit_up_price_buy(_val): |
| | | if l2_data_util.is_big_money(_val,is_ge_code): |
| | | if l2_data_util.is_big_money(_val, is_ge_code): |
| | | max_buy_num_set.add(i) |
| | | if _val["num"] >= bigger_num: |
| | | trigger_buy = True |