Skip to content

UO #

UO #

UO(
    fast_period: int,
    mid_period: int,
    slow_period: int,
    input_values: List[OHLCV] = None,
    input_indicator: Indicator = None,
    input_modifier: InputModifierType = None,
    input_sampling: SamplingPeriodType = None,
)

Bases: Indicator

Ultimate Oscillator.

Input type: OHLCV

Output type: float

Parameters:

Name Type Description Default
fast_period int

Fast period.

required
mid_period int

Mid period.

required
slow_period int

Slow period.

required
input_values List[OHLCV]

List of input values.

None
input_indicator Indicator

Input indicator.

None
input_modifier InputModifierType

Input modifier.

None
input_sampling SamplingPeriodType

Input sampling type.

None
Source code in talipp/indicators/UO.py
def __init__(self, fast_period: int,
             mid_period: int,
             slow_period: int,
             input_values: List[OHLCV] = None,
             input_indicator: Indicator = None,
             input_modifier: InputModifierType = None,
             input_sampling: SamplingPeriodType = None):
    super().__init__(input_modifier=input_modifier,
                     input_sampling=input_sampling)

    self.fast_period = fast_period
    self.mid_period = mid_period
    self.slow_period = slow_period

    self.buy_press = []
    self.true_range = []

    self.add_managed_sequence(self.buy_press)
    self.add_managed_sequence(self.true_range)

    self.initialize(input_values, input_indicator)