[英]Cannot create sell order: Python ccxt binance does not have market symbol USDT/BTC
I am using python ccxt module to create a sell order in some binance account.我正在使用 python ccxt 模块在一些币安账户中创建卖单。 First I create the exchange client
首先我创建交换客户端
import ccxt
exchange = ccxt.binance( { 'apiKey' : "<someKey>" , 'secret' : "<thaSecretKey>" } )
Then when I try to use its create_market_sell_order
method to create a market sell order I get the following error:然后,当我尝试使用它的
create_market_sell_order
方法创建市场卖单时,我收到以下错误:
>>> exchange.create_market_sell_order(symbol="USDT/BTC", amount="0.1")
Traceback (most recent call last):
[...]
raise BadSymbol(self.id + ' does not have market symbol ' + symbol)
ccxt.base.errors.BadSymbol: binance does not have market symbol USDT/BTC
So seems like there is no ticker for selling USDT for BTC, while it works for the BTC/USDT ticker.所以似乎没有为 BTC 出售 USDT 的代码,而它适用于 BTC/USDT 代码。
How could I create a sell order to buy BTC with USD using this create_market_sell_order
method?我如何使用这个
create_market_sell_order
方法创建卖单以用美元购买 BTC? The same happens with MANA: there are no '<someCrypto>/MANA'
tickers! MANA 也是如此:没有
'<someCrypto>/MANA'
代码!
ccxt.base.errors.BadSymbol: binance does not have market symbol BTC/MANA
So I can neither sell MANA.所以我不能卖 MANA。
I don't want to create a buy order instead because calculating the amount I could buy with my available USDT is not straightforward.我不想创建一个买单,因为计算我可以用可用的 USDT 购买的数量并不简单。
Just replace "USDT/BTC"
to "BTC/USDT"
.只需将
"USDT/BTC"
替换为"BTC/USDT"
即可。
"BTC/USDT"
means the amount USDT per 1 BTC and "USDT/BTC"
means the amount of BTC per 1 USDT "BTC/USDT"
是指每 1 BTC 的 USDT 数量, "USDT/BTC"
是指每 1 USDT 的 BTC 数量
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.