| | |
| | | import inited_data |
| | | import outside_api_command_manager |
| | | from cancel_strategy.s_l_h_cancel_strategy import SCancelBigNumComputer, LCancelRateManager |
| | | from code_attribute import gpcode_manager, code_volumn_manager, zyltgb_util |
| | | from code_attribute import gpcode_manager, code_volumn_manager, zyltgb_util, code_nature_analyse |
| | | from code_attribute.code_data_util import ZYLTGBUtil |
| | | from code_attribute.code_l1_data_manager import L1DataManager |
| | | from code_attribute.gpcode_manager import CodePrePriceManager, CodesNameManager, WantBuyCodesManager, \ |
| | | HumanRemoveForbiddenManager |
| | | HumanRemoveForbiddenManager, HumanForbiddenManager |
| | | from db import mysql_data_delegate as mysql_data, redis_manager_delegate as redis_manager |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from huaxin_client import l1_subscript_codes_manager |
| | |
| | | from trade.trade_data_manager import RadicalBuyDealCodesManager |
| | | from trade.trade_manager import TradeTargetCodeModeManager, AutoCancelSellModeManager |
| | | from settings.trade_setting import MarketSituationManager, TradeBlockBuyModeManager |
| | | from utils import socket_util, data_export_util, tool, huaxin_util, output_util, global_util |
| | | from utils import socket_util, data_export_util, tool, huaxin_util, output_util, global_util, init_data_util |
| | | from servers import server_util |
| | | |
| | | |
| | |
| | | l2_trade_util.remove_from_forbidden_trade_codes(code) |
| | | # 加想买单要从黑名单移除 |
| | | HumanRemoveForbiddenManager().add_code(code) |
| | | HumanForbiddenManager().remove_code(code) |
| | | name = gpcode_manager.get_code_name(code) |
| | | if not name: |
| | | results = HistoryKDatasUtils.get_gp_codes_names([code]) |
| | |
| | | l2_trade_util.forbidden_trade(code, msg="手动加入 trade_server", force=True) |
| | | WantBuyCodesManager().remove_code(code) |
| | | HumanRemoveForbiddenManager().remove_code(code) |
| | | HumanForbiddenManager().add_code(code) |
| | | name = gpcode_manager.get_code_name(code) |
| | | if not name: |
| | | results = HistoryKDatasUtils.get_gp_codes_names([code]) |
| | |
| | | elif operate == outside_api_command_manager.OPERRATE_DELETE: |
| | | l2_trade_util.remove_from_forbidden_trade_codes(code) |
| | | HumanRemoveForbiddenManager().add_code(code) |
| | | HumanForbiddenManager().remove_code(code) |
| | | elif operate == outside_api_command_manager.OPERRATE_GET: |
| | | codes = gpcode_manager.BlackListCodeManager().list_codes_cache() |
| | | datas = [] |
| | |
| | | fresult = {"code": 0, "data": datas} |
| | | elif code_list_type == outside_api_command_manager.CODE_LIST_WHITE: |
| | | if operate == outside_api_command_manager.OPERRATE_SET: |
| | | gpcode_manager.WhiteListCodeManager().add_code(code) |
| | | gpcode_manager.WhiteListCodeManager().add_code(code, is_human=True) |
| | | name = gpcode_manager.get_code_name(code) |
| | | if not name: |
| | | results = HistoryKDatasUtils.get_gp_codes_names([code]) |
| | | if results: |
| | | gpcode_manager.CodesNameManager.add_first_code_name(code, results[code]) |
| | | elif operate == outside_api_command_manager.OPERRATE_DELETE: |
| | | gpcode_manager.WhiteListCodeManager().remove_code(code) |
| | | gpcode_manager.WhiteListCodeManager().remove_code(code, is_human=True) |
| | | elif operate == outside_api_command_manager.OPERRATE_GET: |
| | | codes = gpcode_manager.WhiteListCodeManager().list_codes_cache() |
| | | datas = [] |
| | |
| | | filter_blocks, match_blocks = RadicalBuyBlockManager.get_code_blocks(code) |
| | | source_origin_dict[SOURCE_TYPE_KPL] = kpl_blocks |
| | | source_dict[SOURCE_TYPE_KPL] = BlockMapManager().filter_blocks(kpl_blocks) |
| | | |
| | | dates = HistoryKDatasUtils.get_latest_trading_date_cache(5) |
| | | latest_trading_date = None |
| | | is_new_top = False |
| | | if dates: |
| | | latest_trading_date = dates[0] |
| | | if latest_trading_date: |
| | | volumes_data = HistoryKDataManager().get_history_bars(code, latest_trading_date) |
| | | if volumes_data: |
| | | is_new_top = code_nature_analyse.is_new_top(code, |
| | | gpcode_manager.get_limit_up_price_by_preprice(code, |
| | | volumes_data[0]["close"]), |
| | | volumes_data) |
| | | |
| | | data = { |
| | | "blocks": {}, |
| | | "origin_blocks": {}, |
| | | "match_blocks": [list(filter_blocks), list(match_blocks)], |
| | | # 板块净流入情况 |
| | | "block_in_moneys": [RealTimeKplMarketData.get_block_info_at_block_in(b) for b in filter_blocks] |
| | | "block_in_moneys": [RealTimeKplMarketData.get_block_info_at_block_in(b) for b in filter_blocks], |
| | | # 是否是突破板 |
| | | "is_new_top": is_new_top |
| | | } |
| | | for s in source_origin_dict: |
| | | data["origin_blocks"][s] = list(source_origin_dict[s]) |