Skip to main content
Version: Upcoming

Schema: MarRiskControlTkOverride (ID: 4551)

MarRiskControlTkOverride records are used to establish ticker-specific risk controls within SpiderRock execution engines. These records are only viewable and editable by users belonging to the same riskFirm as the control records.

METADATA

AttributeValue
Topic4535-risk-control
MLink TokenMARRisk
SRSE ProductSRControl

Note: The symbol = next to a field number indicates that it is a primary key.

BODY

#FieldTypeDefault ValueComment
10=riskFirmstring(16)
11=riskGroupstring(16)
12=tickerTickerKey
13=isTestAccntenum : YesNoif Yes, this control applies only to risk from test accnts
100stkEnabledenum : MarState
101futEnabledenum : MarState
102optEnabledenum : MarState
103blockShortSalesenum : YesNoblock all short sales
104orderMaxStkQtyint-1number of equity shares that can be bought or sold by a single parent order
105orderMaxFutQtyint-1number of futures contracts that can be bought or sold by a single parent order
106orderMaxOptQtyint-1number of option contracts that can be bought or sold by a single parent order
107orderMaxStkDDeltafloat-1maximum (abs) mny per stock parent order; ddelta = shares * pointValue * midPrc
108orderMaxFutDDeltafloat-1maximum (abs) mny per future parent order; ddelta = contracts * pointValue * midPrc
109orderMaxOptDDeltafloat-1maximum (abs) mny per option parent order; ddelta = contracts * pointValue * ABS(de) * uMidPrc
110stkCollarPctfloat-1maximum user limit vs bid/ask price control
111futCollarPctfloat-1maximum user limit vs bid/ask price control
112optCollarPctfloat-1maximum user limit vs bid/ask price control
113maxAccFutCnAbsint-1max absolute (net) accnt future
114maxDayFutCnBotint-1day future contracts bot
115maxDayFutCnSldint-1day future contracts sld
116maxDayFutCnAbsint-1max absolute (net) day future contracts
117modifiedBystring(24)
118modifiedInenum : SysEnvironment
119timestampDateTime

Get Schema API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'MarRiskControlTkOverride'

# Request Parameters for Get Schema Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getschema',
"msgType": MSG_TYPE,
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Msg API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'MarRiskControlTkOverride'

# Replace with your pkey value for getting the specific message desired
PKEY = 'ReplaceThisValueForTheQueryToWork'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned.
VIEW = 'stkEnabled|futEnabled|optEnabled|blockShortSales|orderMaxStkQty|orderMaxFutQty|orderMaxOptQty|orderMaxStkDDelta|orderMaxFutDDelta|orderMaxOptDDelta|stkCollarPct|futCollarPct|optCollarPct|maxAccFutCnAbs|maxDayFutCnBot|maxDayFutCnSld|maxDayFutCnAbs|modifiedBy|modifiedIn|timestamp'

# Replace with your desired where clause.
# a string in the form "field1:eq:valuse" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'riskFirm:eq:ExampleString'

# Request Parameters for getmsg Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getmsg',
"pkey": PKEY,
"msgType": MSG_TYPE,
# Optional Parameters
"view": VIEW,
"where": WHERE
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Msgs API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'MarRiskControlTkOverride'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'stkEnabled|futEnabled|optEnabled|blockShortSales|orderMaxStkQty|orderMaxFutQty|orderMaxOptQty|orderMaxStkDDelta|orderMaxFutDDelta|orderMaxOptDDelta|stkCollarPct|futCollarPct|optCollarPct|maxAccFutCnAbs|maxDayFutCnBot|maxDayFutCnSld|maxDayFutCnAbs|modifiedBy|modifiedIn|timestamp'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'riskFirm:eq:ExampleString'

# Replace with your desired limit of how many messages you receive. The default limit is 500
LIMIT = 500

# Order clause eg. "(field1:DESC | field1:ASC | field2:DESC:ABS | field2:ASC:ABS" (default is unordered; default is faster)
ORDER = 'stkEnabled:ASC'

# Request Parameters for getmsgs Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getmsgs',
"msgType": MSG_TYPE,
# Optional Parameters
"view": VIEW,
"where": WHERE,
"limit": LIMIT,
"order": ORDER
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Aggregate API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'MarRiskControlTkOverride'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'stkEnabled|futEnabled|optEnabled|blockShortSales|orderMaxStkQty|orderMaxFutQty|orderMaxOptQty|orderMaxStkDDelta|orderMaxFutDDelta|orderMaxOptDDelta|stkCollarPct|futCollarPct|optCollarPct|maxAccFutCnAbs|maxDayFutCnBot|maxDayFutCnSld|maxDayFutCnAbs|modifiedBy|modifiedIn|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'stkEnabled|futEnabled|optEnabled|blockShortSales|modifiedIn'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'riskFirm:eq:ExampleString'

# Request Parameters for getaggregate Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getaggregate',
"msgType": MSG_TYPE,
"measure": MEASURE,
"group": GROUP,
# Optional Parameters
"where": WHERE,
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Count API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'MarRiskControlTkOverride'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'riskFirm:eq:ExampleString'

# Request Parameters for getCount Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getcount',
"msgType": MSG_TYPE,
# Optional Parameters
"where": WHERE,
}

response = requests.get(MLINK_PROD_URL, params=params)

Post Msgs API Call

import requests

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Request Parameters
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'postmsgs',
"postaction": "I", # (I)nsert, (U)pdate, (R)eplace, or (D)elete
"postmerge": "Y", # (Y)es or (N)o
}

payload = {
"header": {
"mTyp": "MarRiskControlTkOverride"
},
"message": {
"pkey": {
"riskFirm": "exampleString", // string
"riskGroup": "exampleString", // string
"ticker": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL"
},
"isTestAccnt": "enumValue" // enum(YesNo) - None Yes No
},
"stkEnabled": "enumValue", // enum(MarState) - None, Enable, Disabled, CloseOnly
"futEnabled": "enumValue", // enum(MarState) - None, Enable, Disabled, CloseOnly
"optEnabled": "enumValue", // enum(MarState) - None, Enable, Disabled, CloseOnly
"blockShortSales": "enumValue", // enum(YesNo) - None, Yes, No
"orderMaxStkQty": -1, // int. Default=-1
"orderMaxFutQty": -1, // int. Default=-1
"orderMaxOptQty": -1, // int. Default=-1
"orderMaxStkDDelta": -1, // float. Default=-1
"orderMaxFutDDelta": -1, // float. Default=-1
"orderMaxOptDDelta": -1, // float. Default=-1
"stkCollarPct": -1, // float. Default=-1
"futCollarPct": -1, // float. Default=-1
"optCollarPct": -1, // float. Default=-1
"maxAccFutCnAbs": -1, // int. Default=-1
"maxDayFutCnBot": -1, // int. Default=-1
"maxDayFutCnSld": -1, // int. Default=-1
"maxDayFutCnAbs": -1, // int. Default=-1
"modifiedBy": "exampleString", // string
"modifiedIn": "enumValue", // enum(SysEnvironment) - None, Neptune, Pluto, V7_Stable, V7_Latest, Saturn, Venus, Mars, SysTest, V7_Current
"timestamp": "2025-01-01 12:00:00.000000" // yyyy-MM-dd HH:mm:ss.SSSSSS
}
}

response = requests.post(MLINK_PROD_URL, params=params, json=payload)