| | |
| | | |
| | | @classmethod |
| | | def __cancel_buy(cls, code): |
| | | with cls.__buy_lock_dict[code]: |
| | | try: |
| | | l2_log.debug(code, "开始执行撤单") |
| | | trade_manager.start_cancel_buy(code) |
| | |
| | | # 买入纯买额统计 |
| | | new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, max_num_set_new, not_buy_msg = None, None, None, None, [], "" |
| | | if order_begin_pos.mode == OrderBeginPosInfo.MODE_ACTIVE: |
| | | threshold_money = order_begin_pos.threshold_money |
| | | # 设置为总卖额 |
| | | threshold_money = order_begin_pos.sell_info[0] |
| | | new_buy_exec_index, buy_nums, buy_count, rebegin_buy_pos, threshold_money_new, max_num_set_new, not_buy_msg = cls.__sum_buy_num_for_order_active( |
| | | code, |
| | | start_process_index, |
| | |
| | | start_time_str = total_datas[start_index]["val"]["time"] |
| | | # 获取最近的总卖信息 |
| | | refer_sell_data = cls.__L2MarketSellManager.get_refer_sell_data(code, start_time_str) |
| | | if code.find("60") == 0: |
| | | if refer_sell_data is None: |
| | | # 设置默认卖信息 |
| | | refer_sell_data = (start_time_str, 0, 0, (round(float(total_datas[start_index]["val"]["price"]), 2), 0)) |
| | | # 上证:只要有一个涨停买的就是信号 |
| | | for i in range(start_index, end_index + 1): |
| | | _val = total_datas[i]["val"] |
| | | if not L2DataUtil.is_limit_up_price_buy(_val): |
| | | continue |
| | | # 时间要>=09:30:00 |
| | | if tool.trade_time_sub(_val["time"], "09:30:00") < 0: |
| | | continue |
| | | # 金额要大于50万 |
| | | if _val["num"] * float(_val["price"]) < 5000: |
| | | continue |
| | | return True, i, [refer_sell_data[0], 0] |
| | | else: |
| | | # 深证 |
| | | if refer_sell_data is None and start_time_str != '09:30:00': |
| | | return False, -1, "总卖为空" |
| | | if refer_sell_data is None: |
| | |
| | | # 金额要大于50万 |
| | | if _val["num"] * float(_val["price"]) < 5000: |
| | | continue |
| | | if last_index is None or (total_datas[last_index]["val"]["time"] == total_datas[i]["val"]["time"]): |
| | | if last_index is None or ( |
| | | total_datas[last_index]["val"]["time"] == total_datas[i]["val"]["time"]): |
| | | if code.find("00") == 0 and threshold_money > 0: |
| | | # 深证非板上放量需要判断是否有信号 |
| | | single = place_order_single_data_manager.L2TradeSingleDataManager.get_valid_trade_single(code, |
| | | single = place_order_single_data_manager.L2TradeSingleDataManager.get_valid_trade_single( |
| | | code, |
| | | tool.to_time_with_ms( |
| | | _val['time'], |
| | | _val['tms'])) |
| | |
| | | count = 0 |
| | | start = None |
| | | return False, -1, "未获取到激进买的起始信号" |
| | | else: |
| | | return False, -1, "不可激进买" |
| | | |
| | | @classmethod |
| | | def __get_threshmoney(cls, code): |
| | |
| | | if code.find("00") == 0 and threshold_money > 0: |
| | | # 深证非板上放量 |
| | | max_space_time_ms = 1 * 1000 |
| | | # 不看纯买额 |
| | | threshold_num = 0 |
| | | |
| | | # 不下单的信息 |