| | |
| | | volume = params.get("volume") # 量 |
| | | price = round(params.get("price"), 2) # 价格 |
| | | result = huaxin_trade_api.order(1, code, volume, price, blocking=True) |
| | | result_str = json.dumps({"code": 0, "data": result}) |
| | | result_str = json.dumps(result) |
| | | elif url.path == "/sell": |
| | | params = self.__parse_request() |
| | | # 签名验证 |
| | |
| | | volume = params.get("volume") # 量 |
| | | price = round(params.get("price"), 2) # 价格 |
| | | result = huaxin_trade_api.order(2, code, volume, price, blocking=True) |
| | | result_str = json.dumps({"code": 0, "data": result}) |
| | | result_str = json.dumps(result) |
| | | except Exception as e: |
| | | result_str = json.dumps({"code": 1, "msg": str(e)}) |
| | | finally: |
| | |
| | | # -*- coding: utf-8 -*- |
| | | # addr, port = "111.230.16.67", 10008 |
| | | # SERVER_IP = '192.168.3.122' |
| | | # 公用服务器:192.168.84.75 托管服务器:192.168.84.126 |
| | | # 公用服务器:192.168.84.71 托管服务器:192.168.84.126 |
| | | LOCAL_IP = "192.168.84.126" |
| | | |
| | | TEST = True |
| | |
| | | Front_Address = "tcp://10.0.1.101:6900" |
| | | Multicast_Address = "udp://224.224.2.19:7889" |
| | | Multicast_Address2 = "udp://224.224.224.234:7890" |
| | | Local_Interface_Address = "192.168.84.75" |
| | | Local_Interface_Address = "192.168.84.71" |
| | | |
| | | set_codes_data_queue = queue.Queue() |
| | | market_code_dict = {} |