Trading Hours
Java API
To request trading hours, use Schedule API.
Example
import com.dxfeed.ipf.InstrumentProfile;
import com.dxfeed.ipf.InstrumentProfileReader;
import com.dxfeed.schedule.Schedule;
import com.dxfeed.schedule.SessionFilter;
import java.io.IOException;
import java.util.List;
public class TradingHoursReadingFromIPF {
public static void main(String[] args) {
try {
String URL = "https://tools.dxfeed.com/ipf?SYMBOL=*/PAZ20:XNYM*";
String login = "login";
String password = "password";
List<InstrumentProfile> profiles = new InstrumentProfileReader().readFromFile(URL, login, password);
for (InstrumentProfile instrumentProfile : profiles) {
Schedule schedule = Schedule.getInstance(instrumentProfile);
System.out.println(instrumentProfile.getSymbol() + " " + schedule.toString() + " " +
schedule.getNearestSessionByTime(System.currentTimeMillis(), SessionFilter.REGULAR));
}
} catch (IOException e) {
e.printStackTrace();
}
}
}REST API
REST API allows you to access trading schedules either in JSON format or a human-friendly table in HTML format.
To request trading hours, use the Scheduledecryptor service.
Use https://tools.dxfeed.com/schedule-view?help for help.