Skip to main content
Version: Upcoming

Schema: SpdrMLegBrkrEvent (ID: 4025)

SpdrMLegBrkrEvent records are published when a new or clx/replace parent order arrives causes a broker to beging working and again when a parent order terminates and the underlying broker stops working. The initial version contains state and market data from just after the initial risk check and first attempt at generating child orders.

METADATA

AttributeValue
Topic3985-parent-orders
MLink TokenClientTrading
SRSE ProductSRTrade

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

BODY

#FieldTypeComment
10=parentNumberlong
11=recTypeenum : EventRecTypetype of record [New,Repl,Close]
100tickerTickerKey
103accntstring(16)
106spdrSourceenum : SpdrSource
109groupingCodelong
112orderSideenum : BuySell
115clientFirmstring(16)SR client firm code
118altAccntstring(32)alternate (client assigned) "long" account string (optional)
121altUserNamestring(24)alternate (client assigned) user name (optional)
124eventNumberushort
127stageTypeenum : SpdrStageTypeparent is a staged order [ToolVisible]
260stageReviewenum : StageReview
130baseParentNumberlongSPDR order number (initial number in cancel/replace sequence) (also, source parent for dynamically generated orders;eg auto-hedges)
133prevParentNumberlongSPDR order number (order being cancelled/replaced) (zero if none)
261engineNamestring(32)server stripe
139spdrBrokerStatusenum : SpdrBrokerStatus
142spdrOrderStatusenum : SpdrOrderStatus
145spdrCloseReasonenum : SpdrCloseReason
148spdrRejectReasonenum : SpdrRejectReason
151spdrCommenttext1additional detail if parent closed or rejected
172cumSquareQtyintcum spread quantity filled (all legs received)
175avgSquarePrcdouble
178cumPartialQtyintcum spread quantity partially filled (at least one leg received) [expected cumFilledQty if all legs square up]
181uBiddouble
184uAskdouble
187bidPrcfloat
190askPrcfloat
193bidSizeint
196askSizeint
199openOrderSizeint
202hedgeSecKeyExpiryKeyauto-hedge sec key
205hedgeSecTypeenum : SpdrKeyTypeauto-hedge sec type
208riskLimitSizeintrisk limit size
211riskLimitDescenum : SpdrRiskreason for size reduction
262riskLimitLevelenum : SpdrRiskLevelrisk limit level responsible for reduction
214riskLimitDetailtext1risk limit detail
217limitPricedouble
220limitErrenum : LimitError
223limitErrDesctext1
226algoStateenum : AlgoState
229algoCounterint
232makeStateenum : AlgoState
235makeCounterint
238brokerStateenum : BrokerStatebroker monitor state
241spdrMktStateenum : SpdrMarketState
244childOrderMaskuintbit-mask of all exchange for which a child order was generated
247numChildOrdersushorttotal number of child orders generated by this parent broker (parent number)
250numDayChildOrdersushorttotal number of child orders generated by this parent broker (all day; base parent number)
253modifiedBystring(24)user who last modified this record
256modifiedInenum : SysEnvironment
259timestampDateTimetimestamp of last modification

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 = 'SpdrMLegBrkrEvent'

# 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 = 'SpdrMLegBrkrEvent'

# 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 = 'ticker|accnt|spdrSource|groupingCode|orderSide|clientFirm|altAccnt|altUserName|eventNumber|stageType|stageReview|baseParentNumber|prevParentNumber|engineName|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|cumSquareQty|avgSquarePrc|cumPartialQty|uBid|uAsk|bidPrc|askPrc|bidSize|askSize|openOrderSize|hedgeSecKey|hedgeSecType|riskLimitSize|riskLimitDesc|riskLimitLevel|riskLimitDetail|limitPrice|limitErr|limitErrDesc|algoState|algoCounter|makeState|makeCounter|brokerState|spdrMktState|childOrderMask|numChildOrders|numDayChildOrders|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 = 'accnt: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 = 'SpdrMLegBrkrEvent'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'ticker|accnt|spdrSource|groupingCode|orderSide|clientFirm|altAccnt|altUserName|eventNumber|stageType|stageReview|baseParentNumber|prevParentNumber|engineName|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|cumSquareQty|avgSquarePrc|cumPartialQty|uBid|uAsk|bidPrc|askPrc|bidSize|askSize|openOrderSize|hedgeSecKey|hedgeSecType|riskLimitSize|riskLimitDesc|riskLimitLevel|riskLimitDetail|limitPrice|limitErr|limitErrDesc|algoState|algoCounter|makeState|makeCounter|brokerState|spdrMktState|childOrderMask|numChildOrders|numDayChildOrders|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 = 'accnt: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 = 'ticker: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 = 'SpdrMLegBrkrEvent'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'ticker|accnt|spdrSource|groupingCode|orderSide|clientFirm|altAccnt|altUserName|eventNumber|stageType|stageReview|baseParentNumber|prevParentNumber|engineName|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|cumSquareQty|avgSquarePrc|cumPartialQty|uBid|uAsk|bidPrc|askPrc|bidSize|askSize|openOrderSize|hedgeSecKey|hedgeSecType|riskLimitSize|riskLimitDesc|riskLimitLevel|riskLimitDetail|limitPrice|limitErr|limitErrDesc|algoState|algoCounter|makeState|makeCounter|brokerState|spdrMktState|childOrderMask|numChildOrders|numDayChildOrders|modifiedBy|modifiedIn|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrSource|orderSide|stageType|stageReview|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|hedgeSecType|riskLimitDesc|riskLimitLevel|limitErr|algoState|makeState|brokerState|spdrMktState|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 = 'accnt: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 = 'SpdrMLegBrkrEvent'

# 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 = 'accnt: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)