79510389

Date: 2025-03-14 23:15:24
Score: 1.5
Natty:
Report link

You can get the current price like that;

#Get Current Price 
ticker = client.futures_symbol_ticker(symbol=trade.symbol)
current_price = float(ticker["price"])
print(f"Current price: {current_price}")

And then calculate the quantity value based on entered USDT quantity;

#Entered USDT Value
print(f"Entered value : {trade.quantity}")
        
trade.quantity = trade.quantity / current_price
trade.quantity = f"{trade.quantity:.{8}f}"

Also create_order function's quantity field gets an coin quantity value not an USDT value sometimes this field can be cause an error like this. I hope i could help. I'm new on this area.

Reasons:
  • RegEx Blacklisted phrase (1.5): I'm new
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Kerem Tutumlu