In this section:
Cache Service
This application installs as a windows service and runs in the background to build and manage a cache of recent off-hours stock values that are not otherwise available from the Xignite API.
The cache is intended to keep data to service requests for the current day up to the previous 24 hours. It requests off-hours values from the Xignite API during off-hours only.
Server Time Note
Please note that it is important that the time on the server that the service is installed on be correct. The service only actively checks for off-hours data during off-hours. During market hours and at times when no off-hours trading occurs the service only checks the time and then continues waiting for the off-hours market to begin. For details on what times are considered off-hours see the Off-Hours Defined section.
Installation
A installer app is provided that installs and starts the service automatically. If it is uninstalled the service will be stopped and removed. You can see the service running in the Windows Services list.
This is what the properties page for the service will look like.
Removal
If you need to remove the cache service you can easily do this using the Control Panel - Uninstall Programs option and remove the Xignite Cache.
Settings
Xignite API Key
Note that the cache does require a valid Xignite API key to run. The Xignite Finance Player Client app will pass on the API key it uses to the cache service so that they both use the same valid key.
Other Settings
Some other settings are also saved in a settings file in the ProgramData folder. These include the service hosted IP/name address, port, and run delay.
📁 C:\ProgramData\Bannister Lake\Xignite Cache
Changes to the settings file will take effect the next time the service is started.
Logs
The app will write logs for each day it is running to the ProgramData folder:
📁 C:\ProgramData\Bannister Lake\Xignite Cache\logs
Performance and Debug log messages can be enabled and disabled using the Xignite Finance Player Client.
Automatic Backup
The service holds the active cache data and stock list in memory for quick retrieval while it's running.
The list of stocks and current cache data are also occasionally saved to a backup file in the ProgramData folder.
📁 C:\ProgramData\Bannister Lake\Xignite Cache
This allows the service to be stopped and restarted without losing data that had already been accumulated. However if the service is stopped during off-hours you may miss out on stock values that occur while the service is stopped.
When?
The following describes when the service will save its active stock list and data cache to files:
Stock List
- Service shutdown
- When off-hours end
Data Cache
- Service shutdown
- After every 5 xignite api calls - it saves if new data has been received
- When off-hours end
Stock List
The list of stocks that are selected for off-hours caching are saved to the 📄 stocks.txt file in this folder:
📁 C:\ProgramData\Bannister Lake\Xignite Cache
If already you have a list of stocks that you want to use from another machine or say a copy of the ticker stock list - you can manually edit this file and when the service is restarted - it will read the list and start caching all stocks in the list.
Command Line Control
The service can be stopped and started using windows command line statements:
:: STOP service net stop BLXigniteCache :: START service net start BLXigniteCache
Off-Hours Defined
The off-hours are currently defined based on the documentation from the Xignite API. (June 26, 2018 / version 7.0.0)
Data coverage for these output values include Pre-Market hours 4:00 a.m. to 9:30 a.m. EST and After Market hours 4:00 p.m. to 8:00 p.m. EST