| | |
| | | half_must_buy = False |
| | | if not must_buy: |
| | | try: |
| | | can_buy_result =code_plate_key_manager.CodePlateKeyBuyManager.can_buy(code) |
| | | can_buy_result = code_plate_key_manager.CodePlateKeyBuyManager.can_buy(code) |
| | | if can_buy_result and can_buy_result[0]: |
| | | if can_buy_result[0][1] <= 1 and can_buy_result[0][2] >= 3: |
| | | # 炸板率>60%以上就不加半红 |
| | |
| | | break |
| | | |
| | | changed = True |
| | | __last_l_up_compute_info = self.__last_l_up_compute_info.get(code) |
| | | if __last_l_up_compute_info: |
| | | if __last_l_up_compute_info == watch_indexes: |
| | | l_up_compute_info = self.__last_l_up_compute_info.get(code) |
| | | if l_up_compute_info: |
| | | if l_up_compute_info[1] == watch_indexes: |
| | | changed = False |
| | | # 保存数据 |
| | | if changed: |
| | | threshold_time = 1 if tool.is_sz_code(code) else 2 |
| | | if time.time() - __last_l_up_compute_info[0] < threshold_time: |
| | | l2_log.l_cancel_debug(code, f"L前监控更新太频繁:{threshold_time}") |
| | | return |
| | | if l_up_compute_info: |
| | | if time.time() - l_up_compute_info[0] < threshold_time: |
| | | l2_log.l_cancel_debug(code, f"L前监控更新太频繁:{threshold_time}") |
| | | return |
| | | l2_log.l_cancel_debug(code, f"L前监控范围:{watch_indexes} 计算范围:{start_index}-{end_index}") |
| | | self.__set_near_by_trade_progress_indexes(code, buy_single_index, watch_indexes) |
| | | self.__last_l_up_compute_info[code] = (time.time(), watch_indexes) |
| | |
| | | if str(wi) in after_place_order_index_dict: |
| | | # 真实下单位置之后的按照权重比例来计算 |
| | | canceled_num += total_data[wi]["val"]["num"] * ( |
| | | 10 - after_place_order_index_dict[str(wi)]) // 10 |
| | | 10 - after_place_order_index_dict[str(wi)]) // 10 |
| | | else: |
| | | canceled_num += total_data[wi]["val"]["num"] |
| | | |