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 = 44640

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)
    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
    else:
        return None

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

def signal_generator(df):
    # Calculate EMA and MA lines
    df['EMA5'] = df['close'].ewm(span=5, adjust=False).mean()
    df['EMA10'] = df['close'].ewm(span=10, 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['EMA200'] = df['close'].ewm(span=200, adjust=False).mean()
    df['MA10'] = df['close'].rolling(window=10).mean()
    df['MA20'] = df['close'].rolling(window=20).mean()
    df['MA50'] = df['close'].rolling(window=50).mean()
    df['MA100'] = df['close'].rolling(window=100).mean()
    # Extract necessary prices from df
    open_price = df.open.iloc[-1]
    close_price = df.close.iloc[-1]
    previous_open = df.open.iloc[-2]
    previous_close = df.close.iloc[-2]

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

    # Initialize analysis variables
    ema_analysis = []
    candle_analysis = []

    if (
        df['EMA5'].iloc[-1] > df['EMA20'].iloc[-1] > df['EMA50'].iloc[-1] > df['EMA100'].iloc[-1] > df['EMA200'].iloc[-1] and
        df['EMA5'].iloc[-2] < df['EMA20'].iloc[-2] < df['EMA50'].iloc[-2] < df['EMA100'].iloc[-2] < df['EMA200'].iloc[-2]
    ):
        ema_analysis.append('golden_cross')
    elif (
        df['EMA5'].iloc[-1] < df['EMA20'].iloc[-1] < df['EMA50'].iloc[-1] < df['EMA100'].iloc[-1] < df['EMA200'].iloc[-1] and
        df['EMA5'].iloc[-2] > df['EMA20'].iloc[-2] > df['EMA50'].iloc[-2] > df['EMA100'].iloc[-2] > df['EMA200'].iloc[-2]
    ):
        ema_analysis.append('death_cross')

    if (
        open_price < close_price and
        previous_open > previous_close and
        close_price > previous_open and
        open_price <= previous_close
    ):
        candle_analysis.append('buy')
    elif (
        open_price > close_price and
        previous_open < previous_close and
        close_price < previous_open and
        open_price >= previous_close
    ):
        candle_analysis.append('sell')

    # Generate signal based on strategy
    if 'golden_cross' in ema_analysis and 'buy' in candle_analysis:
        final_signal = 'buy'
    elif 'death_cross' in ema_analysis and 'sell' in candle_analysis:
        final_signal = 'sell'
    else:
        final_signal = ''

    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 I getting ERROR: Traceback (most recent call last):
  File "c:\Users\service\.vscode\jew_bot.py", line 114, in <module>
    signal = signal_generator(df)
             ^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\service\.vscode\jew_bot.py", line 49, in signal_generator
    df['EMA5'] = df['close'].ewm(span=5, adjust=False).mean()
                 ~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Give me right code please