Skip to content

contango.market.calendar.calendar

contango.market.calendar.calendar

Calendar

Bases: ABC

A delegation of the available trading times for calendar type (i.e. NYSE or Crypto).

get_expected_timestamps abstractmethod

get_expected_timestamps(start_timestamp: int, end_timestamp: int, interval: Interval) -> tuple[datetime, ...]

Returns the expected available timestamps in a calendar for a specified period.

Parameters:

Name Type Description Default
start_timestamp int

The start time in unix ms.

required
end_timestamp int

The end time in unix ms.

required
interval Interval

The bar interval type.

required

Returns:

Type Description
tuple[datetime, ...]

tuple[datetime]: The dates & times of the available trading bars for the designated period.

Source code in src\contango\market\calendar\calendar.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@abstractmethod
def get_expected_timestamps(
    self,
    start_timestamp: int,
    end_timestamp: int,
    interval: Interval,
) -> tuple[datetime, ...]:
    """
    Returns the expected available timestamps in a calendar for a specified period.

    Args:
        start_timestamp: The start time in unix ms.
        end_timestamp: The end time in unix ms.
        interval: The bar interval type.

    Returns:
        tuple[datetime]: The dates & times of the available trading bars for the designated period.
    """
    ...