Coverage for source/agent/agents/trading_algorithm_base.py: 83%

6 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-09-26 23:03 +0000

1# agent/agents/trading_algorithm_base.py 

2 

3# global imports 

4import numpy as np 

5from abc import ABC, abstractmethod 

6 

7# local imports 

8 

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 """ 

14 

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. 

19 

20 Parameters: 

21 trend_predictions (np.ndarray): The predicted trends. 

22 market_data (np.ndarray): The current market data. 

23 

24 Returns: 

25 (int): The result of the trading action. 

26 """ 

27 

28 pass