| | |
| | | from l2.huaxin import huaxin_target_codes_manager |
| | | from log_module.log import hx_logger_trade_debug |
| | | from third_data import block_info |
| | | from third_data.history_k_data_util import HistoryKDatasUtils |
| | | from third_data.history_k_data_util import HistoryKDatasUtils, JueJinApi |
| | | from trade import trade_manager, trade_huaxin |
| | | |
| | | from trade.huaxin import huaxin_trade_api as trade_api, huaxin_trade_api, huaxin_trade_record_manager |
| | |
| | | inited_data.everyday_init() |
| | | return_str = json.dumps( |
| | | {"code": 0, "data": {}, "msg": ""}) |
| | | elif type_ == 'huaxin_channel_state': |
| | | # 华鑫通道状态 |
| | | types = [huaxin_trade_api.ClientSocketManager.CLIENT_TYPE_TRADE, |
| | | huaxin_trade_api.ClientSocketManager.CLIENT_TYPE_CMD_L2, |
| | | huaxin_trade_api.ClientSocketManager.CLIENT_TYPE_DEAL_LIST, |
| | | huaxin_trade_api.ClientSocketManager.CLIENT_TYPE_DELEGATE_LIST, |
| | | huaxin_trade_api.ClientSocketManager.CLIENT_TYPE_MONEY, |
| | | huaxin_trade_api.ClientSocketManager.CLIENT_TYPE_POSITION_LIST] |
| | | fdata = {} |
| | | for t in types: |
| | | trade_list = huaxin_trade_api.ClientSocketManager.list_client(t) |
| | | fdata[t] = len(trade_list) |
| | | elif type_ == 'juejin_is_valid': |
| | | # 掘金是否可用 |
| | | try: |
| | | date = JueJinApi.get_previous_trading_date(tool.get_now_date_str()) |
| | | if date: |
| | | return_str = json.dumps( |
| | | {"code": 0, "msg": ""}) |
| | | except Exception as e: |
| | | return_str = json.dumps( |
| | | {"code": 0, "msg": str(e)}) |
| | | # 查询委托列表 |
| | | elif type_ == 'test': |
| | | # 卖出 |