【问题标题】:TypeError: create_order() takes 1 positional argument but 2 were givenTypeError:create_order() 接受 1 个位置参数,但给出了 2 个
【发布时间】:2020-03-25 14:45:47
【问题描述】:

我正在尝试使用以下脚本在 Binance 下订单,但将其取回:

TypeError: create_order() takes 1 positional argument but 2 were given

这是脚本的代码:

symbol = 'EOSUSDT'
TradeCoin = symbol
Decision = 'SIDE_BUY'
Assets =1
Price = 30

OrderLine = 'symbol=%s, side=%s, type=ORDER_TYPE_MARKET, quantity=%s, price=%s'
message = (OrderLine % (TradeCoin, Decision, Assets, Price))

print(message)
order = client.create_order(message)

【问题讨论】:

  • 这是 Python,对吧?您至少应该将它添加到标签中,这样它就会正确突出显示。或者,更好的是,自己在代码块中突出显示它。
  • 是的,你说得对,我应该说清楚,它是用 Python 编写的。

标签: python api binance


【解决方案1】:
tradePair = 'SUNBTC'
order = client.order_limit_sell(
symbol=tradePair,
quantity=0.200,
price= 0.000700,
newClientOrderId= 'ALPC')

【讨论】:

  • 虽然这可能会回答这个问题,但如果您提供一些关于您的代码如何工作的解释会很好。
猜你喜欢
  • 2016-10-13
  • 2019-04-20
  • 2018-11-15
  • 2014-07-19
  • 2016-08-09
  • 2020-01-30
  • 2019-08-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多