RISK

Client can retrieve pre-trade risk data and set parameters

RISK SETTINGS MESSAGES FROM TRADING SYSTEM

The request for risk setting Data provides data about a particular trader

RISK SETTING

“risk_setting” If there is a database risk record, client will receive a “risk_setting” message for corresponding settings. “firm” and “trader” combination is the key. If admin makes additional change to risk setting, you will receive an update also.

{"washcheck":"","maxopenorders":"","shortsale_monitor":"","maxordersha
res":"","totalallowamount":"","type":"risk_setting","maxpossize":"","marginlimit
":"","SpeedChk":"","symbolfilter":"","optiontotalallowqty":"","equitymaxordersha
res":"","DupOrd":"","percentagelimit":"","optionmaxdollaramount":"","cumnetotval
ue":"","trader":"COUNTRY","active_account":"","optiontotalallowamount":"","fix_u
ser":"N","firm":"LEHM","maxdollaramount":"","maxnumpos":"","totalallowqty":"","o
ptionmarginlimit":"","optionmaxordershares":"","equitymaxdollaramount":"","haltc
heck":"","isocheck":"","blockoc":""}

CURRENT RISK MESSAGE

The trading system will send out continuous updates about the current risk values for this account. This update reflect risk values that account is using.

UPDATE RISK SETTINGS

Update a trader’s risk settings/

“account_update” If client user is permissioned to send this, he can use this message to change risk settings “firm” and “trader” fields are required.

Here is example of request and response from server.

“firm” and “trader” fields are required.
Here is example of request and response from server
{“firm":"LEHM","trader":"0004","type":"account_update","marginlimit":"7000"}
{"result":"OK","firm":"LEHM","trader":"0004","type":"account_update","marginlimit":"7000"}

QUERY RISK HISTORY

Query history of risk settings changes to a trader’s account.

“history_query” This is to query history of what had been changed on this account “firm” and “trader” fields are required. Example of request and response from server

{"firm":"LEHM,"trader":"0004","type":"history_query”}
{"result":"OK","firm":"LEHM","data":[{"time":"1561149282630","data":"W
eb user TEST changed marginlimit from 6000.0 to 7000.0","rec_no":1,"trader":"0004"},{"time":"1561149366850","data":
"Web user TEST changed marginlimit from 7000.0 to 8000.0,","rec_no":2,"trader":"00
04"}],"trader":"0004","type":"history_query","total_rec":2}

“total_rec” tells you how many records should be returned. If there are more than 100 records, you will receive multiple updates. “rec_no” tells you position of record that you received. Last “rec_no” should be equal to “total_rec”, that is also when you know you get all response.

EVENT ALERT/NOTIFICATION & EVENT AUDIT

FI backend provides flexible datastore that allows authorized users to dynamically create tables and store and edit the data with a audit trail of changes. This data is used in any transactional Provides retrieval of events and audit trail.

EXAMPLES OF ALERT NOTIFICATIONS

Below are examples that for “addalert” and “queryalerts”, which is for combined alert event that we will display to admin in the future. Both types and future types are support by the same trading system table (offerdata).

To add an event, “type” field needs to be there, others fields are defined by frontend.

{"firm":"LEEE","account":"0004","errordetails":"what is up","type":"addalert"}

To query existing events:

{"type":"queryalerts","filter":{"account":"0004"}}

“filter” is a json object, that you set to specify what filtering parameters you need to set, you can set multiple different parameters in “filter”, in this example, we are querying alerts that has “account” value as “0004”.

{"result":"OK","data":[{"time":"1589553824231","firm":"LEHM","account"
:"0004","tabletype":"RiskAlert","rec_no":1,"errordetails":"10:43:44.169 received
 risk reject Exceeds margin limit Exceeds margin limit 0004, order info: STAGE L
EHM(KUN) ZVZZT B 1000 100.5, FI refno: 5R4NTE8OHTJKA0, account: 0004"},{"time":"
1589555226088","firm":"LEEE","account":"0004","tabletype":"RiskAlert","rec_no":2
,"errordetails":"what is up","type":"addalerts"}],"type":"queryalerts","total_re
c":2,"filter":{"account":"0004"}}

Last updated