I used your code: import time
import requests
import hmac
import hashlib
import datetime as dt
import pandas as pd
API_KEY = ''
API_SECRET = ''

print({dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')})

symbol = 'BCH/USDT'
interval = '1m'
lookback = 43200 

def generate_signature(api_key, api_secret, endpoint, params):
    params_string = '&'.join([f'{key}={params[key]}' for key in params])
    payload = f'{endpoint}?{params_string}'
    signature = hmac.new(api_secret.encode('utf-8'), payload.encode('utf-8'), hashlib.sha256).hexdigest()
    return signature

def get_historical_data(symbol, interval, start_time, end_time):
    url = 'https://www.mexc.com/open/api/v2/market/kline'
    params = {
        'symbol': symbol,
        'interval': interval,
        'start_time': start_time,
        'end_time': end_time
    }
    signature = generate_signature(API_KEY, API_SECRET, '/open/api/v2/market/kline', params)
    params['api_key'] = API_KEY
    params['sign'] = signature

    response = requests.get(url, params=params, timeout=10)  # Increase timeout value to 10 seconds
    if response.status_code == 200:
        data = response.json()['data']
        df = pd.DataFrame(data, columns=['time', 'open', 'high', 'low', 'close', 'volume'])
        df['time'] = pd.to_datetime(df['time'], unit='ms')
        df['volume'] = df['volume'].astype(float)
        return df


end_time = int(time.time() * 1000)
start_time = end_time - lookback * 60 * 1000
df = get_historical_data(symbol, interval, start_time, end_time)

print(symbol)

def signal_generator(df):
    if df is None:
        return ''

    ema_analysis = []
    candle_analysis = []
    
    ema_count = 0    # Initialize ema_count
    candle_count = 0    # Initialize candle_count

    # Calculate EMA lines
    df['EMA5'] = df['close'].ewm(span=5, adjust=False).mean()
    df['EMA20'] = df['close'].ewm(span=20, adjust=False).mean()
    df['EMA100'] = df['close'].ewm(span=100, adjust=False).mean()
    df['EMA200'] = df['close'].ewm(span=200, adjust=False).mean()

    # EMA analysis
    if (
        df['EMA5'].iloc[-1] > df['EMA20'].iloc[-1] > df['EMA100'].iloc[-1] > df['EMA200'].iloc[-1] and
        df['EMA5'].iloc[-2] < df['EMA20'].iloc[-2] < df['EMA100'].iloc[-2] < df['EMA200'].iloc[-2]
    ):
        ema_analysis.append('golden_cross')
        ema_count += 1    # Increment ema_count
    elif (
        df['EMA5'].iloc[-1] < df['EMA20'].iloc[-1] < df['EMA100'].iloc[-1] < df['EMA200'].iloc[-1] and
        df['EMA5'].iloc[-2] > df['EMA20'].iloc[-2] > df['EMA100'].iloc[-2] > df['EMA200'].iloc[-2]
    ):
        ema_analysis.append('death_cross')
        ema_count += 1    # Increment ema_count
    
    # Candle analysis
    if (
        df['close'].iloc[-1] > df['open'].iloc[-1] and
        df['open'].iloc[-1] > df['low'].iloc[-1] and
        df['high'].iloc[-1] > df['close'].iloc[-1]
    ):
        candle_analysis.append('bullish_engulfing')
        candle_count += 1    # Increment candle_count
    elif (
        df['close'].iloc[-1] < df['open'].iloc[-1] and
        df['open'].iloc[-1] < df['high'].iloc[-1] and
        df['low'].iloc[-1] > df['close'].iloc[-1]
    ):
        candle_analysis.append('bearish_engulfing')
        candle_count += 1    # Increment candle_count
    
    final_signal = ''
    
    if 'golden_cross' in ema_analysis and 'bullish_engulfing' in candle_analysis:
        final_signal = 'buy'
    elif 'death_cross' in ema_analysis and 'bearish_engulfing' in candle_analysis:
        final_signal = 'sell'

    return final_signal


df = get_historical_data(symbol, interval, start_time, end_time)
while True:
    end_time = int(time.time() * 1000)
    start_time = end_time - lookback * 60 * 1000
    df = get_historical_data(symbol, interval, start_time, end_time)
    signal = signal_generator(df)
    if signal:
        print(f"The signal time is: {dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}:{signal}")
    else:
        print(f"No signal at: {dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
    time.sleep(1)

but it doesn't give me any signal , if my code have any problem just tell me in which lines problem and what I need to place in those lines