from abc import ABC, abstractmethod class Strategy(ABC): """ Abstract base class for all strategies. """ @abstractmethod def generate_signals(self, data): """ Generates trading signals for each stock. :param data: A pandas DataFrame of historical price data. :return: A pandas Series with the same index as the input data, containing the trading signals (e.g., 'buy', 'hold', 'sell'). """ pass