investfly.models.indicator.IndicatorDataService

Indicator data service interface.

This module defines the IndicatorDataService interface that provides market data access to indicators. Security context is captured when the service is instantiated.

class IndicatorDataService(abc.ABC):

Market data access for indicators with security context captured at construction.

ALL_BARS: int = -1

Constant for retrieving all available bars.

@abstractmethod
def getBars(self, numBars: int = -1) -> List[investfly.models.marketdata.Bar]:

Retrieve historical bars for the configured security.

The bar interval and lookback are captured when the service is instantiated. If lookback > 0, the most recent 'lookback' bars are automatically excluded from the result, effectively shifting the time window backwards.

Args: numBars: Number of bars to return. Use IndicatorDataService.ALL_BARS to retrieve all available bars.

Returns: List of Bar objects containing OHLC data in chronological order (oldest first). If lookback > 0, the result excludes the most recent 'lookback' bars.

Raises: NoDataException: If the requested data is not available.

@abstractmethod
def getNews(self) -> List[investfly.models.marketdata.StockNews]:

Retrieve latest news articles for the configured security.

@abstractmethod
def getSecurity(self) -> investfly.models.marketdata.Security:

Security context captured when the service was created.

@abstractmethod
def getBarInterval(self) -> Optional[investfly.models.marketdata.BarInterval]:

Bar interval captured when the service was created.

@abstractmethod
def getRegularSessionHours(self) -> investfly.models.marketdata.MarketHours:

Regular/liquid session hours for the configured security type (FUTURE = RTH).