Equity Analytics Results Generation
A pipeline is provided with the KX Equities Analytics Accelerator to generate and persist the results of equity analysis. The pipeline performs the analysis on the orders in the Order
table for a given date and persist the results to the OrderAnalytics
table. The pipeline can operate in different modes, which are outlined and discussed below.
Configuring the Pipeline
There are different options for the method of operation when running the pipeline. Adjusting that, along with other configuration options, is achieved using variables in the pipeline code file eqeagentca.q
.
1. Date
By default, the pipeline runs on orders for the previous day's date. This can be adjusted by changing the .eqea.dt
variable in the eqeagentca.q
file. Depending on how the pipeline is triggered, it may not be necessary to adjust this variable manually, it could be changed in the script at run time when using manual execution. For example, see setting up manual TCA generation for details.
2. Querying HDB directly
The pipeline executes an API call to generate the results. The best performance is achieved by querying the HDB directly and this is the default method of operation. If you cannot be sure that all of the relevant data will have reached the HDB at the time of pipeline execution, then the API call should be sent via the service gateway instead. To adjust this, use the .eqea.queryHdb
variable. By default, the variable is set to true
and the HDB is queried directly. If the variable is set to false, the query is sent via the service gateway.
3. HDB pod name
Depending on how your Insights Enterprise database is configured, the HDB pod name could be different. For example, it could have its own individual pod, or be in a pod along with the RDB and IDB. To allow a direct query to the HDB, the pod name must be correct. The .eqea.hdbPod
variable configures the HDB pod suffix, the part of the name after the assembly name. This variable should be adjusted from the default -dap-db
if required. If querying using the service gateway, it is not necessary to adjust this variable.
4. Operate in batches
To allow the pipeline to operate with lower Kubernetes resource settings, it can operate in multiple batches, generating and persisting them one at a time. This feature is disabled by default and can be toggled using the .eqea.batch
variable. Valid settings are true
(execute in multiple batches), or false
(execute in one query).
If the pipeline is operating in batches, the number of instruments per batch is controlled with the .eqea.batchInsNo
variable. This should be an integer value.
5. Direct write of results
The pipeline persists the results using a direct write to the HDB. If you prefer to use RT to persist the results, then the .eqea.directWrite
variable can be changed from the default value of true
to false
.
6. Assembly name
The .eqea.assemblyName
variable should be adjusted to reflect the name of your assembly.
Editing eqeagentca.q
In order to edit the eqeagentca.q
file the Accelerator package must be unpacked. You can then edit them with a text editor.
Refer to the following documentation for general commands to unpack and re-package a package.
Setting up Daily TCA Generation
It is possible to generate equity analysis results on a schedule by setting up a cron job to run a pipeline. The relevant pipeline code is in the eqeagentca.q
file in the equities-ea
package. For detailed steps of how to set up and configure a kubernetes cron job to do this please refer to the appropriate documentation.
Setting up Manual TCA Generation
It is possible to generate equity analysis results by manually executing a pipeline using a script. The relevant pipeline code is in the eqeagentca.q
file in the equities-ea
package. For detailed steps of how to set up and configure the script and package required please refer to the appropriate documentation.