Skip to content

generateOrderAnalytics

The .fsi.eqea.generateOrderAnalytics API is used to generate Order Analytics from the Order table. The filters can be listed in the supplied dictionary of arguments.

The gw variable below is defined as an IPC connection to the Service Gateway. For example `:insights-qe-gateway:5050 would connect to the query environment gateway within an insights namespace.

Gateway URL

The gw variable below is defined as an IPC connection to the Service Gateway. For example `:insights-qe-gateway:5050 would connect to the query environment gateway within an insights namespace.

// API arguments dictionary.

args:(!) . flip (
    (`table             ; `Order);  
    (`dt                ; 2023.12.22)
    );

opts:()!()
first last gw(`.fsi.eqea.generateOrderAnalytics;args;`callback;opts);
 strikeTime                    instrumentID orderID     ..
------------------------------------------------------- ..
2023.12.22D09:00:00.000000000 035420 KS    1337627996   ..
2023.12.22D09:30:00.000000000 1821 HK      1337627998   ..
2023.12.22D09:30:00.000000000 9618 HK      1337628002   ..
2023.12.22D10:30:53.000000000 BXB AU       1338715065   ..
..

Gateway URL

The $INSIGHTS_URL, $INSIGHTS_CLIENT_ID, $INSIGHTS_CLIENT_SECRET variables should point at your kdb Insights install.

INSIGHTS_TOKEN=`curl -s --header "Content-Type: application/x-www-form-urlencoded" \
    -d "grant_type=client_credentials&client_id=$INSIGHTS_CLIENT_ID&client_secret=$INSIGHTS_CLIENT_SECRET" \
    "${INSIGHTS_URL}/auth/realms/insights/protocol/openid-connect/token" | jq -cr ".access_token"`

DATA=`curl -s -X POST "${INSIGHTS_URL}/servicegateway/fsi/eqea/generateOrderAnalytics" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer $INSIGHTS_TOKEN" \
    -d "$(jq -n \
        '{
            table            : "Order",
            dt               : "2023.12.22"
        }' | jq -cr .)"`


echo $DATA | jq -cr '.payload'

When issuing an IPC request, synchronous requests return a tuple where the first element is the response payload and the second is the response data. Read the asynchronous requests section for how to use the callback argument to get an asynchronous response. Refer to the extended options section for how to use the options like timeouts for your IPC call.

Arguments

These arguments are accepted by .fsi.eqea.generateOrderAnalytics.

Name Required Type Default Example Description
table yes symbol N/A `Order Name of table to retrieve data from.
dt yes date N/A .z.d-1D Date of interest. A start & end time will be infered from this value, beginning at midnight of the provided date, and ending at 23:59:59.
startTS yes timestamp N/A (.z.d-1)+09:00:00 Start time of query window.
endTS yes timestamp N/A (.z.d-1)+17:00:00 End time of query window.
idList no symbol[] () `ABC List of identifiers to select.
filter no list () ("=";exchangeID;LSE) See filter section for more info.
scope no dictionary () (enlistassembly)!(enlist$"fsi-app-eqea") Used for routing the query to the specific assembly and instructing the system to use the aggregator within that assembly to join results.

Note

Either dt OR startTS and endTS arguments must be used to define the query window.

Configuring additional arguments

Gateway URL

The gw variable below is defined as an IPC connection to the Service Gateway. For example `:insights-qe-gateway:5050 would connect to the query environment gateway within an insights namespace.

// API arguments dictionary.

args:(!) . flip (
    (`table             ; `Order);
    (`dt                ; 2023.12.22);
    (`idList            ; `$"CPG LN");
    (`filter            ; ("=";`exchangeID;`LSE))
);

opts:()!()
first last gw(`.fsi.eqea.generateOrderAnalytics;args;`callback;opts);
algoStrategy strikeTime                    instrumentID orderID    tradeDate exchangeID MIC  ISIN         tradingVenueCode executingBrokerCode placementQty..
-----------------------------------------------------------------------------------------------------------------------------------------------------------..
            2023.12.22D08:07:27.000000000 CPG LN       1338715101           LSE        XLON GB00BD6K4575 VWPT-EU          ALJE-EU             24           ..

Gateway URL

The $INSIGHTS_URL, $INSIGHTS_CLIENT_ID, $INSIGHTS_CLIENT_SECRET variables should point at your kdb Insights install.

INSIGHTS_TOKEN=`curl -s --header "Content-Type: application/x-www-form-urlencoded" \
    -d "grant_type=client_credentials&client_id=$INSIGHTS_CLIENT_ID&client_secret=$INSIGHTS_CLIENT_SECRET" \
    "${INSIGHTS_URL}/auth/realms/insights/protocol/openid-connect/token" | jq -cr ".access_token"`

DATA=`curl -s -X POST "${INSIGHTS_URL}/servicegateway/fsi/eqea/generateOrderAnalytics" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer $INSIGHTS_TOKEN" \
    -d "$(jq -n \
        '{
            table            : "Order",
            dt               : "2023.12.22",
            idList           : "CPG LN",
            filter           : ["=","exchangeID","LSE"]
        }' | jq -cr .)"`


echo $DATA | jq -cr '.payload'