Coverage for source/agent/agents/simple_trading_algorithm.py: 80%
5 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-25 21:18 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-25 21:18 +0000
1# agent/agents/simple_trading_algorithm.py
3# global imports
4import numpy as np
6# local imports
7from source.agent import TradingAlgorithmBase
9class SimpleTradingAlgorithm(TradingAlgorithmBase):
10 """
11 Implements a simple trading algorithm that performs actions based on trend predictions.
12 """
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.
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.
23 Returns:
24 (int): The result of the trading action.
25 """
27 return trend_predictions