Session represents a continuous period of time during which apply same rules regarding trading activity.
For example, regular trading session
is a period of time consisting of one day of business activities in a financial market, from the opening bell to the closing bell, when regular trading occurs.
Sessions can be either trading or non-trading, with different sets of rules and reasons to exist. Sessions 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 session that starts there. Each session completely fits inside a certain day. 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.
Returns following session accepted by specified filter.
This method may cross the day boundary and return appropriate session from following days - up to a year in the future. If no such session was found within one year this method will return Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}).
To find following trading session of any type use this code:
session = session->findNextSession(SessionFilter::TRADING);
To find following regular trading session use this code:
session = session->findNextSession(SessionFilter::REGULAR);
- Parameters
-
filter | The filter to test sessions |
- Returns
- nearest following session that is accepted by the filter
Returns previous session accepted by specified filter.
This method may cross the day boundary and return appropriate session from previous days - up to a year back in time. If no such session was found within one year this method will return Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}).
To find previous trading session of any type use this code:
session = session->findPrevSession(SessionFilter::TRADING);
To find previous regular trading session use this code:
session = session->findPrevSession(SessionFilter::REGULAR);
- Parameters
-
filter | The filter to test sessions |
- Returns
- nearest previous session that is accepted by the filter
Returns following session accepted by specified filter.
This method may cross the day boundary and return appropriate session from following days - up to a year in the future. If no such session was found within one year this method will return Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}).
To find following trading session of any type use this code:
session = session->getNextSession(SessionFilter::TRADING);
To find following regular trading session use this code:
session = session->getNextSession(SessionFilter::REGULAR);
- Parameters
-
filter | The filter to test sessions |
- Returns
- The nearest following session that is accepted by the filter or
Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}) if no such session was found within one year
Returns previous session accepted by specified filter.
This method may cross the day boundary and return appropriate session from previous days - up to a year back in time. If no such session was found within one year this method will return Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}).
To find previous trading session of any type use this code:
session = session->getPrevSession(SessionFilter::TRADING);
To find previous regular trading session use this code:
session = session->getPrevSession(SessionFilter::REGULAR);
- Parameters
-
filter | The filter to test sessions |
- Returns
- The nearest previous session that is accepted by the filter or
Session::Ptr{nullptr}
(std::shared_ptr<Session>{nullptr}) if no such session was found within one year