Generating Trading Activity Reports
Overview
This document describes how to generate and email trading activity reports using trade-report
script included with Ember distribution.
Running trade-report script
Ember distribution, starting with version 1.12.6, includes trade-report
script in /opt/deltix/ember/bin
folder.
This script takes single yaml configuration file as a parameter, generates one or more excel report files
with summary of trading activity, stores them on disk and also emails to recipients specified in the config file.
To generate and email trade activity reports daily, add a cron job running trade-report script at the end of each trading day. The command executing the script would look like this:
/opt/deltix/ember/bin/trade-report /var/lib/ember-work/report-config.yml
When executed, trade-report
will read Ember messages from TimeBase streams listed in the config for the specified
number of days until the last market closing event. It will generate several trading activity reports:
one report for each source of order requests. Generated report excel files will be stored on disk in
reports folder and then emailed to recipients listed in the config.
Here is an example of 4 days TCLIENT Trading Activity Report:
In the report the orders are split into three groups: Active, Passive and Total. Orders are classified as Active when the order side was an aggressor during the first trade. All other orders are classified as Passive and the Total group includes all orders.
For each group report shows the following statistics for each day of the report:
Reported value | Description |
---|---|
# of Orders | Number of orders issued during trading day |
% Difference in # of Orders | % difference of the number of orders relative to the previous day in the report |
Fill Quantity | Total quantity filled |
% Difference in Fill Quantity | % difference of fill quantity relative to the previous day in the report |
% of Total Fill Quantity | % difference of fill quantity relative to the total filled quantity during full report period |
Fill Rate | % of orders that traded relative to the total number of orders in the group |
Configuration File
Here is an example of config yaml file accepted by trade-report script:
calendar:
stream: "calendar"
code: "BrokerTec"
report:
folder: "reports"
numberOfDays: 5
title: "%s Trading Activity Report"
logo:
timebase:
url: dxtick://localhost:8011
user: <user>
password: <pasword>
marketStreams: [ ember-messages ]
email:
subject: "Daily trading activity for %s on %tD"
text: "Please find your daily trading activity report for FIX session %s attached."
from: "noreply@epam.com"
recipients: "default@epam.com"
sourceRecipients:
CLIENT1: "client1@epam.com"
CLIENT2: "client2@epam.com"
smtp:
host: "email-smtp.eu-central-1.amazonaws.com"
port: 465
user: ${AWS_ACCESS_KEY_ID_EOD}
password: ${AWS_SECRET_ACCESS_KEY_EOD}
sslProtocols: [ "TLSv1.2" ]
Any attribute in the config file can be replaced with an environment variable. For example:
email.smtp.password: ${AWS_SECRET_ACCESS_KEY}
as shown in the config example above.
Supported attributes:
Group | Attribute | Description |
---|---|---|
report | folder | Folder where generated excel report files will be stored |
numberOfDays | Period in number of days back from the last trading day which data should be included in the report | |
title | Report title. Similarly to email.subject attribute it can include two String.format parameter. See example in email subject description | |
logo | JPEG file name of small logo that should be displayed at the top of the report | |
timebase | url | TimeBase URL |
user | TimeBase user name | |
password | TimeBase user password | |
marketStreams | TimeBase messages streams generated by Ember TimeBase Warehouse | |
subject | Subject of trading activity report email. Attribute value can contain two String.format parameters that will be substituted with source ID and report date in this order. For example: "Daily trading activity for %s on %tD". The message can either omit just the date parameter or both, but cannot switch their order. | |
text | Text of trading activity report email. Similarly to subject attribute value can include two String.format parameters for report order source ID and date | |
from | Email address from which report emails should be sent | |
recipients | Comma separated list of email addresses used by default when no specific source recipient is configured | |
sourceRecipients | A table of order SOURCE recipients that can specify a comma separated list of recipients for each report orders source. See example above | |
smtp | SMTP server configuration that includes these attributes: | |
debug | When set to "true" will prevent report emails from being sent. This attribute can be used for initial testing of report parameters without generating unnecessary emails | |
calendar | stream | Trading calendar TimeBase stream name |
code | Trading calendar name | |
marketClosingTime | When trading calendar is not available, this top level attribute can be used to specify the time when markets close each day in hh:mm:ss format | |
timeZone | When trading calendar is not available, this top level attribute can be used to specify the time zone in which markets operate" |