| | |
| | | cls.__process_order(code, start_index, end_index, capture_timestamp, is_first_code) |
| | | else: |
| | | # 未挂单,时间相差不大才能挂单 |
| | | if tool.trade_time_sub(latest_time, "09:32:00") < 0 or l2.l2_data_util.L2DataUtil.is_same_time(now_time_str, latest_time): |
| | | #if tool.trade_time_sub(latest_time, "09:32:00") < 0 or l2.l2_data_util.L2DataUtil.is_same_time(now_time_str, latest_time): |
| | | cls.__process_not_order(code, start_index, end_index, capture_timestamp, is_first_code) |
| | | |
| | | async_log_util.info(logger_l2_process, "code:{} 处理数据范围: {}-{} 处理时间:{} 截图时间戳:{}", code, |
| | |
| | | # # 股价新高或者逼近前高 |
| | | # order_begin_pos.threshold_money = int(sell_info[1]) |
| | | # else: |
| | | if float(total_datas[buy_single_index]["val"]["price"]) >= 3 and cls.volume_rate_info[code][ |
| | | 0] > 0.3 and sell_info[1] > 2000 * 10000 and int( |
| | | tool.get_now_time_str().replace(":", "")) < int("100000"): |
| | | # 暂时打8折 |
| | | # order_begin_pos.threshold_money = int(sell_info[1] * 0.8) |
| | | # 深证总卖大于1000万的票,m值打5折 |
| | | # if float(total_datas[buy_single_index]["val"]["price"]) >= 3 and cls.volume_rate_info[code][ |
| | | # 0] > 0.3 and sell_info[1] > 2000 * 10000 and int( |
| | | # tool.get_now_time_str().replace(":", "")) < int("100000"): |
| | | if sell_info[1] > 2000 * 10000: |
| | | if code.find('00') == 0: |
| | | # 深圳首次下单打折 |
| | | place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(code) |
| | |
| | | def __cancel_buy_for_too_far(): |
| | | while True: |
| | | try: |
| | | # 获取账户可用资金 |
| | | account_available_money = trade_manager.AccountAvailableMoneyManager().get_available_money_cache() |
| | | if account_available_money is not None and account_available_money > constant.BUY_MONEY_PER_CODE: |
| | | continue |
| | | can_cancel_codes = [] |
| | | current_delegates = huaxin_trade_record_manager.DelegateRecordManager().list_current_delegates() |
| | | for c in current_delegates: |
| | | if int(c["direction"]) != huaxin_util.TORA_TSTP_D_Buy: |
| | |
| | | buy1_money = 0 |
| | | if buy1_money > 0: |
| | | total_left_money = total_left_num * 100 * float(limit_up_price) |
| | | if total_left_money > buy1_money * 2 / 3: |
| | | l2_data_manager_new.L2TradeDataProcessor.cancel_buy(code, "下单距离太远") |
| | | rate = total_left_money / buy1_money |
| | | if rate > 0.66: |
| | | can_cancel_codes.append((code, rate)) |
| | | if can_cancel_codes: |
| | | can_cancel_codes.sort(key=lambda x: x[1], reverse=True) |
| | | l2_data_manager_new.L2TradeDataProcessor.cancel_buy(can_cancel_codes[0][0], "下单距离太远") |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | finally: |