| | |
| | | sell_indexs = L2LimitUpSellManager().get_limit_up_sell_indexes(code) |
| | | if sell_indexs: |
| | | for index in sell_indexs: |
| | | total_sell_nums += total_datas[index]["val"]["num"] |
| | | total_sell_nums += total_datas[int(index)]["val"]["num"] |
| | | l2_log.l_cancel_debug(code, f"大单买-{total_deal_nums} 板上卖-{total_sell_nums}") |
| | | total_deal_nums -= total_sell_nums |
| | | if total_deal_nums < 0: |
| | |
| | | async_log_util.info(logger_kpl_block_can_buy, f"{code}:获取到精选板块-{blocks}") |
| | | else: |
| | | # 还没涨停的需要更新精选板块 更新精选板块 |
| | | if abs(float(buy_1_price) - float(limit_up_price)) >= 0.001 or True: |
| | | if abs(float(buy_1_price) - float(limit_up_price)) >= 0.001: |
| | | # 非涨停状态 |
| | | UPDATE_TIME_SPACE = 5 * 60 |
| | | time_diff = tool.trade_time_sub(tool.get_now_time_str(), "09:30:00") |
| | |
| | | time_str = datetime.datetime.now().strftime("%Y-%m-%d") + " 09:30:00" |
| | | timestamp = time.mktime(time.strptime(time_str, '%Y-%m-%d %H:%M:%S')) |
| | | limit_up_codes = set() |
| | | for k in limit_up_record_datas: |
| | | if code_block_dict.get(k[3]) == block: |
| | | if int(k[5]) < timestamp: |
| | | limit_up_codes.add(k[3]) |
| | | if limit_up_record_datas: |
| | | for k in limit_up_record_datas: |
| | | if code_block_dict.get(k[3]) == block: |
| | | if int(k[5]) < timestamp: |
| | | limit_up_codes.add(k[3]) |
| | | return limit_up_codes |
| | | |
| | | |
| | |
| | | operate = data["operate"] |
| | | if operate == outside_api_command_manager.OPERRATE_ADD: |
| | | data = data["data"] |
| | | rule = SellRule(code=data["code"], buy1_volume=data["buy1_volume"], sell_volume=data["sell_volume"], |
| | | code = data["code"] |
| | | buy1_price = data.get("buy1_price") |
| | | if not buy1_price: |
| | | buy1_price = gpcode_manager.get_limit_up_price(code) |
| | | if not buy1_price: |
| | | raise Exception("尚未获取到涨停价") |
| | | rule = SellRule(code=data["code"], buy1_volume=data["buy1_volume"], buy1_price=buy1_price, |
| | | sell_volume=data["sell_volume"], sell_price_type=data["sell_price_type"], |
| | | end_time=data["end_time"]) |
| | | SellRuleManager().add_rule(rule) |
| | | self.send_response({"code": 0, "data": {}}, client_id, request_id) |