![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The intraday session of a market, as the operator states it. More...
#include <algotradelib/src/strategy/event.hpp>
Public Member Functions | |
| MarketPhase | phase (std::chrono::system_clock::time_point now, std::optional< bool > trading_day) const |
| Returns the market phase at an instant. | |
| Date | local_date (std::chrono::system_clock::time_point now) const |
| Returns the market's local date at an instant. | |
| std::chrono::system_clock::time_point | opens_at (std::chrono::system_clock::time_point now) const |
| Returns the instant the session opens on the local date of an instant. | |
Static Public Member Functions | |
| static SessionWindow | krx () |
| Returns the KRX regular session, 09:00-15:30 KST. | |
Public Attributes | |
| std::chrono::minutes | open_ {std::chrono::hours(9)} |
| The session open, in minutes from local midnight. | |
| std::chrono::minutes | close_ {std::chrono::hours(15) + std::chrono::minutes(30)} |
| The session close, in minutes from local midnight. | |
| std::chrono::minutes | utc_offset_ {std::chrono::hours(9)} |
| The market's offset from UTC. | |
| std::string | source_ {"KRX regular session, 09:00-15:30 KST (library default)"} |
| A description of where the window came from, for reports. | |
The intraday session of a market, as the operator states it.
Times are minutes from local midnight, with a fixed UTC offset. The default is the KRX regular session, 09:00-15:30 KST.
|
inlinestatic |
Returns the KRX regular session, 09:00-15:30 KST.
Definition at line 120 of file event.hpp.
Referenced by main(), and algotradelib::backtest::ReplayClock::ReplayClock().
|
inline |
Returns the market's local date at an instant.
Ask the TradingCalendar about this date, not the machine's own: in another time zone they differ for part of each day.
| now | The instant. |
Definition at line 162 of file event.hpp.
Referenced by main().
|
inline |
|
inline |
Returns the market phase at an instant.
| now | The instant. |
| trading_day | Whether now's local date (see local_date) is a trading day, as TradingCalendar::is_trading_day answered it. |
| std::chrono::minutes algotradelib::strategy::SessionWindow::close_ {std::chrono::hours(15) + std::chrono::minutes(30)} |
The session close, in minutes from local midnight.
Definition at line 110 of file event.hpp.
Referenced by algotradelib::backtest::periods_per_year(), and phase().
| std::chrono::minutes algotradelib::strategy::SessionWindow::open_ {std::chrono::hours(9)} |
The session open, in minutes from local midnight.
Definition at line 108 of file event.hpp.
Referenced by opens_at(), algotradelib::backtest::periods_per_year(), and phase().
| std::string algotradelib::strategy::SessionWindow::source_ {"KRX regular session, 09:00-15:30 KST (library default)"} |
| std::chrono::minutes algotradelib::strategy::SessionWindow::utc_offset_ {std::chrono::hours(9)} |
The market's offset from UTC.
Definition at line 112 of file event.hpp.
Referenced by opens_at(), and phase().