Coverage for source/agent/agents/trading_algorithm_base.py: 83%
6 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-24 10:18 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-24 10:18 +0000
1# agent/agents/trading_algorithm_base.py
3# global imports
4import numpy as np
5from abc import ABC, abstractmethod
7# local imports
9class TradingAlgorithmBase(ABC):
10 """
11 Implements a base class for trading algorithms. It defines the perform_action method
12 that must be implemented by subclasses.
13 """
15 @abstractmethod
16 def perform_action(self, trend_predictions: int, market_data: np.ndarray) -> int:
17 """
18 Performs the trading action based on the trend predictions and market data.
20 Parameters:
21 trend_predictions (np.ndarray): The predicted trends.
22 market_data (np.ndarray): The current market data.
24 Returns:
25 (int): The result of the trading action.
26 """
28 pass