I used this code: import time
from binance.client import Client
from binance.enums import *
from binance.exceptions import BinanceAPIException
from binance.helpers import round_step_size
import pandas as pd
import json
import numpy as np
import pytz
import datetime as dt
import ccxt
from decimal import Decimal
import requests
import hmac
import hashlib
import ntplib
import os
import ta
import ta.volatility
API_KEY = ''
API_SECRET = ''

client = Client(API_KEY, API_SECRET)

# Set the endpoint and parameters for the request
url = "https://fapi.binance.com/fapi/v2/account"
timestamp = int(time.time() * 1000)
recv_window = 10000 # update the recv_window value

params = {
"timestamp": timestamp,
"recvWindow": recv_window
}

# Define the sync_time() function
def sync_time():
    ntp_client = ntplib.NTPClient()
    response = ntp_client.request('pool.ntp.org', version=3)
    now = time.time()
    offset = response.offset
    new_time = now + offset
    # Set the system clock to the new time
    os.system(f'sudo date -s @{int(new_time)}')
    print(f'New time: {dt.datetime.now()}')
# Sync your local time with the server time
sync_time()

# Sign the message using the Client’s secret key
message = "&".join([f"{k}={v}" for k, v in params.items()])
signature = hmac.new(API_SECRET.encode(), message.encode(), hashlib.sha256).hexdigest()
params['signature'] = signature
leverage = 100

# Send the request using the requests library
response = requests.get(url, params=params, headers={'X-MBX-APIKEY': API_KEY})
account_info = response.json()

# Get the USDT balance and calculate the max trade size based on the leverage
try:
    usdt_balance = next((item for item in account_info['accountBalance'] if item["asset"] == "USDT"), {"free": 0})['free']
except KeyError:
    usdt_balance = 0
    print("Error: Could not retrieve USDT balance from API response.")

max_trade_size = float(usdt_balance) * leverage

# Get the current time and timestamp
now = dt.datetime.now()
date = now.strftime("%m/%d/%Y %H:%M:%S")
print(date)

timestamp = int(time.time() * 1000)

STOP_LOSS_PERCENTAGE = -50
TAKE_PROFIT_PERCENTAGE = 100
MAX_TRADE_QUANTITY_PERCENTAGE = 100
POSITION_SIDE_SHORT = 'SELL'
POSITION_SIDE_LONG = 'BUY'
quantity = 1
symbol = 'BTC/USDT'
order_type = 'market'
leverage = 100
max_trade_quantity_percentage = 1
binance_futures = ccxt.binance({
    'apiKey': API_KEY,
    'secret': API_SECRET,
    'enableRateLimit': True, # enable rate limitation
    'options': {
    'defaultType': 'future',
    'adjustForTimeDifference': True
    },'future': {
    'sideEffectType': 'MARGIN_BUY', # MARGIN_BUY, AUTO_REPAY, etc…
}
})
# Load the market symbols
url = f'https://api.binance.com/api/v3/ticker/price?symbol={symbol}'
response = requests.get(url)
ticker = response.json()
try:
    current_price = float(ticker['price'])
    print(f"Current {symbol} price: {current_price}")
except KeyError:
    print('Error fetching current price: price key not found in ticker data')
    current_price = None


def get_server_time(exchange):
    return exchange.fetch_time() / 1000 # divide by 1000 to convert to seconds

def synchronize_time():
    ntp_client = ntplib.NTPClient()
    response = ntp_client.request('pool.ntp.org', version=3)
    now = time.time()
    offset = response.offset
    new_time = now + offset
    # Set the system clock to the new time
    os.system(f'sudo date -s @{int(new_time)}')
    print(f'System time synchronized with NTP: {dt.datetime.now()}')

# Synchronize system time
synchronize_time()

# Load the market symbols
try:
    markets = binance_futures.fetch_markets()
except ccxt.BaseError as e:
    print(f'Error fetching markets: {e}')
    markets = []

if symbol in markets:
    print(f"{symbol} found in the market")
else:
    print(f"{symbol} not found in the market")
# You might want to return or exit the program here if the symbol is not found

# Get server time and time difference
server_time = get_server_time(binance_futures)
local_time = time.time()
time_difference = local_time - server_time
timestamp = int((server_time + time_difference) * 1000)
params = {
    "timestamp": timestamp,
    "recvWindow": recv_window
}

# Load the market ticker
url = f'https://api.binance.com/api/v3/ticker/price?symbol={symbol}'
response = requests.get(url, params=params)
ticker = response.json()
try:
    current_price = float(ticker['price'])
    print(f"Current {symbol} price: {current_price}")
except KeyError:
    print('Error fetching current price: price key not found in ticker data')
    current_price = None
# you can add additional error handling or return None here if necessary

# Get historical data
def get_klines(symbol, interval, lookback):
    url = "https://fapi.binance.com/fapi/v1/klines"
    end_time = int(time.time() * 1000) # end time is now
    start_time = end_time - (lookback * 60 * 1000) # start time is lookback minutes ago
    symbol = symbol.replace("/", "") # remove slash from symbol
    query_params = f"?symbol={symbol}&interval={interval}&startTime={start_time}&endTime={end_time}"
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
    }
    response = requests.get(url + query_params, headers=headers)
    response.raise_for_status()
    data = response.json()
    if not data: # if data is empty, return None
        print('No data found for the given timeframe and symbol')
        return None
    ohlc = []
    for d in data:
        timestamp = dt.datetime.fromtimestamp(d[0]/1000).strftime('%Y-%m-%d %H:%M:%S')
        ohlc.append({
            'Open time': timestamp,
            'Open': float(d[1]),
            'High': float(d[2]),
            'Low': float(d[3]),
            'Close': float(d[4]),
            'Volume': float(d[5])
        })
    df = pd.DataFrame(ohlc)
    df.set_index('Open time', inplace=True)
    return df

def signal_generator(df):
    # Check if current_price is None
    if current_price is None:
        return ''

    # Calculate EMA and MA lines
    df['EMA5'] = df['Close'].ewm(span=5, adjust=False).mean()
    df['EMA20'] = df['Close'].ewm(span=20, adjust=False).mean()
    df['EMA50'] = df['Close'].ewm(span=50, adjust=False).mean()
    df['EMA100'] = df['Close'].ewm(span=100, adjust=False).mean()
    df['MA10'] = df['Close'].rolling(window=10).mean()
    df['MA50'] = df['Close'].rolling(window=50).mean()
    df['MA100'] = df['Close'].rolling(window=100).mean()

    # Calculate the last candlestick
    last_candle = df.iloc[-1]

    # Check if there is enough data to calculate the signals
    if len(last_candle) < 7:
        print(f'Not enough data to generate signals for {symbol}')
        return ''

    # Check for bullish signals
    if current_price > last_candle[['EMA5', 'EMA20', 'EMA50', 'EMA100']].iloc[-1].max() * 1.01:
        if last_candle[['EMA5', 'MA10', 'MA50', 'MA100']].iloc[-1].min() > current_price * 0.999:
            return 'buy'
    # Check for bearish signals
    elif current_price < last_candle[['EMA5', 'EMA20', 'EMA50', 'EMA100']].iloc[-1].min() * 0.99:
        if last_candle[['EMA5', 'MA10', 'MA50', 'MA100']].iloc[-1].max() < current_price * 1.001:
            return 'sell'

    # If no signal found, return an empty string
    return ''
df =  get_klines(symbol, '1m', 44640)
But I getting ERROR: Error fetching current price: price key not found in ticker data
Traceback (most recent call last):
  File "C:\Users\Alan\AppData\Roaming\Python\Python311\site-packages\ntplib.py", line 318, in request
    response_packet, src_addr = s.recvfrom(256)
                                ^^^^^^^^^^^^^^^
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\Alan\.vscode\jew_bot\jew_bot\jew_bot.py", line 121, in <module>
    synchronize_time()
  File "c:\Users\Alan\.vscode\jew_bot\jew_bot\jew_bot.py", line 112, in synchronize_time
    response = ntp_client.request('pool.ntp.org', version=3)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Alan\AppData\Roaming\Python\Python311\site-packages\ntplib.py", line 323, in request
    raise NTPException("No response received from %s." % host)
ntplib.NTPException: No response received from pool.ntp.org.