Skip to content

PivotsHL #

HLType #

Bases: Enum

Pivot type.

HIGH class-attribute instance-attribute #

HIGH = auto()

High pivot.

LOW class-attribute instance-attribute #

LOW = auto()

Low pivot.

PivotsHL #

PivotsHL(
    high_period: int,
    low_period: int,
    input_values: List[OHLCV] = None,
    input_indicator: Indicator = None,
    input_modifier: InputModifierType = None,
    input_sampling: SamplingPeriodType = None,
)

Bases: Indicator

High/Low Pivots.

Input type: OHLCV

Output type: PivotsHLVal

Parameters:

Name Type Description Default
high_period int

High pivot lookup period.

required
low_period int

Low pivot lookup 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
Warning

The indicator always works with the last but one input value because it cannot handle updates/removals properly. Furthermore, the indicator does not support removing two values in a row.

Source code in talipp/indicators/PivotsHL.py
def __init__(self, high_period: int,
             low_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,
                     output_value_type=PivotsHLVal,
                     input_sampling=input_sampling)

    self.high_period = high_period
    self.low_period = low_period

    self.initialize(input_values, input_indicator)

PivotsHLVal dataclass #

PivotsHLVal(ohlcv: OHLCV = None, type: HLType = None)

PivotsHL output type.

Parameters:

Name Type Description Default
ohlcv OHLCV

Pivot.

None
type HLType

Pivot type.

None