| | |
| | | from third_data.kpl_limit_up_data_manager import CodeLimitUpSequenceManager |
| | | from third_data.kpl_util import KPLDataType |
| | | from third_data.third_blocks_manager import CodeThirdBlocksManager, SOURCE_TYPE_KPL, BlockMapManager |
| | | from trade import trade_manager, l2_trade_util, trade_data_manager, trade_constant |
| | | from trade import trade_manager, l2_trade_util, trade_data_manager, trade_constant, trade_record_log_util |
| | | import l2_data_util as l2_data_util_old |
| | | from trade.buy_money_count_setting import BuyMoneyAndCountSetting, RadicalBuyBlockCodeCountManager |
| | | from trade.buy_radical import block_special_codes_manager |
| | | from trade.buy_radical import block_special_codes_manager, radical_buy_data_manager |
| | | |
| | | from trade.huaxin import huaxin_trade_api, huaxin_trade_data_update, \ |
| | | huaxin_trade_record_manager, huaxin_trade_order_processor, huaxin_sell_util |
| | |
| | | fresult = {"code": 0} |
| | | if code_list_type == outside_api_command_manager.CODE_LIST_WANT: |
| | | if operate == outside_api_command_manager.OPERRATE_SET: |
| | | trade_record_log_util.add_want_buy(code) |
| | | gpcode_manager.WantBuyCodesManager().add_code(code) |
| | | if l2_trade_util.is_in_forbidden_trade_codes(code): |
| | | l2_trade_util.remove_from_forbidden_trade_codes(code) |
| | |
| | | if results: |
| | | gpcode_manager.CodesNameManager.add_first_code_name(code, results[code]) |
| | | elif operate == outside_api_command_manager.OPERRATE_DELETE: |
| | | trade_record_log_util.remove_want_buy(code) |
| | | gpcode_manager.WantBuyCodesManager().remove_code(code) |
| | | elif operate == outside_api_command_manager.OPERRATE_GET: |
| | | codes = gpcode_manager.WantBuyCodesManager().list_code_cache() |
| | |
| | | elif code_list_type == outside_api_command_manager.CODE_LIST_MUST_BUY: |
| | | if operate == outside_api_command_manager.OPERRATE_SET: |
| | | gpcode_manager.MustBuyCodesManager().add_code(code) |
| | | trade_record_log_util.add_must_buy(code, "手动拉红") |
| | | name = gpcode_manager.get_code_name(code) |
| | | if not name: |
| | | results = HistoryKDatasUtils.get_gp_codes_names([code]) |
| | |
| | | latest_trading_date = history_k_data_util.get_k_bar_dead_date() |
| | | codes = HistoryKDataManager().get_history_bars_codes(latest_trading_date) |
| | | count = len(codes) |
| | | logger_debug.info(f"K线代码数量:{count}") |
| | | fdata["today_history_k_bar_count"] = count |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | fdata["today_history_k_bar_count"] = -1 |
| | | |
| | | # 获取数据服务器是否联通 |
| | |
| | | "radical_buy": {"price": (constant.MIN_CODE_RADICAL_BUY_PRICE, constant.MAX_CODE_RADICAL_BUY_PRICE), |
| | | "zyltgb": constant.RADICAL_BUY_ZYLTGB_AS_YI_RANGES, |
| | | "top_block_count_by_market_strong": constant.RADICAL_BUY_TOP_IN_COUNT_BY_MARKET_STRONG, |
| | | "special_codes_max_block_in_rank": constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL |
| | | "special_codes_max_block_in_rank": constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL, |
| | | "ignore_block_in_money_market_strong":constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG |
| | | }} |
| | | self.send_response({"code": 0, "data": data, "msg": f""}, |
| | | client_id, |
| | |
| | | if radical_buy.get("special_codes_max_block_in_rank"): |
| | | constant.RADICAL_BUY_TOP_IN_INDEX_WITH_SPECIAL = radical_buy.get( |
| | | "special_codes_max_block_in_rank") |
| | | |
| | | if radical_buy.get('ignore_block_in_money_market_strong') is not None: |
| | | constant.IGNORE_BLOCK_IN_MONEY_MARKET_STRONG = radical_buy.get('ignore_block_in_money_market_strong') |
| | | self.send_response({"code": 0, "data": {}, "msg": f""}, |
| | | client_id, |
| | | request_id) |
| | |
| | | |
| | | elif ctype == "test_place_order": |
| | | # 获取相同板块的涨停代码数量 |
| | | # code = data.get("code") |
| | | code = data.get("code") |
| | | # total_datas = l2_data_util.local_today_datas.get(code) |
| | | # trade_manager.test_order(code, total_datas[-1], total_datas[-1]["index"]) |
| | | # radical_buy_data_manager.pull_pre_deal_big_orders(code) |
| | | self.send_response({"code": 0, "data": {}}, |
| | | client_id, |
| | | request_id) |