| | |
| | | from db import redis_manager |
| | | import ths_industry_util |
| | | import tool |
| | | from trade import trade_manager, trade_queue_manager, l2_trade_factor, l2_trade_util, \ |
| | | from third_data.code_plate_key_manager import CodePlateKeyBuyManager |
| | | from trade import trade_manager, trade_queue_manager, l2_trade_factor, l2_trade_util, \ |
| | | trade_result_manager, first_code_score_manager |
| | | from l2 import safe_count_manager, l2_data_manager, l2_data_log, l2_log, l2_data_source_util, code_price_manager |
| | | from l2.cancel_buy_strategy import SecondCancelBigNumComputer, HourCancelBigNumComputer, L2LimitUpMoneyStatisticUtil, \ |
| | |
| | | def h_cancel(): |
| | | _start_time = round(t.time() * 1000) |
| | | try: |
| | | b_need_cancel, b_cancel_data = HourCancelBigNumComputer.need_cancel(code,buy_single_index, buy_exec_index, start_index, |
| | | b_need_cancel, b_cancel_data = HourCancelBigNumComputer.need_cancel(code, buy_single_index, |
| | | buy_exec_index, start_index, |
| | | end_index, total_data, |
| | | local_today_num_operate_map.get( |
| | | code), |
| | |
| | | if buy1_price is None: |
| | | return False, True, f"尚未获取到买1价" |
| | | limit_up_price = gpcode_manager.get_limit_up_price(code) |
| | | |
| | | dif = float(limit_up_price) - float(buy1_price) |
| | | if zyltgb >= 80 * 100000000: |
| | | # 大于2档 |
| | |
| | | |
| | | if not gpcode_manager.WantBuyCodesManager.is_in(code): |
| | | |
| | | if float(limit_up_price) >= 40: |
| | | return False, True, "股价大于40块" |
| | | |
| | | # 判断板块 |
| | | plate_can_buy, msg = CodePlateKeyBuyManager.can_buy(code) |
| | | if not plate_can_buy: |
| | | return False, True, msg |
| | | |
| | | # 查看分数等级 |
| | | score_index = cls.__l2PlaceOrderParamsManagerDict[code].score_index |
| | | score = cls.__l2PlaceOrderParamsManagerDict[code].score |
| | |
| | | limit_up_time = score_info[1][7] |
| | | if limit_up_time is None: |
| | | limit_up_time = tool.get_now_time_str() |
| | | if int(limit_up_time.replace(":", "")) > int("143000"): |
| | | if not score_info[1][3][6][0]: |
| | | return False, True, f"尾盘偷跑:无任何形态" |
| | | if score_info[1][5]["limit_up_codes_count"] > 1: |
| | | return False, True, f"尾盘偷跑:板块{score_info[1][5]['target_block_info'][0]}-涨停数{score_info[1][5]['limit_up_codes_count']}" |
| | | if float(gpcode_manager.get_limit_up_price(code)) > 30: |
| | | return False, True, f"尾盘偷跑:股价大于30" |
| | | |
| | | # 尾盘偷跑暂时不要 |
| | | # if int(limit_up_time.replace(":", "")) > int("143000"): |
| | | # if not score_info[1][3][6][0]: |
| | | # return False, True, f"尾盘偷跑:无任何形态" |
| | | # if score_info[1][5]["limit_up_codes_count"] > 1: |
| | | # return False, True, f"尾盘偷跑:板块{score_info[1][5]['target_block_info'][0]}-涨停数{score_info[1][5]['limit_up_codes_count']}" |
| | | # if float(gpcode_manager.get_limit_up_price(code)) > 30: |
| | | # return False, True, f"尾盘偷跑:股价大于30" |
| | | |
| | | if score_index < 0: |
| | | return False, True, f"分值:{score}未达到需要买入的分数线" |
| | | if score_index >= 3: |
| | | return False, True, f"分值:{score}未达到主动买入分数线" |
| | | return True, False, "" |
| | | # if -1 < score_index < 3 and (0.499 <= cls.volume_rate_info[code][0] <= 0.949): |
| | | # return True, False, f"分值:{score}达到主动买入的分数线且量足够,买入等级:f{score_index},量比:{cls.volume_rate_info[code][0]}" |
| | | is_limited_up = gpcode_manager.FirstCodeManager.is_limited_up(code) |
| | | gpcode_manager.FirstCodeManager.add_limited_up_record([code]) |
| | | if not code_price_manager.Buy1PriceManager.is_can_buy(code): |
| | | return False, True, f"首板代码,没在想要买名单中且未打开涨停板,分数:{score}" |
| | | if not is_limited_up: |
| | | return False, True, f"首板代码,没在想要买名单中且未涨停过,分数:{score}" |
| | | # if score_index >= 3: |
| | | # return False, True, f"分值:{score}未达到主动买入分数线" |
| | | return True, False, "" |
| | | else: |
| | | return True, False, "在想买名单中" |