Skip to content

Pivot Points

Pivot

Pivot Point representation.

Attributes:

Name Type Description
value_class

Class to use to generate pivot values

ref str

reference of this instance (see estrade.mixins.ref.RefMixin)

epic estrade.epic.Epic

Epic Instance (see estrade.graph.indicator.base_indicator.BaseIndicator)

epic: Optional[Epic] inherited property readonly

Return the Epic associated to this instance.

Returns:

Type Description
Optional[Epic]

Epic associated to this instance.

ref: str inherited property writable

Return ref of current instance.

Returns:

Type Description
str

reference of current instance.

__init__(self, pivot_type=<PivotType.CLASSIC: 0>, **kwargs) special

Create a new Daily Pivot.

Parameters:

Name Type Description Default
pivot_type PivotType

Type of pivot (see PivotType enum)

<PivotType.CLASSIC: 0>
kwargs

see BaseIndicator

{}
Source code in estrade/graph/indicators/pivot.py
def __init__(
    self, pivot_type: PivotTypeEnum = PivotTypeEnum.CLASSIC, **kwargs
) -> None:
    """
    Create a new Daily Pivot.

    Arguments:
        pivot_type: Type of pivot (see PivotType enum)
        kwargs: see [`BaseIndicator`][estrade.graph.base_indicator.BaseIndicator]
    """
    value_class = PIVOT_TYPE_CLASS_MAPPING[pivot_type]
    BaseIndicator.__init__(
        self,
        value_class=value_class,
        **kwargs,
    )

build_value_from_frame(self, frame, epic_market_open) inherited

Create a new value for this indicator.

This method is triggered when its frame_set create a new Frame.

Parameters:

Name Type Description Default
frame Frame

The newly created frame.

required
epic_market_open bool

is the epic open?

required

Returns:

Type Description
Optional[BaseIndicatorValue]

An instance of this instance value_class (None Market is not open).

Source code in estrade/graph/indicators/pivot.py
def build_value_from_frame(
    self, frame: "Frame", epic_market_open: bool
) -> Optional["BaseIndicatorValue"]:
    """
    Create a new value for this indicator.

    This method is triggered when its `frame_set` create a new
        [`Frame`][estrade.graph.frame_set.Frame].

    Arguments:
        frame: The newly created frame.
        epic_market_open: is the epic open?

    Returns:
        An instance of this instance `value_class` (`None` Market is not open).
    """
    if not self.market_open_only or epic_market_open:
        new_value = self.value_class(
            indicator=self,
            frame=frame,
        )
        return new_value
    return None

Pivot Type Classic

Representation of a classic pivot value.

Attributes:

Name Type Description
indicator estrade.graph.base_indicator.BaseIndicator

Parent indicator.

frame estrade.graph.frame_set.Frame

Parent frame.

closed: bool inherited property readonly

Check if the parent frame is closed.

Returns:

Type Description
bool

Is the parent frame closed?

nb_ticks: int inherited property readonly

Count of Ticks received by the parent frame.

Returns:

Type Description
int

Number of Ticks received by the parent frame.

next: Optional[BaseIndicatorValue] inherited property readonly

Return the value of this indicator on the next frame.

Returns:

Type Description
Optional[BaseIndicatorValue]

This indicator value on the next frame (None if the parent have no next frame)

pivot: Optional[float] property readonly

Pivot value.

Returns:

Type Description
Optional[float]

pivot value (high + low + close) / 3.

previous: Optional[BaseIndicatorValue] inherited property readonly

Return the value of this indicator on the previous frame.

Returns:

Type Description
Optional[BaseIndicatorValue]

This indicator value on the previous frame (None if the parent have no previous frame)

resistance1: Optional[float] property readonly

Resistance 1 value.

Returns:

Type Description
Optional[float]

Resistance 1 value (pivot * 2 - low).

resistance2: Optional[float] property readonly

Resistance 2 value.

Returns:

Type Description
Optional[float]

Resistance 2 value (pivot - (high - low)).

resistance3: Optional[float] property readonly

Resistance 3 value.

Returns:

Type Description
Optional[float]

Resistance 3 value (high + (pivot - low) * 2).

support1: Optional[float] property readonly

Support 1 value.

Returns:

Type Description
Optional[float]

Support 1 value (pivot * 2 - high).

support2: Optional[float] property readonly

Support 2 value.

Returns:

Type Description
Optional[float]

Support 2 value (pivot - (high - low)).

support3: Optional[float] property readonly

Support 3 value.

Returns:

Type Description
Optional[float]

Support 3 value (low - (high - pivot) * 2).

Pivot Type OLHC

Representation of a HBCO pivot value.

Attributes:

Name Type Description
indicator estrade.graph.base_indicator.BaseIndicator

Parent indicator.

frame estrade.graph.frame_set.Frame

Parent frame.

closed: bool inherited property readonly

Check if the parent frame is closed.

Returns:

Type Description
bool

Is the parent frame closed?

nb_ticks: int inherited property readonly

Count of Ticks received by the parent frame.

Returns:

Type Description
int

Number of Ticks received by the parent frame.

next: Optional[BaseIndicatorValue] inherited property readonly

Return the value of this indicator on the next frame.

Returns:

Type Description
Optional[BaseIndicatorValue]

This indicator value on the next frame (None if the parent have no next frame)

pivot: Optional[float] property readonly

Pivot value.

Returns:

Type Description
Optional[float]

pivot value (high + low + close + current open) / 4.

previous: Optional[BaseIndicatorValue] inherited property readonly

Return the value of this indicator on the previous frame.

Returns:

Type Description
Optional[BaseIndicatorValue]

This indicator value on the previous frame (None if the parent have no previous frame)

resistance1: Optional[float] inherited property readonly

Resistance 1 value.

Returns:

Type Description
Optional[float]

Resistance 1 value (pivot * 2 - low).

resistance2: Optional[float] inherited property readonly

Resistance 2 value.

Returns:

Type Description
Optional[float]

Resistance 2 value (pivot - (high - low)).

resistance3: Optional[float] inherited property readonly

Resistance 3 value.

Returns:

Type Description
Optional[float]

Resistance 3 value (high + (pivot - low) * 2).

support1: Optional[float] inherited property readonly

Support 1 value.

Returns:

Type Description
Optional[float]

Support 1 value (pivot * 2 - high).

support2: Optional[float] inherited property readonly

Support 2 value.

Returns:

Type Description
Optional[float]

Support 2 value (pivot - (high - low)).

support3: Optional[float] inherited property readonly

Support 3 value.

Returns:

Type Description
Optional[float]

Support 3 value (low - (high - pivot) * 2).