|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dxfeed.schedule.Schedule
public final class Schedule
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.
Method Summary | |
---|---|
static void |
downloadDefaults(String downloadConfig)
Downloads defaults using specified download config and optionally start periodic download. |
Session |
findNearestSessionByTime(long time,
SessionFilter filter)
Returns session that is nearest to the specified time and that is accepted by specified filter. |
Day |
getDayById(int dayId)
Returns day for specified day identifier. |
Day |
getDayByTime(long time)
Returns day that contains specified time. |
Day |
getDayByYearMonthDay(int yearMonthDay)
Returns day for specified year, month and day numbers. |
static Schedule |
getInstance(InstrumentProfile profile)
Returns default schedule instance for specified instrument profile. |
static Schedule |
getInstance(InstrumentProfile profile,
String venue)
Returns schedule instance for specified instrument profile and trading venue. |
static Schedule |
getInstance(String scheduleDefinition)
Returns default schedule instance for specified schedule definition. |
String |
getName()
Returns name of this schedule. |
Session |
getNearestSessionByTime(long time,
SessionFilter filter)
Returns session that is nearest to the specified time and that is accepted by specified filter. |
Session |
getSessionByTime(long time)
Returns session that contains specified time. |
TimeZone |
getTimeZone()
Returns time zone in which this schedule is defined. |
static List<String> |
getTradingVenues(InstrumentProfile profile)
Returns trading venues for specified instrument profile. |
static void |
setDefaults(byte[] data)
Sets shared defaults that are used by individual schedule instances. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Schedule getInstance(InstrumentProfile profile)
profile
- instrument profile those schedule is requested
public static Schedule getInstance(String scheduleDefinition)
scheduleDefinition
- schedule definition of requested schedule
public static Schedule getInstance(InstrumentProfile profile, String venue)
profile
- instrument profile those schedule is requestedvenue
- trading venue those schedule is requested
public static List<String> getTradingVenues(InstrumentProfile profile)
profile
- instrument profile those trading venues are requested
public static void downloadDefaults(String downloadConfig)
downloadConfig
- download configpublic static void setDefaults(byte[] data) throws IOException
data
- content of default data
IOException
- If an I/O error occurspublic Session getSessionByTime(long time)
IllegalArgumentException
if specified time
falls outside of valid date range from 0001-01-02 to 9999-12-30.
time
- the time to search for
IllegalArgumentException
- if specified time falls outside of valid date rangepublic Day getDayByTime(long time)
IllegalArgumentException
if specified time
falls outside of valid date range from 0001-01-02 to 9999-12-30.
time
- the time to search for
IllegalArgumentException
- if specified time falls outside of valid date rangepublic Day getDayById(int dayId)
IllegalArgumentException
if specified day identifier
falls outside of valid date range from 0001-01-02 to 9999-12-30.
dayId
- day identifier to search for
IllegalArgumentException
- if specified day identifier falls outside of valid date rangeDay.getDayId()
public Day getDayByYearMonthDay(int yearMonthDay)
YearMonthDay = year * 10000 + month * 100 + dayFor 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 throw IllegalArgumentException
if specified year, month and day numbers
fall outside of valid date range from 0001-01-02 to 9999-12-30.
yearMonthDay
- year, month and day numbers to search for
IllegalArgumentException
- if specified year, month and day numbers fall outside of valid date rangeDay.getYearMonthDay()
public Session getNearestSessionByTime(long time, SessionFilter filter)
IllegalArgumentException
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 throw NoSuchElementException
.
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);
time
- the time to search forfilter
- the filter to test sessions
IllegalArgumentException
- if specified time falls outside of valid date range
NoSuchElementException
- if no such day was found within one yearpublic Session findNearestSessionByTime(long time, SessionFilter filter)
IllegalArgumentException
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 null.
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);
time
- the time to search forfilter
- the filter to test sessions
IllegalArgumentException
- if specified time falls outside of valid date rangepublic String getName()
public TimeZone getTimeZone()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |