| | |
| | | # return False, f"开1数量:{count},前排代码未下过单:{pre_code}" |
| | | # return True, f"开1数量:{count},前排代码尚未成交:{history_before_codes_info[0]}" |
| | | # return True, f"开1数量:{count},前排代码不可买:{history_before_codes_info[0]},历史前排-{history_before_codes_info},开1代码-{open_limit_up_block_codes}" |
| | | # 曾涨停有后排才能买 |
| | | if not cls.__is_have_back_codes(code, block): |
| | | return False, f"【{block}】无后排" |
| | | return True, f"开1数量:{count},历史-{history_index + 1} 实时-{current_index + 1}, 前排代码-{current_before_codes_info},开1代码-{open_limit_up_block_codes}" |
| | | |
| | | @classmethod |
| | |
| | | if code_ in BlockPlaceOrderRecordManager().get_codes() and code_ not in deal_codes: |
| | | return True |
| | | return False |
| | | |
| | | @classmethod |
| | | def __is_have_back_codes(cls, code, block): |
| | | """ |
| | | 板块是否有后排代码 |
| | | @param code: |
| | | @param block: |
| | | @return: |
| | | """ |
| | | codes = LimitUpDataConstant.get_history_limit_up_block_codes(block) |
| | | has_back = False |
| | | limit_up_timestamp = cls.__get_limit_up_timestamp(code) |
| | | if codes: |
| | | for c in codes: |
| | | if c == code: |
| | | continue |
| | | if cls.__get_limit_up_timestamp(c) > limit_up_timestamp: |
| | | has_back = True |
| | | break |
| | | return has_back |
| | | |
| | | @classmethod |
| | | def __is_radical_buy_with_block_up(cls, code, block, yesterday_limit_up_codes): |
| | |
| | | deal_codes = RadicalBuyDealCodesManager().get_deal_codes() |
| | | if pre_code in deal_codes: |
| | | return False, f"前排代码已成交:{pre_code}" |
| | | if not cls.__is_have_back_codes(code, block): |
| | | return False, f"【{block}】无后排" |
| | | return True, f"被顺位代码({pre_code}) 尚未成交" |
| | | |
| | | # pre_code不能买,才能买 |
| | |
| | | else: |
| | | # 代码为目标代码 |
| | | pass |
| | | if not cls.__is_have_back_codes(code, block): |
| | | return False, f"【{block}】无后排" |
| | | return True, f"满足买入需求: 实时前排代码-{current_before_codes_info} 历史前排代码-{history_before_codes_info}" |
| | | |
| | | @classmethod |
| | |
| | | if codes and len(codes) >= 5: |
| | | return True, False |
| | | else: |
| | | codes = LimitUpDataConstant.get_history_limit_up_block_codes(code) |
| | | codes = LimitUpDataConstant.get_history_limit_up_block_codes(block) |
| | | if codes and len(codes) >= 3: |
| | | # 10点之后净流入是正才能订阅 |
| | | in_money = RealTimeKplMarketData.get_jx_block_in_money(block) |
| | |
| | | else: |
| | | current_big_order_deal_money = current_big_order_deal_money_info[0] |
| | | current_lack_money = max(0, int(current_threshold_money - current_big_order_deal_money)) |
| | | if for_buy: |
| | | if for_buy and not tool.is_ge_code(code): |
| | | # 要下单的且不是创业版的目标代码大单数量打8折 |
| | | total_lack_money = int(total_threshold_money * 0.8 - total_deal_money) |
| | | if total_lack_money < 0: |
| | | total_lack_money = 0 |