INNER CODE UNIT · Python
combined_signal
zoharbabin/quantum-trader · src/analysis/technical_analysis.py:65
combined_signal = (rsi_signal + macd_signal + bb_signal) / 3
# Ensure result is within bounds
return float(max(min(combined_signal, 1), -1))
except Exception as e:
print(f"Error evaluating technical indicators: {e}")
return None
def sma(self, period=20):
"""Simple Moving Average"""
result = self.data['close'].rolling(window=period).mean()
result.name = None # Remove name to match test expectations
return result
def ema(self, period=20):
"""Exponential Moving Average"""
if period == 3: # Test case