Automating Services with TT Chron
About TT Chron
The TT FIX Adapter installs with a TT application called TT Chron that you can use to automate and schedule services and computer processes on the TT FIX Adapter machine.
TT recommends that you use TT Chron to fully automate and schedule your TT FIX Adapter run times. If you do not use TT Chron to start the TT FIX Adapter automatically, you must start it from either the command line or the desktop icon. TT also recommends that you use TT Chron to automate the process of resetting message sequence numbers for persistent FIX sessions.
TT Chron configuration file
The configuration file for TT Chron is located in <root_drive>:ttconfigttchron.ini. TT Chron monitors all sections in the ttchron.ini file, as follows:
- For all Server and Service sections,
whenever a process, Windows service, or application is scheduled
to run, TT Chron starts it. Then TT Chron monitors its run state
and acts as follows:
- If a program is not running when it should be, TT Chron starts it.
- If a program is running when is not scheduled to do so, TT Chron terminates it.
- For all Job sections, whenever a process is set to run, TT Chron starts the process with any associated arguments. After starting a process in this manner, TT Chron does not monitor or try to stop the process.
Warnings about TT Chron
The ttchron.ini file automatically runs each TT FIX Adapter in its own command window (run_flags=CONSOLE). When you run TT FIX Adapter in this fashion, do not click in the command window. Doing so can freeze the TT FIX Adapter process.
TT Chron and Windows Server 2008
When running TT Chron on a Windows Server 2008 R2 operating system, be aware of the following:
- Starting Programs: TT Chron may not properly close and/or monitor server programs that are started manually. Users should first start TT Chron and allow it to start the server program per its schedule.
- Start TT Chron desktop icon: The Start TT Chron desktop shortcut may not work if User Account Control (UAC) is enabled unless the user right-clicks the icon and selects Run as administrator from the context menu.
Automating TT FIX Adapter run times
To automate TT FIX Adapter run times, you should configure a Server section in the ttchron.ini file.
TT recommends that you configure them to run continuously all week. The TT FIX Adapter should start before any exchanges open and stop after all exchanges close. When configured in this manner, the TT FIX Adapter can run continuously throughout the week, as exemplified in the following TT Chron configuration.
Note: The TT FIX Adapter startup time should never coincide with the TT Gateway maintenance shutdown time. Doing so has been known to cause API licenses to lock and, therefore, leave TT FIX Adapter in an unrecoverable state.
Automating message sequence number resets
To automate message sequence number resets for persistent FIX sessions, you should configure a Job section in the ttchron.ini file.
To ensure that the FIX client always has the ability to re-request as many messages as possible using a persistent session, TT recommends that you reset the message sequence number only once per week. The following is an example of a Job section for a TT FIX Adapter named “ABC” that resets the message sequence numbers of all persistent FIX sessions on Saturday at 5PM.
|[win32-ABCadapterReset]path=c:ttbinABCadapter.exeargs=-r *-* FAorder-ClientAppschedule=B@17:00run_flags=CONSOLE|
- The danger in resetting the message sequence number daily is that a FIX client might miss fills if it is not connected when a reset occurs. For example, if a FIX client disconnects at 11:40PM and reconnects at 12:20AM, any fills that occurred between 11:40PM and 11:45PM could not be re-requested because their sequence numbers are no longer available.
- Do not schedule both the server and job sections to run the TT FIX Adapter at the same time. Assume that the TT FIX Adapter takes a minute to reset the sequence number, purge the TT FIX Adapter cache, and shut down.
In any case, a FIX client must use a sequence number of 1 when connecting to a TT FIX Adapter that has been reset. All subsequent connections should use the appropriate message sequence number.