|
static Schedule::Ptr | getInstance (std::shared_ptr< InstrumentProfile > profile) noexcept |
| Returns default schedule instance for specified instrument profile.
|
|
static Schedule::Ptr | getInstance (const std::string &scheduleDefinition) noexcept |
| Returns default schedule instance for specified schedule definition.
|
|
static Schedule::Ptr | getInstance (std::shared_ptr< InstrumentProfile > profile, const std::string &venue) noexcept |
| Returns schedule instance for specified instrument profile and trading venue.
|
|
static std::vector< std::string > | getTradingVenues (std::shared_ptr< InstrumentProfile > profile) noexcept |
| Returns trading venues for specified instrument profile.
|
|
static void | downloadDefaults (const std::string &downloadConfig) noexcept |
| Downloads defaults using specified download config and optionally start periodic download.
|
|
static bool | setDefaults (const std::vector< char > &data) noexcept |
| Sets shared defaults that are used by individual schedule instances.
|
|
Schedule class provides API to retrieve and explore trading schedules of different exchanges and different classes of financial instruments.
Each instance of schedule covers separate trading schedule of some class of instruments, i.e. NYSE stock trading schedule or CME corn futures trading schedule. Each schedule splits entire time scale into separate days that are aligned to the specific trading hours of covered trading schedule.
Returns session that is nearest to the specified time and that is accepted by specified filter.
This method will return Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}) if specified time falls outside of valid date range from 0001-01-02 to 9999-12-30. If no sessions acceptable by specified filter are found within one year this method will return Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}).
To find nearest trading session of any type use this code:
session = schedule->findNearestSessionByTime(time, SessionFilter::TRADING);
To find nearest regular trading session use this code:
session = schedule->findNearestSessionByTime(time, SessionFilter::REGULAR);
- Parameters
-
time | The time to search for |
filter | The filter to test sessions |
- Returns
- The session that is nearest to the specified time and that is accepted by specified filter or
Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}) if specified time falls outside of valid date range
Day::Ptr dxfcpp::Schedule::getDayByYearMonthDay |
( |
std::int32_t | yearMonthDay | ) |
const |
|
noexcept |
Returns day for specified year, month and day numbers.
Year, month, and day numbers shall be packed in the following way:
YearMonthDay = year * 10000 + month * 100 + day
For example, September 28, 1977 has value 19770928.
If specified day does not exist then this method returns day with the lowest valid YearMonthDay that is greater than specified one. This method will return Day::Ptr{nullptr}
(std::shared_ptr<Day>{nullptr}) if specified year, month and day numbers fall outside of valid date range from 0001-01-02 to 9999-12-30.
- Parameters
-
yearMonthDay | The year, month and day numbers to search for |
- Returns
- The day for specified year, month and day numbers or
Day::Ptr{nullptr}
(std::shared_ptr<Day>{nullptr}) if specified year, month and day numbers fall outside of valid date range
- See also
- Day::getYearMonthDay()
Returns session that is nearest to the specified time and that is accepted by specified filter.
This method will return Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}) if specified time falls outside of valid date range from 0001-01-02 to 9999-12-30 or if no sessions acceptable by specified filter are found within one year this method
To find nearest trading session of any type use this code:
session = schedule->getNearestSessionByTime(time, SessionFilter::TRADING);
To find nearest regular trading session use this code:
session = schedule->getNearestSessionByTime(time, SessionFilter::REGULAR);
- Parameters
-
time | The time to search for |
filter | the filter to test sessions |
- Returns
- session that is nearest to the specified time and that is accepted by specified filter or
Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}) if specified time falls outside of valid date range or if no such day was found within one year