Closed qisikai closed 5 years ago
代码是这样的: Code:
print(symbol) futures_order = gate_api.FuturesOrder(contract=symbol, size=-1 * quantity, price=price,reduce_only=False,tif="gtc") # FuturesOrder try: # Create a futures order api_response = self.api_instance.create_futures_order(futures_order) print(api_response) return api_response except ApiException as e: print("Exception when calling FuturesApi->create_futures_order: %s\n" % e) raise e
输出是这样的: Output:
BTC_USD
Exception when calling FuturesApi->create_futures_order: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Date': 'Sun, 26 May 2019 06:10:07 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'openresty/1.13.6.1'}) HTTP response body: {"label":"INVALID_PROTOCOL","detail":"invalid argument: #3"}
参数的内容有问题,请确认下您输入的具体参数是否符合要求
代码是这样的: Code:
输出是这样的: Output:
BTC_USD
Exception when calling FuturesApi->create_futures_order: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Date': 'Sun, 26 May 2019 06:10:07 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'openresty/1.13.6.1'}) HTTP response body: {"label":"INVALID_PROTOCOL","detail":"invalid argument: #3"}