dxFeed Graal CXX API
|
Day represents a continuous period of time approximately 24 hours long. More...
#include <Day.hpp>
Public Types | |
using | Ptr = std::shared_ptr<Day> |
The alias to a type of shared pointer to the Day object. | |
using | Unique = std::unique_ptr<Day> |
The alias to a type of unique pointer to the Day object. | |
Public Member Functions | |
std::shared_ptr< Schedule > | getSchedule () const noexcept |
std::int32_t | getDayId () const noexcept |
std::int32_t | getYearMonthDay () const noexcept |
Returns year, month and day numbers packed in the following way: | |
std::int32_t | getYear () const noexcept |
std::int32_t | getMonthOfYear () const noexcept |
std::int32_t | getDayOfMonth () const noexcept |
std::int32_t | getDayOfWeek () const noexcept |
bool | isHoliday () const noexcept |
bool | isShortDay () const noexcept |
bool | isTrading () const noexcept |
std::int64_t | getStartTime () const noexcept |
std::int64_t | getEndTime () const noexcept |
bool | containsTime (std::int64_t time) const noexcept |
std::int64_t | getResetTime () const noexcept |
std::shared_ptr< Session > | getSessionByTime (std::int64_t time) const noexcept |
Returns session belonging to this day that contains specified time. | |
std::shared_ptr< Session > | getFirstSession (const SessionFilter &filter) const noexcept |
Returns first session belonging to this day accepted by specified filter. | |
std::shared_ptr< Session > | getLastSession (const SessionFilter &filter) const noexcept |
Returns last session belonging to this day accepted by specified filter. | |
std::shared_ptr< Session > | findFirstSession (const SessionFilter &filter) const noexcept |
Returns first session belonging to this day accepted by specified filter. | |
std::shared_ptr< Session > | findLastSession (const SessionFilter &filter) const noexcept |
Returns last session belonging to this day accepted by specified filter. | |
Day::Ptr | getPrevDay (const DayFilter &filter) const noexcept |
Returns previous day accepted by specified filter. | |
Day::Ptr | getNextDay (const DayFilter &filter) const noexcept |
Returns following day accepted by specified filter. | |
Day::Ptr | findPrevDay (const DayFilter &filter) const noexcept |
Returns previous day accepted by specified filter. | |
Day::Ptr | findNextDay (const DayFilter &filter) const noexcept |
Returns following day accepted by specified filter. | |
bool | operator== (const Day &other) const noexcept |
Returns true if this object is equal to other object. | |
bool | operator== (const Day::Ptr &other) const noexcept |
Returns true if this object is equal to other object. | |
std::size_t | getHashCode () const noexcept |
std::string | toString () const noexcept |
Returns a string representation of the current object. | |
Friends | |
struct | Schedule |
struct | Session |
Day represents a continuous period of time approximately 24 hours long.
The day is aligned to the start and the end of business activities of a certain business entity or business process. For example, the day may be aligned to a trading schedule of a particular instrument on an exchange. Thus, different days may start and end at various local times depending on the related trading schedules.
The length of the day depends on the trading schedule and other circumstances. For example, it is possible that day for Monday is longer than 24 hours because it includes part of Sunday; consequently, the day for Sunday will be shorter than 24 hours to avoid overlapping with Monday.
Days do not overlap with each other - rather they form consecutive chain of adjacent periods of time that cover entire time scale. The point on a border line is considered to belong to following day that starts there.
Each day consists of sessions that cover entire duration of the day. If day contains at least one trading session (i.e. session within which trading activity is allowed), then the day is considered trading day. Otherwise the day is considered non-trading day (e.g. weekend or holiday).
Day may contain sessions with zero duration - e.g. indices that post value once a day. Such sessions can be of any appropriate type, trading or non-trading. Day may have zero duration as well - e.g. when all time within it is transferred to other days.
|
noexcept |
true
if specified time belongs to this day.
|
noexcept |
Returns first session belonging to this day accepted by specified filter.
This method does not cross the day boundary. If no such session was found within this day this method will return Session::Ptr{nullptr} (std::shared_ptr<Session>{nullptr})
To find first trading session of any type use this code:
auto session = day->findFirstSession(SessionFilter::TRADING);
To find first regular trading session use this code:
auto session = day->findFirstSession(SessionFilter::REGULAR);
filter | The filter to test sessions |
|
noexcept |
Returns last session belonging to this day accepted by specified filter.
This method does not cross the day boundary. If no such session was found within this day this method will return Session::Ptr{nullptr} (std::shared_ptr<Session>{nullptr})
To find last trading session of any type use this code:
auto session = day->findLastSession(SessionFilter::TRADING);
To find last regular trading session use this code:
auto session = day->findLastSession(SessionFilter::REGULAR);
filter | The filter to test sessions |
Returns following day accepted by specified filter.
This method looks for appropriate day up to a year in the future. If no such day was found within one year this method will return Day::Ptr{nullptr} (std::shared_ptr<Day>{nullptr}).
filter | The filter to test days |
Returns previous day accepted by specified filter.
This method looks for appropriate day up to a year back in time. If no such day was found within one year this method will return Day::Ptr{nullptr} (std::shared_ptr<Day>{nullptr}).
filter | The filter to test days |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Returns first session belonging to this day accepted by specified filter.
This method does not cross the day boundary. If no such session was found within this day this method will return Session::Ptr{nullptr} (std::shared_ptr<Session>{nullptr})
To find first trading session of any type use this code:
Session session = day->getFirstSession(SessionFilter::TRADING);
To find first regular trading session use this code:
Session session = day->getFirstSession(SessionFilter::REGULAR);
filter | The filter to test sessions |
|
noexcept |
|
noexcept |
Returns last session belonging to this day accepted by specified filter.
This method does not cross the day boundary. If no such session was found within this day this method will return Session::Ptr{nullptr} (std::shared_ptr<Session>{nullptr})
To find last trading session of any type use this code:
auto session = day->getLastSession(SessionFilter::TRADING);
To find last regular trading session use this code:
auto session = day->getLastSession(SessionFilter::REGULAR);
filter | The filter to test sessions |
|
noexcept |
Returns following day accepted by specified filter.
This method looks for appropriate day up to a year in the future. If no such day was found within one year this method will return Day::Ptr{nullptr} (std::shared_ptr<Day>{nullptr}).
The | filter the filter to test days |
Returns previous day accepted by specified filter.
This method looks for appropriate day up to a year back in time. If no such day was found within one year this method will return Day::Ptr{nullptr} (std::shared_ptr<Day>{nullptr}).
The | filter the filter to test days |
|
noexcept |
|
noexcept |
|
noexcept |
Returns session belonging to this day that contains specified time.
If no such session was found within this day this method will return Session::Ptr{nullptr} (std::shared_ptr<Session>{nullptr}).
time | The time to search for |
|
noexcept |
|
noexcept |
1977
for the year 1977
.
|
noexcept |
Returns year, month and day numbers packed in the following way:
YearMonthDay = year * 10000 + month * 100 + day
For example, September 28, 1977 has value 19770928.
|
noexcept |
true
if this day is an exchange holiday. Usually there are no trading takes place on an exchange holiday.
|
noexcept |
true
if this day is a short day. Usually trading stops earlier on a short day.
|
noexcept |
true
if trading activity is allowed within this day. Positive result assumes that day has at least one trading session.
|
noexcept |
Returns true
if this object is equal to other
object.
other | Another object |
true
if this object is equal to other
object
|
inlinenoexcept |
Returns true
if this object is equal to other
object.
other | Another object |
true
if this object is equal to other
object
|
noexcept |
Returns a string representation of the current object.