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
Attribute | Value |
---|---|
Topic | 3985-parent-orders |
MLink Token | ClientTrading |
SRSE Product | SRTrade |
Note: The symbol
=
next to a field number indicates that it is a primary key.
BODY
# | Field | Type | Comment |
---|---|---|---|
10= | parentNumber | long | |
11= | recType | enum : EventRecType | type of record [New,Repl,Close] |
100 | ticker | TickerKey | |
103 | accnt | string(16) | |
106 | spdrSource | enum : SpdrSource | |
109 | groupingCode | long | |
112 | orderSide | enum : BuySell | |
115 | clientFirm | string(16) | SR client firm code |
118 | altAccnt | string(32) | alternate (client assigned) "long" account string (optional) |
121 | altUserName | string(24) | alternate (client assigned) user name (optional) |
124 | eventNumber | ushort | |
127 | stageType | enum : SpdrStageType | parent is a staged order [ToolVisible] |
260 | stageReview | enum : StageReview | |
130 | baseParentNumber | long | SPDR order number (initial number in cancel/replace sequence) (also, source parent for dynamically generated orders;eg auto-hedges) |
133 | prevParentNumber | long | SPDR order number (order being cancelled/replaced) (zero if none) |
261 | engineName | string(32) | server stripe |
139 | spdrBrokerStatus | enum : SpdrBrokerStatus | |
142 | spdrOrderStatus | enum : SpdrOrderStatus | |
145 | spdrCloseReason | enum : SpdrCloseReason | |
148 | spdrRejectReason | enum : SpdrRejectReason | |
151 | spdrComment | text1 | additional detail if parent closed or rejected |
172 | cumSquareQty | int | cum spread quantity filled (all legs received) |
175 | avgSquarePrc | double | |
178 | cumPartialQty | int | cum spread quantity partially filled (at least one leg received) [expected cumFilledQty if all legs square up] |
181 | uBid | double | |
184 | uAsk | double | |
187 | bidPrc | float | |
190 | askPrc | float | |
193 | bidSize | int | |
196 | askSize | int | |
199 | openOrderSize | int | |
202 | hedgeSecKey | ExpiryKey | auto-hedge sec key |
205 | hedgeSecType | enum : SpdrKeyType | auto-hedge sec type |
208 | riskLimitSize | int | risk limit size |
211 | riskLimitDesc | enum : SpdrRisk | reason for size reduction |
262 | riskLimitLevel | enum : SpdrRiskLevel | risk limit level responsible for reduction |
214 | riskLimitDetail | text1 | risk limit detail |
217 | limitPrice | double | |
220 | limitErr | enum : LimitError | |
223 | limitErrDesc | text1 | |
226 | algoState | enum : AlgoState | |
229 | algoCounter | int | |
232 | makeState | enum : AlgoState | |
235 | makeCounter | int | |
238 | brokerState | enum : BrokerState | broker monitor state |
241 | spdrMktState | enum : SpdrMarketState | |
244 | childOrderMask | uint | bit-mask of all exchange for which a child order was generated |
247 | numChildOrders | ushort | total number of child orders generated by this parent broker (parent number) |
250 | numDayChildOrders | ushort | total number of child orders generated by this parent broker (all day; base parent number) |
253 | modifiedBy | string(24) | user who last modified this record |
256 | modifiedIn | enum : SysEnvironment | |
259 | timestamp | DateTime | timestamp of last modification |
Get Schema API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getschema' \
--data-urlencode 'msgType=SpdrMLegBrkrEvent'
Get Msg API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getmsg' \
--data-urlencode 'pkey=ReplaceThisValueForTheQueryToWork' \
--data-urlencode 'msgType=SpdrMLegBrkrEvent' \
--data-urlencode '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' \
--data-urlencode 'where=accnt:eq:ExampleString'
Get Msgs API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getmsgs' \
--data-urlencode 'msgType=SpdrMLegBrkrEvent' \
--data-urlencode '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' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=ticker:ASC'
Get Aggregate API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getaggregate' \
--data-urlencode 'msgType=SpdrMLegBrkrEvent' \
--data-urlencode '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' \
--data-urlencode 'group=spdrSource|orderSide|stageType|stageReview|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|hedgeSecType|riskLimitDesc|riskLimitLevel|limitErr|algoState|makeState|brokerState|spdrMktState|modifiedIn' \
--data-urlencode 'where=accnt:eq:ExampleString'
Get Count API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getcount' \
--data-urlencode 'msgType=SpdrMLegBrkrEvent' \
--data-urlencode 'where=accnt:eq:ExampleString'