Kucoin / kucoin-python-sdk

MIT License
47 stars 17 forks source link

create_limit_order not found #84

Closed FirstVoyager closed 3 months ago

FirstVoyager commented 2 years ago

What is this Error?

def close(symbol, size):
    order_id = trade.create_market_order(
        symbol=symbol,
        side='sell',
        size=size
    )
    return order_id

Error AttributeError: 'function' object has no attribute 'create_limit_order'

SirBricksALot commented 1 year ago

Maybe try something like this . .

from kucoin.client import Trade

trade = Trade(api_key, api_secret, api_passphrase,
                is_sandbox=False, url='', is_v1api=False)

def close(symbol, size):
    my_order = trade.create_market_order(
        symbol=symbol,
        side='sell',
        size=size
    )

    order_id = my_order['orderId']
    return order_id

Good luck!

ISAAC-XXYYZZ commented 3 months ago

Since this issue has already been addressed and there have been no updates for a long time, we will now close it. If you need any further assistance, feel free to ask!