Coverage for source/agent/agents/simple_trading_algorithm.py: 80%

5 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-09-29 18:17 +0000

1# agent/agents/simple_trading_algorithm.py 

2 

3# global imports 

4import numpy as np 

5 

6# local imports 

7from source.agent import TradingAlgorithmBase 

8 

9class SimpleTradingAlgorithm(TradingAlgorithmBase): 

10 """ 

11 Implements a simple trading algorithm that performs actions based on trend predictions. 

12 """ 

13 

14 def perform_action(self, trend_predictions: int, market_data: np.ndarray = None) -> int: 

15 """ 

16 Performs the trading action based on the trend predictions and market data. 

17 

18 Parameters: 

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

20 market_data (np.ndarray): The current market data. This 

21 implementation does not use market data. 

22 

23 Returns: 

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

25 """ 

26 

27 return trend_predictions