CCXT Binance Future Order

4.5k Views Asked by At

I don't know Python very well and I'm trying to make a bot for Binance Futures with Python. And I encounter this error:

client.futures_create_order()(
TypeError: futures_create_order() missing 1 required positional argument: 'self'

Here is my code:

import ccxt

from binance.client import Client

client = Client("api key", "api secret")

client.futures_create_order()(
        symbol='BTCUSDT',
        side='BUY',
        type="MARKET",
        positionSide='SHORT',
        quantity=0.001,
        leverage=21
    )
1

There are 1 best solutions below

1
On

You have a syntax error. Remove the empty parenthesis in futures_create_order().

client.futures_create_order(
    symbol='BTCUSDT',
    side='BUY',
    type="MARKET",
    positionSide='SHORT',
    quantity=0.001,
    leverage=21)