| | |
| | | @tool.singleton |
| | | class HumanRemoveForbiddenManager: |
| | | """ |
| | | 认为移黑管理 |
| | | 人为移黑管理 |
| | | """ |
| | | __db = 0 |
| | | redisManager = redis_manager.RedisManager(0) |
| | |
| | | """ |
| | | 设置最近成交的涨停卖被动成交数据 |
| | | @param code: 代码 |
| | | @param data: L2逐笔成交数据 数据格式:(data['SecurityID'], data['TradePrice'], data['TradeVolume'], |
| | | @param fdata: L2逐笔成交数据 数据格式:(data['SecurityID'], data['TradePrice'], data['TradeVolume'], |
| | | # data['OrderTime'], data['MainSeq'], data['SubSeq'], data['BuyNo'], |
| | | # data['SellNo'], data['ExecType']) |
| | | @param big_active_buy_order_datas: 大主动买单数据:[[买单号,当前成交股数, 当前成交金额, 开始时间, 结束时间],....] |
| | |
| | | response_data = json.dumps({"code": 0, "data": fdata}) |
| | | elif url.path == "/get_want_buy_detail_list": |
| | | # 获取想买单详细信息 |
| | | |
| | | try: |
| | | history_limit_up_datas = LimitUpDataConstant.history_limit_up_datas |
| | | codes = set() |
| | | if history_limit_up_datas: |
| | |
| | | fdatas = [] |
| | | yesterday_codes = kpl_data_manager.get_yesterday_limit_up_codes() |
| | | for code in codes: |
| | | try: |
| | | if code in yesterday_codes: |
| | | continue |
| | | # (代码,名称,涨停时间,涨幅,现手,自由市值,现价) |
| | | data = [code, gpcode_manager.get_code_name(code)] |
| | | limit_up_time = LimitUpDataConstant.get_first_limit_up_time(code) |
| | |
| | | zylt_volume = global_util.zylt_volume_map.get(code) |
| | | zyltgb = zylt_volume * limit_up_price |
| | | if latest_transaction_data: |
| | | data.append((latest_transaction_data[2]//100, latest_transaction_data[6] - latest_transaction_data[7])) |
| | | data.append( |
| | | (latest_transaction_data[2] // 100, latest_transaction_data[6] - latest_transaction_data[7])) |
| | | else: |
| | | data.append(("--", 0)) |
| | | data.append(output_util.money_desc(zyltgb) if zyltgb else '--') |
| | |
| | | if blocks: |
| | | blocks_info=[] |
| | | for b in blocks: |
| | | info = radical_buy_data_manager.RadicalBuyBlockManager.get_history_index(code,b, yesterday_codes) |
| | | info = radical_buy_data_manager.RadicalBuyBlockManager.get_history_index(code, b, |
| | | yesterday_codes) |
| | | blocks_info.append((b,info[0],info[2])) |
| | | max_info = max(blocks_info, key= lambda x:x[2]) |
| | | block_rank_info = max_info |
| | |
| | | pass |
| | | data.append(block_rank_info) |
| | | fdatas.append(data) |
| | | |
| | | |
| | | |
| | | except Exception as e1: |
| | | logger_debug.exception(e1) |
| | | fdatas.sort(key=lambda x: x[2] if x[2] else time.time()) |
| | | response_data = json.dumps({"code": 0, "data": fdatas}) |
| | | |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | async_log_util.info(logger_request_api, f"结束请求{tool.get_thread_id()}-{url}") |
| | | self.send_response(200) |
| | | # 发给请求客户端的响应数据 |
| | |
| | | __radical_buy_by_blocks_result_cache = {} |
| | | |
| | | def OnTradeSingle(self, code, big_buy_order_count, _type, data): |
| | | """ |
| | | 最近涨停卖被吃掉 |
| | | @param code: |
| | | @param big_buy_order_count: |
| | | @param _type: |
| | | @param data: |
| | | @return: |
| | | """ |
| | | # 暂时不处理 |
| | | if True: |
| | | return |
| | |
| | | continue |
| | | if code in yesterday_codes: |
| | | continue |
| | | if l2_trade_util.is_in_forbidden_trade_codes(code): |
| | | if gpcode_manager.HumanForbiddenManager().is_in_cache(code): |
| | | # 人为拉黑的不加想 |
| | | continue |
| | | if gpcode_manager.WantBuyCodesManager().is_in_cache(code): |
| | | continue |
| | |
| | | if max_price > limit_up_price: |
| | | # 非15日突破 |
| | | continue |
| | | volumes = init_data_util.parse_max_volume_new(code, volumes_data) |
| | | max_volume, max_volume_day = init_data_util.parse_max_volume_in_days(volumes_data, days_count) |
| | | # volumes = init_data_util.parse_max_volume_new(code, volumes_data) |
| | | # max_volume, max_volume_day = init_data_util.parse_max_volume_in_days(volumes_data, days_count) |
| | | # 最大量,今日量 |
| | | today_volume = CodeVolumeManager().get_today_volumn_cache(code) |
| | | if today_volume / max_volume < 0.3: |
| | | continue |
| | | # today_volume = CodeVolumeManager().get_today_volumn_cache(code) |
| | | # if today_volume / max_volume < 0.3: |
| | | # continue |
| | | logger_debug.info("自动加想") |
| | | gpcode_manager.WantBuyCodesManager().add_code(code) |
| | | trade_record_log_util.add_want_buy(code, "自动加") |
| | |
| | | # 高位板 |
| | | if code in yesterday_limit_up_codes: |
| | | return -1 |
| | | if not gpcode_manager.WantBuyCodesManager().is_in_cache(code): |
| | | # 只订阅加想的票 |
| | | return -1 |
| | | # 黑名单 |
| | | trade_state = trade_manager.CodesTradeStateManager().get_trade_state_cache(code) |
| | | # 处于委托状态的必须订阅 |