Skip to content

Bar Period

BarPeriod

Bases: Enum

Enumeration of bar aggregation periods.

Value Semantics
SECOND Duration of 1 second.
MINUTE Duration of 1 minute.
HOUR Duration of 1 hour.
DAY Duration of 1 day.
Source code in src/onesecondtrader/models/bar_period.py
class BarPeriod(enum.Enum):
    """
    Enumeration of bar aggregation periods.

    | Value    | Semantics            |
    |----------|----------------------|
    | `SECOND` | Duration of 1 second.|
    | `MINUTE` | Duration of 1 minute.|
    | `HOUR`   | Duration of 1 hour.  |
    | `DAY`    | Duration of 1 day.   |
    """

    SECOND = enum.auto()
    MINUTE = enum.auto()
    HOUR = enum.auto()
    DAY = enum.auto()