I used this code: # Define function to calculate EMA and SMA
def EMA(close, period):
    ema = close.ewm(span=period, adjust=False).mean()
    return ema

def SMA(close, period):
    sma = close.rolling(window=period).mean()
    return sma

# Define function to calculate Dragonfly Doji and Hammer patterns
def CDLDRAGONFLYDOJI(open, high, low, close):
    return (high - low) <= 2*(open - close) and high - close <= 0.25*(high - low) and  high - open <= 0.25*(high - low)

def CDLHAMMER(open, high, low, close):
    return (high - low) > 3*(open - close) and  (close - low) / (0.001 + high - low) > 0.6 and  (open - low) / (0.001 + high - low) > 0.6

# Define function to generate signals
def signal_generator(df):
    close = df.Close.iloc[-1]
    previous_close = df.Close.iloc[-2]

    # Calculate EMA and MA indicators
    ema_10 = EMA(df['Close'], 10)
    ema_50 = EMA(df['Close'], 50)
    ema_200 = EMA(df['Close'], 200)
    ma_20 = SMA(df['Close'], 20)

    # Identify Bullish/Bearish Candlestick Patterns
    bullish_candles = CDLDRAGONFLYDOJI(df['Open'], df['High'], df['Low'], df['Close'])
    bearish_candles = CDLHAMMER(df['Open'], df['High'], df['Low'], df['Close'])

    # Identify Trend
    trend = ""
    if ema_10.iloc[-1] > ema_50.iloc[-1] and ema_50.iloc[-1] > ema_200.iloc[-1]:
        trend = "Bullish"
    elif ema_10.iloc[-1] < ema_50.iloc[-1] and ema_50.iloc[-1] < ema_200.iloc[-1]:
        trend = "Bearish"
    else:
        trend = "Sideways"

    # Identify Signal
    signal = ""
    if close > previous_close or bullish_candles:
        signal = "Buy"
    elif close < previous_close or bearish_candles:
        signal = "Sell"
    else:
        signal = "Hold"

    return (trend, signal)
But I getting ERROR: 06/17/2023 12:47:46
BTC/USDT found in the market
Traceback (most recent call last):
  File "c:\Users\Alan\.vscode\jew_bot\jew_bot\jew_bot.py", line 316, in <module>
    signal = signal_generator(df)
             ^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Alan\.vscode\jew_bot\jew_bot\jew_bot.py", line 194, in signal_generator
    bullish_candles = CDLDRAGONFLYDOJI(df['Open'], df['High'], df['Low'], df['Close'])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Alan\.vscode\jew_bot\jew_bot\jew_bot.py", line 177, in CDLDRAGONFLYDOJI
    return (high - low) <= 2*(open - close) and high - close <= 0.25*(high - low) and  high - open <= 0.25*(high - low)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Alan\AppData\Roaming\Python\Python311\site-packages\pandas\core\generic.py", line 1466, in __nonzero__
    raise ValueError(
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().