代码:
logging.info(grid.create_futures_order('GALA/USD',1, price=0.132)) # 下单, 成功!
结果:
2022-05-08 Sunday 18:46:16 - INFO - {'orderId': '1336753741', 'symbol': 'GALAUSD_PERP', 'pair': 'GALAUSD', 'status': 'NEW', 'clientOrderId': 'CspH0obfIw2IHzV6UEFPGs', 'price': '0.13200', 'avgPrice': '0.00000', 'origQty': '1', 'executedQty': '0', 'cumQty': '0', 'cumBase': '0', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'updateTime': '1652006776824'}
代码:
logging.info(grid.fetch_futures_order('1336753741'))
结果:
2022-05-08 Sunday 19:08:04 - INFO - {'orderId': '1336753741', 'symbol': 'GALAUSD_PERP', 'pair': 'GALAUSD', 'status': 'NEW', 'clientOrderId': 'CspH0obfIw2IHzV6UEFPGs', 'price': '0.13200', 'avgPrice': '0.00000', 'origQty': '1', 'executedQty': '0', 'cumBase': '0', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'time': '1652006776824', 'updateTime': '1652006776824'}
代码:
logging.info(grid.cancel_my_order('1336753741'))
结果:
2022-05-08 Sunday 19:23:32 - INFO - {'info': {'orderId': '1336753741', 'symbol': 'GALAUSD_PERP', 'pair': 'GALAUSD', 'status': 'CANCELED', 'clientOrderId': 'CspH0obfIw2IHzV6UEFPGs', 'price': '0.13200', 'avgPrice': '0.00000', 'origQty': '1', 'executedQty': '0', 'cumQty': '0', 'cumBase': '0', 'timeInForce': 'GTC', 'type': 'LIMIT', 'reduceOnly': False, 'closePosition': False, 'side': 'BUY', 'positionSide': 'BOTH', 'stopPrice': '0', 'workingType': 'CONTRACT_PRICE', 'priceProtect': False, 'origType': 'LIMIT', 'updateTime': '1652009012616'}, 'id': '1336753741', 'clientOrderId': 'CspH0obfIw2IHzV6UEFPGs', 'timestamp': None, 'datetime': None, 'lastTradeTimestamp': None, 'symbol': 'GALAUSD_PERP', 'type': 'limit', 'timeInForce': 'GTC', 'postOnly': False, 'side': 'buy', 'price': 0.132, 'stopPrice': None, 'amount': 1.0, 'cost': 0.0, 'average': None, 'filled': 0.0, 'remaining': 1.0, 'status': 'canceled', 'fee': None, 'trades': [], 'fees': []}