mexcdevelop / mexc-api-sdk

MIT License
173 stars 70 forks source link

Python Issue! Failed to place market order. Error: 'Spot' object has no attribute 'newOrderTest' #73

Open lioneltan opened 2 months ago

lioneltan commented 2 months ago

Failed to place market order. Error: 'Spot' object has no attribute 'newOrderTest' Failed to place market order. Error: 'Spot' object has no attribute 'newOrder' also not working.

from mexc_sdk import Spot

Initialize the MEXC client with your API credentials

client = Spot(api_key=api_key, api_secret=api_secret)

For example, try: if trade_id is not None: sell_order_response = client.newOrderTest(symbol=symbol, side='SELL', orderType='MARKET', options={'quantity': initial_quantity}) sell_order_id = sell_order_response['orderId'] logger.info("Market sell order placed successfully. Order ID: %s", sell_order_id)

mncrftfrcnm commented 1 month ago

hey, try this: client.new_order_test().