Using amount instead of QTY bybit python

125 Views Asked by At

This is bybit API code for trading in futures.
How do I open a Market Trade with $10 and not with 'qty'.

Eg = $10 / 0.1(Coin Price)

And in seassion place order instead QTY i use Eg so i simply have to add coin name in my bot and it buy $10 worth of coin what ever coins value is..

I am unble to fetch live price of coin from bybit apy so i can divide 10 to coin live price and store it in varrialbe.

response = session.place_order(
                            category='linear',
                            symbol=item + 'USDT',
                            orderType='market',
                            timeInForce='GTC',
                            side='Buy',
                            qty='10',
                            tradeMode=1,
                            buyLeverage="6",
                            sellLeverage="6",

                        )
                    

                        print(response)

I am unble to fetch live coin data so i can divide 10 / live price and store it in var

So i can show car in QTY.

0

There are 0 best solutions below