| | |
| | | |
| | | import requests |
| | | |
| | | from api import outside_api_callback |
| | | from api.outside_api_command_manager import ApiCommandManager |
| | | from huaxin_client import l2_market_client, trade_client |
| | | from log_module.log import logger_debug |
| | | from server import data_server |
| | | from strategy.env_info import RealTimeEnvInfo |
| | | from third_data import hx_qc_value_util |
| | | from trade.huaxin import huaxin_trade_api |
| | | from utils import tool |
| | | from utils import tool, middle_api_protocol |
| | | |
| | | |
| | | def __run_l2_market_subscript(): |
| | |
| | | result = huaxin_trade_api.get_money(blocking=True) |
| | | logger_debug.info(f"测试交易账户获取:{result}") |
| | | # 发送信息 |
| | | requests.post("http://127.0.0.1:9008/upload_big_order_datas", json.dumps([(1, 2, 3, 4, 5)])) |
| | | requests.post("http://127.0.0.1:9008/upload_big_order_datas", json=json.dumps({"data": [(1, 2, 3, 4, 5)]})) |
| | | # 获取增值服务API |
| | | result = hx_qc_value_util.get_next_trading_date("2025-06-06") |
| | | logger_debug.info(f"测试获取下一个交易日:{result}") |
| | |
| | | if __name__ == "__main__": |
| | | # -----启动data_server----- |
| | | threading.Thread(target=lambda: data_server.run("127.0.0.1", 9008), daemon=True).start() |
| | | |
| | | # --------启动本地API接口---------- |
| | | manager = ApiCommandManager(middle_api_protocol.SERVER_HOST, middle_api_protocol.SERVER_PORT, outside_api_callback.MyAPICallback()) |
| | | manager.run(blocking=False) |
| | | |
| | | # -------启动华鑫增值服务api------ |
| | | threading.Thread(target=hx_qc_value_util.run, daemon=True).start() |
| | | # --------启动交易---------- |
| | | huaxin_trade_api.run() |
| | | |
| | | threading.Thread(target=test, daemon=True).start() |
| | | test() |
| | | # test() |
| | | |
| | | # -------启动L2 market订阅------ |
| | | __run_l2_market_subscript() |