EMA Calculation: The script calculates two EMAs (short and long) for trend direction.
MACD Calculation: MACD is calculated with user-defined inputs to capture momentum changes.
RSI: The RSI is used to identify overbought and oversold conditions.
Signal Generation:
A buy signal is generated when the MACD line crosses above the signal line, RSI is below the oversold threshold, and the closing price is above the short EMA.
A sell signal is generated when the MACD line crosses below the signal line, RSI is above the overbought threshold, and the closing price is below the short EMA.
Alerts: Optional alerts are provided for buy and sell conditions.