investfly.models.indicator.IndicatorSeries

class IndicatorSeries:

Represents a series of indicator values over time. Provides methods to access the latest value and detect crossovers.

Get the most recent indicator value.

Returns: DatedValue: The latest indicator value with its timestamp

def cross_over( self, other: IndicatorSeries) -> bool:

Check if this indicator series crosses above another indicator series.

Returns True only on the bar/tick where self crosses above other. This means:

  • Previous bar: self < other
  • Current bar: self > other

Args: other: Another IndicatorSeries to compare against

Returns: bool: True if crossover occurred on the current bar/tick, False otherwise

def cross_under( self, other: IndicatorSeries) -> bool:

Check if this indicator series crosses below another indicator series.

Returns True only on the bar/tick where self crosses below other. This means:

  • Previous bar: self > other
  • Current bar: self < other

Args: other: Another IndicatorSeries to compare against

Returns: bool: True if crossunder occurred on the current bar/tick, False otherwise

def toList(self) -> List[investfly.models.common.DatedValue]:

Get all indicator values as a list.

Returns: List[DatedValue]: List of all indicator values, ordered from oldest to newest