import time
from binance.client import Client
# Замените на свои ключи API
api_key = 'Ваш API ключ'
api_secret = 'Ваш API секрет'
client = Client(api_key, api_secret)
def buy(symbol, quantity, price):
try:
order = client.create_order(
symbol=symbol,
side=Client.SIDE_BUY,
type=Client.ORDER_TYPE_LIMIT,
...