你好,
这是我的代码:
import ccxt
hitbtc = ccxt.hitbtc({
"apiKey": "key",
"secret": "secret",
"verbose": True,
})
print(hitbtc.create_market_sell_order('BTC/USD', 0.01))
ccxt 失败...
PS Key & nonce 很好,例如,我可以提取余额数据。
嗨,@Fcl69!
我上传了一个稍微编辑过的版本……你能再试一次并报告吗? 它现在应该可以工作了。
干杯!
它确实有效! 谢谢!
@Fcl69好的,但是,请注意,还有更多内容:
timeInForce
订单参数,这是一个控制订单执行的设置(HitBTC 应该如何处理和填写订单):GTC (Good-Til-Canceled): the order will stay open or partially closed until filled or canceled by user
IOC (Immediate-Or-Cancel): the order will either fill immediately or will be canceled automatically
FOK (Fill-Or-Kill): the order will either be filled entirely or will expire
DAY (Day): the order will either be filled in 24 hours or will expire
GTD (Good Till Date): the order will expire on specific date
HitBTC 和 ccxt 中限价单的默认执行类型是 GTC。
对于市价订单,HitBTC 仅允许 IOC 或 FOK。 HitBTC 和 ccxt 中的默认值是 FOK。
如果您需要 IOC 执行,那么您应该将其作为订单的额外参数传递,如下所示:
hitbtc.create_market_sell_order('BTC/USD', 0.01) # default
hitbtc.create_market_sell_order('BTC/USD', 0.01, { 'timeInForce': 'FOK' }) # default
hitbtc.create_market_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })
hitbtc.create_limit_sell_order('BTC/USD', 0.01) # default
hitbtc.create_limit_sell_order('BTC/USD', 0.01, { 'timeInForce': 'GTC' }) # default
hitbtc.create_limit_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })
如果您有任何问题或困难,请告诉我们。 谢谢!
最有用的评论
@Fcl69好的,但是,请注意,还有更多内容:
timeInForce
订单参数,这是一个控制订单执行的设置(HitBTC 应该如何处理和填写订单):HitBTC 和 ccxt 中限价单的默认执行类型是 GTC。
对于市价订单,HitBTC 仅允许 IOC 或 FOK。 HitBTC 和 ccxt 中的默认值是 FOK。
如果您需要 IOC 执行,那么您应该将其作为订单的额外参数传递,如下所示:
如果您有任何问题或困难,请告诉我们。 谢谢!