我试图打开和关闭FTX上的空头头寸使用ccxt与python。我没有找到任何关于如何这样做的信息或例子。
有没有人知道如何做到这一点,或者有没有使用ccxt在FTX上开盘和结清空头头寸的例子?
非常感谢!
大卫
发布于 2022-04-22 15:11:59
import ccxt
ftx = ccxt.ftx({
'enableRateLimit': True,
"apiKey": "-----------------------",
"secret": "-----------------------",
#'headers': {
# 'FTX-SUBACCOUNT': "----",
#},
"hostname": "ftx.com"
})
response = ftx.set_leverage(1)
print('set_leverage - ', response)
#Long
ftx.create_order('USDT-PERP', 'market', 'buy', 10)
ftx.create_order('USDT-PERP', 'market', 'sell', 10)
#Short
ftx.create_order('USDT-PERP', 'market', 'sell', 10)
ftx.create_order('USDT-PERP', 'market', 'buy', 10)https://stackoverflow.com/questions/69211107
复制相似问题