| | |
| | | from third_data.history_k_data_manager import HistoryKDataManager |
| | | from third_data.history_k_data_util import JueJinApi, HistoryKDatasUtils |
| | | from third_data.kpl_data_manager import KPLDataManager |
| | | from third_data.kpl_limit_up_data_manager import CodeLimitUpSequenceManager |
| | | from third_data.kpl_util import KPLDataType |
| | | from trade import trade_manager, l2_trade_util |
| | | from trade import trade_manager, l2_trade_util, trade_data_manager |
| | | import l2_data_util as l2_data_util_old |
| | | |
| | | from trade.huaxin import huaxin_trade_api, huaxin_trade_data_update, \ |
| | |
| | | except Exception as e: |
| | | self.send_response({"code": 1, "msg": str(e)}, client_id, request_id) |
| | | elif ctype == "get_delegated_buy_code_infos": |
| | | account_available_money = trade_manager.AccountAvailableMoneyManager().get_available_money_cache() |
| | | account_available_money = trade_data_manager.AccountMoneyManager().get_available_money_cache() |
| | | # 获取委托中的代码 |
| | | # current_delegates = huaxin_trade_record_manager.DelegateRecordManager().list_current_delegates() |
| | | current_delegates, update_time = huaxin_trade_record_manager.DelegateRecordManager.list_by_day( |
| | |
| | | limit_up_data = kpl_data_manager.KPLLimitUpDataRecordManager.record_code_dict.get(code) |
| | | # 获取当前板块 |
| | | try: |
| | | can_buy_result = CodePlateKeyBuyManager.can_buy(code) |
| | | if can_buy_result: |
| | | if can_buy_result[0]: |
| | | fdata['block'] = ",".join( |
| | | [f"{x[0]}-{x[1] + 1}({x[2]}&{x[3] - x[2]})" for x in can_buy_result[0]]) |
| | | else: |
| | | if can_buy_result[1]: |
| | | if limit_up_data: |
| | | fdata['block'] = f"{limit_up_data[5]}-独苗" |
| | | else: |
| | | fdata['block'] = f"独苗" |
| | | limit_up_sequence = CodeLimitUpSequenceManager.get_current_limit_up_sequence(code) |
| | | if limit_up_sequence: |
| | | fdata['block'] = f"{limit_up_sequence[0]}-{limit_up_sequence[1]}({limit_up_sequence[2]}&{limit_up_sequence[2] - limit_up_sequence[3]})" |
| | | except: |
| | | pass |
| | | # 获取涨停时间 |
| | |
| | | elif ctype == "get_buy_block_mode": |
| | | # 获取买入板块的模式 |
| | | can_buy_unique_block = TradeBlockBuyModeManager().can_buy_unique_block() |
| | | self.send_response({"code": 0, "data": {"unique_block": 1 if can_buy_unique_block else 0 }, "msg": f""}, client_id, |
| | | self.send_response({"code": 0, "data": {"unique_block": 1 if can_buy_unique_block else 0}, "msg": f""}, |
| | | client_id, |
| | | request_id) |
| | | |
| | | elif ctype == "set_buy_unique_block_mode": |