I got an interest about ccxt these days, especially futures trade
i tried to make a logic and it was fun
but I've got a problem to "Setting amount"
def binance_long():
order = binance.create_market_buy_order(
symbol = symbol,
amount=0.001
)
def binance_short():
order = binance.create_market_sell_order(
symbol=symbol,
amount=0.001
)
this is my buy/sell function
In that codes, I want to put my whole usdt dollars
but i don't know how to change amount
because that 0.001 position is based on btc not usdt
how can i put my whole usdt dollars in my position?
ex)729.8 usdt -> put that whole thing
also using leverage too (1~50)
and also how can i close my position with my whole usdt?
because In order, I understood that I had to write this function and then use this function.
- binance_long() <- buy long position
- binance_short() <- close long position
like this
schedule.every().monday.at("00:00:00").do(binance_long)
schedule.every().monday.at("00:00:30").do(binance_short)
To Open position and Close position in Long position