| | |
| | | from l2.place_order_single_data_manager import L2TradeSingleDataProcessor |
| | | from log_module import async_log_util, log_export |
| | | from third_data import kpl_data_manager, block_info |
| | | from third_data.kpl_data_constant import LimitUpDataConstant |
| | | from trade.buy_radical.radical_buy_data_manager import EveryLimitupBigDealOrderManager |
| | | from utils import global_util, tool, buy_condition_util, buy_strategy_util, trade_util |
| | | import l2_data_util |
| | |
| | | average_rate = cls.__Buy1PriceManager.get_average_rate(code) |
| | | if average_rate : |
| | | if tool.is_ge_code(code): |
| | | if average_rate <= 0.1: |
| | | return False, True, f"均价涨幅({average_rate})小于10%", True |
| | | if average_rate <= 0.07: |
| | | return False, True, f"均价涨幅({average_rate})小于7%", True |
| | | else: |
| | | if average_rate <= 0.05: |
| | | return False, True, f"均价涨幅({average_rate})小于5%", True |
| | | |
| | | if average_rate <= 0.03: |
| | | return False, True, f"均价涨幅({average_rate})小于3%", True |
| | | return True, False, f"", False |
| | | |
| | | @classmethod |
| | |
| | | def __buy(cls, code, capture_timestamp, last_data, last_data_index, is_first_code, block_info=None): |
| | | pre_result = cls.__is_pre_can_buy(code) |
| | | if not pre_result[0]: |
| | | l2_log.debug(code, "不可以下单,原因:{}", pre_result[2]) |
| | | return False |
| | | # 添加买入锁 |
| | | if code not in cls.__buy_lock_dict: |
| | |
| | | if refer_sell_data: |
| | | refer_sell_money = refer_sell_data[1] |
| | | # 大单判断结果 |
| | | history_limit_up_codes = LimitUpDataConstant.get_history_limit_up_codes() |
| | | if history_limit_up_codes is None: |
| | | history_limit_up_codes = set() |
| | | big_order_deal_enough_result = radical_buy_data_manager.is_big_order_deal_enough(code, |
| | | code_volumn_manager.CodeVolumeManager().get_volume_rate_refer_in_5days( |
| | | code), |
| | | refer_sell_money, |
| | | for_buy=True) |
| | | for_buy=True, is_first_limit_up = code not in history_limit_up_codes) |
| | | # 缺乏的大单金额 |
| | | lack_money = big_order_deal_enough_result[3] |
| | | # 如果有大单成交就不需要看大单 |