Я попробовал этот код
Код: Выделить всё
import ccxt
api_key = KEY
secret = SECRET
exchange = ccxt.mexc({
'apiKey': api_key,
'secret': secret,
'options': {
'createMarketBuyOrderRequiresPrice': False,
}
})
symbol = 'LBTCUSDT'
amount_in_usd = 10
ticker = exchange.fetch_ticker(symbol)
current_price = ticker['last']
amount_in_btc = amount_in_usd / current_price
order = exchange.create_order(symbol, 'market', 'buy', amount_in_btc)
print(order)
Подробнее здесь: https://stackoverflow.com/questions/787 ... on-in-mexc