How to Keep Trading Schedules Up to Date
Overview
The dxFeed Java API uses the TRADING_HOURS field from the instrument profile together with schedule defaults to determine trading sessions, trading days, and holidays.
If the schedule defaults are outdated, the API may fail to parse a symbol's trading schedule or return session times and holiday dates that no longer apply.
Note
This article applies to applications that use the dxFeed Java API (QD).
Keep schedule defaults up to date
Use one of the following methods to keep schedule defaults up to date.
Load schedule defaults manually
Use this option if the application cannot download schedule updates automatically.
Download the latest schedule.zip file.
Load the file before working with trading schedules:
byte[] data = Files.readAllBytes(Paths.get("schedule.zip")); Schedule.setDefaults(data);
Download and load a new version of the file regularly to keep the schedule defaults up to date.
For more information, see the Schedule class in the dxFeed Java API documentation.
Enable automatic download
Set the following system property to enable automatic download of the latest schedule defaults from https://downloads.dxfeed.com/schedule/schedule.zip:
com.dxfeed.schedule.download=true
For example, pass the property as a JVM argument when starting the application:
java -Dcom.dxfeed.schedule.download=true -jar your-application.jar
Note
Make sure the application has network access to downloads.dxfeed.com.
Update the QD dependency
Update the QD dependency to the latest available version. The QD library includes bundled schedule defaults, which are updated with new releases.
If the issue persists, submit a ticket to the Help Desk. In addition to the information specified in Ticket Requirements, include the QD library version, the TRADING_HOURS value, and the method used to update the schedule defaults.