Scheduler is used to specify life cycles of FIX sessions and FIX engine in QWFIX system. In this chapter we will walk through examples of using scheduler in QWFIX system.
For example, for US domestic equity trading, a regular session should start taking orders at the time of market open (9:30 AM, US eastern time) and stop taking order at market close (4:00 PM).
In practice, the actual communication channel should have be up and running for a longer interval, in order to handle market open order and transmit executions of market close orders, or pre-market and after-market trading.
Below is a typical scheduler for a US domestic trading session; a "DailyInWeek" schedule with an interval of 06:00 to 20:00 and a time zone of "US eastern time".
The above schedule will be triggered once for every weekday. But how about holidays? During holidays market will be closed. It's better not to schedule session up and running at all during holidays. That can be achieved with exceptions.
Below is a modified scheduler with all US holidays for year 2007 defined. We used an interval of 05:00 - 21:00 to completely "mask out" the session interval of 06:00 - 20:00.
With the new scheduler sessions will be scheduled up and running once every weekdays except on those market holidays in the year 2007.
With support of exceptions, system administrators only need to modify the scheduler once a year to adjust the holiday schedule of that year.
Note: The example above uses the following market holiday scheduler.
| Holiday | Date |
|---|---|
| New Year's Day | January 1st |
| Martin Luther King, Jr. Day | January 15 |
| Presidents' Day | February 19 |
| Good Friday | April 6 |
| Memorial Day | May 28 |
| Independence Day | July 4 |
| Labor Day | September 3 |
| Thanksgiving Day | November 22 |
| Christmas Day | December 25 |
This example demonstrates a configuration for concurrent US domestic and European market trading.
The London exchange follows a daily trading scheduler of 08:00 - 16:30 GMT.
The US equity markets follows a daily trading scheduler of 09:30 - 16:00 EDT, which can be translated to 14:30 - 21:00 GMT.
As demonstrated in the diagram below, there are some overlaps between US and London market schedule.
We can define three schedulers as shown in the table below.
| Scheduler | Time Zone | Interval |
|---|---|---|
| Session_EU | GMT | 06:00 - 18:30 |
| Session_US | EDT | 11:30 - 23:00 |
| Engine_US_EU | GMT | 05:00 - 23:59 |
In the session schedulers, we leave two hours before and after regular intra-day session for pre-market and after-market trading.
The engine scheduler starts 1 hour before the earliest session starts and stops 1 hour after the latest session stops.
With the design of the schedulers demonstrated above, we can use one single process (the engine) for concurrent daily trading of both US and European markets, while still leaving a 5 hour daily down time for system maintenance.
Some Asian markets have multiple trading sessions. It's possible to define multiple intra-day intervals within a single scheduler.

The scheduler shown above is used to control a FIX session. The session will be started twice a day, once in the morning and once in the afternoon. Each time the session will be started as a brand new session with message sequence number reset to "1".
It's also possible to make a near 24X7 scheduler (with "Weekly" interval) for the FIX engine. The engine will be up and running for almost 24X7 in a week with very short weekly down time.
An engine like that can control multiple sessions with schedulers with different time zones. The individual sessions can be individually controlled up and down by the engine following their own schedulers.
The engine will enable users trading different international financial instruments within a single process.
The implementation of scheduler has made it very easy for developers to add schedule support in application with failover support.
For FIX engines and sessions an application is only required to record the start time when the process or session starts.
If the process failed, during the recovery process, the system will check if the process is still in the old schedule interval based on the "start time" and "current time". For sessions, if the current time is still in schedule, the session will continue with the last transmitted sequence numbers (for incoming and outgoing respectively). Otherwise the old session will be terminated and a new session with new sequence number of "1" will be started.