Skip to content

KVO #

KVO #

KVO(
    fast_period: int,
    slow_period: int,
    input_values: List[OHLCV] = None,
    input_indicator: Indicator = None,
    input_modifier: InputModifierType = None,
    ma_type: MAType = MAType.EMA,
    input_sampling: SamplingPeriodType = None,
)

Bases: Indicator

Klinger Volume Oscillator.

Input type: OHLCV

Output type: float

Parameters:

Name Type Description Default
fast_period int

Fast moving average period.

required
slow_period int

Slow moving average period.

required
input_values List[OHLCV]

List of input values.

None
input_indicator Indicator

Input indicator.

None
input_modifier InputModifierType

Input modifier.

None
ma_type MAType

Moving average type.

EMA
input_sampling SamplingPeriodType

Input sampling type.

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

    self.fast_ma = MAFactory.get_ma(ma_type, fast_period)
    self.add_managed_sequence(self.fast_ma)

    self.slow_ma = MAFactory.get_ma(ma_type, slow_period)
    self.add_managed_sequence(self.slow_ma)

    self.trend = []
    self.add_managed_sequence(self.trend)

    self.cumulative_measurement = []
    self.add_managed_sequence(self.cumulative_measurement)

    self.initialize(input_values, input_indicator)