algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::TradingDay Struct Reference

One calendar date and whether the market opens on it. More...

#include <algotradelib/src/core/calendar.hpp>

Collaboration diagram for algotradelib::TradingDay:

Public Attributes

Date date_ {}
 The market's local calendar date, as the broker reports it.
bool open_ {false}
 Whether the market opens on date_.
std::optional< SessionHours > regular_ {}
 The exchange's regular session on an open day, where the adapter fills it.
std::optional< SessionHours > extended_ {}
 From the start of the first session the broker states for the day to the end of the last, the regular one included.

Detailed Description

One calendar date and whether the market opens on it.

open_ means the exchange trades that day. It is not a banking or settlement business day, which some brokers report separately.

Definition at line 31 of file calendar.hpp.

Member Data Documentation

◆ date_

Date algotradelib::TradingDay::date_ {}

The market's local calendar date, as the broker reports it.

A broker row whose date cannot be read produces no TradingDay; it is counted in TradingCalendar::unreadable_days_ instead.

Definition at line 38 of file calendar.hpp.

Referenced by algotradelib::strategy::stated_session_phase().

◆ extended_

std::optional<SessionHours> algotradelib::TradingDay::extended_ {}

From the start of the first session the broker states for the day to the end of the last, the regular one included.

Absent when only the regular session is filled. It counts only when it contains regular_; otherwise it is ignored and the span is regular_.

Definition at line 55 of file calendar.hpp.

◆ open_

bool algotradelib::TradingDay::open_ {false}

Whether the market opens on date_.

Definition at line 40 of file calendar.hpp.

◆ regular_

std::optional<SessionHours> algotradelib::TradingDay::regular_ {}

The exchange's regular session on an open day, where the adapter fills it.

An adapter that fills it declares BrokerCaps::has_calendar_sessions. It counts only on an open day and when opens_at_ is before closes_at_; see strategy::stated_session_phase.

Definition at line 47 of file calendar.hpp.

Referenced by algotradelib::alpaca::AlpacaBlockingClient::calendar().


The documentation for this struct was generated from the following file: