简体   繁体   English

无法创建卖单:Python ccxt binance 没有市场代码 USDT/BTC

[英]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 数量

BeautifulSoup 抓取币安 BTC_USDT 页面而不是每个<div>被发现</div><div id="text_translate"><p>我正在尝试从 Binance 的 BTC_USDT 页面中抓取。</p><p> 从生成的 html 中,我找不到我正在寻找的标签。</p><p> 例如:实时价格在 &lt;div class="subPrice css-4lmq3e" 下,检查时发现但刮掉时没有。 虽然我可以找到一些其他标签,如 id="__APP"。</p><p> 这是我的代码:</p><pre> import requests from bs4 import BeautifulSoup import time from selenium import webdriver url = "https://www.binance.com/en/trade/BTC_USDT?type=spot" response = requests.get(url) html = response.content soup = BeautifulSoup(html, "lxml") div = soup.find("div", {"class": "subPrice css-4lmq3e"}) content = f'Content: {str(div)}' print(content)</pre></div> - BeautifulSoup scraping binance BTC_USDT page and not every <div> is found

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用ccxt python在Binance的现货和期货之间转移USDT - Transfer USDT between spot and futures in Binance using ccxt python python 币安 api order_market_buy 和 order_market_sell 的问题 - problem with python binance api order_market_buy and order_market_sell 使用 CCXT 和 python 在 FTX 上创建市场订单 - create market order on FTX using CCXT with SL and TP using python 在 Bybit 上使用 CCXT 和 SL 和 TP 使用 python 创建市价单? - Create market order on Bybit using CCXT with SL and TP using python? 币安卖出订单 python API - sell order in binance python API 如何在 python 中使用 ccxt 制作币安期货订单? - How to make a binance futures order with ccxt in python? CCXT 币安期货订单 - CCXT Binance Future Order BeautifulSoup 抓取币安 BTC_USDT 页面而不是每个<div>被发现</div><div id="text_translate"><p>我正在尝试从 Binance 的 BTC_USDT 页面中抓取。</p><p> 从生成的 html 中,我找不到我正在寻找的标签。</p><p> 例如:实时价格在 &lt;div class="subPrice css-4lmq3e" 下,检查时发现但刮掉时没有。 虽然我可以找到一些其他标签,如 id="__APP"。</p><p> 这是我的代码:</p><pre> import requests from bs4 import BeautifulSoup import time from selenium import webdriver url = "https://www.binance.com/en/trade/BTC_USDT?type=spot" response = requests.get(url) html = response.content soup = BeautifulSoup(html, "lxml") div = soup.find("div", {"class": "subPrice css-4lmq3e"}) content = f'Content: {str(div)}' print(content)</pre></div> - BeautifulSoup scraping binance BTC_USDT page and not every <div> is found 如何使用 ccxt 在 Bybit 上进行 SPOT 市价单? - How to make SPOT market order on Bybit with ccxt? CCXT 期货 - STOP_MARKET (Python) - CCXT Futues - STOP_MARKET (Python)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM