| | |
| | | from http.server import BaseHTTPRequestHandler |
| | | import urllib.parse as urlparse |
| | | |
| | | from log_module.log import hx_logger_l2_transaction |
| | | from strategy import data_cache |
| | | from trade import huaxin_trade_api, huaxin_trade_data_update |
| | | from trade.huaxin_trade_record_manager import DelegateRecordManager, DealRecordManager, MoneyManager, PositionManager |
| | |
| | | orderSysID = params.get("orderSysID") # 系统订单编号 |
| | | result = huaxin_trade_api.cancel_order(direction, code, orderSysID, blocking=True) |
| | | result_str = json.dumps(result) |
| | | elif url.path == "/upload_deal_big_orders": |
| | | # 成交大单传递 |
| | | datas = self.rfile.read(int(self.headers['content-length'])) |
| | | _str = str(datas, encoding="gbk") |
| | | hx_logger_l2_transaction.info(_str) |
| | | # 记录日志 |
| | | result_str = json.dumps({"code": 0}) |
| | | except Exception as e: |
| | | result_str = json.dumps({"code": 1, "msg": str(e)}) |
| | | finally: |