Schema: SpdrAllocationNotice (ID: 3695)
METADATA
| Attribute | Value |
|---|---|
| Topic | 3695-order-allocation |
| MLink Token | ClientTrading |
| SRSE Product | SRTrade |
Note: The symbol
=next to a field number indicates that it is a primary key.
BODY
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 10= | allocNumber | long | unique number assigned to this allocation notice | |
| 100 | tradeDate | DateKey | ||
| 103 | clientFirm | string(16) | ||
| 106 | omniAccnt | string(16) | omnibus accnt (SR accnt) | |
| 109 | secKey | OptionKey | security key (stock, future, or option) | |
| 112 | secType | enum : SpdrKeyType | security type | |
| 115 | mlegLegKey | text1 | [secKey.StringKey;legRatio;side;positionEffect, secKey.StringKey;legRatio;side;positionEffect, ...] | |
| 118 | orderSide | enum : BuySell | order side (always buy for MLEG orders) | |
| 121 | ssaleFlag | enum : ShortSaleFlag | ssale flag (None if not stock) | |
| 124 | positionType | enum : PositionType | positionType (None if not equity option) | |
| 127 | noticeState | enum : NoticeState | indicates that this noticed is ready to forward to a custodian | |
| 130 | noticeText | text1 | ||
| 133 | allocMethod | enum : AllocMethod | method for delivery of the allocation instruction to the broker | |
| 402 | execBrkrCode | string(16) | used for FIX routing (can be null) | |
| 403 | allocExDest | string(16) | used for FIX routing | |
| 136 | orderShape | enum : SpdrOrderShape | Single or MLeg | |
| 139 | cumFillQuantity | int | total fill size of all ChildOrders | |
| 142 | avgFillPrice | double | parent order average fill price | |
| 145 | netMoney | double | net allocation money | |
| 376 | modifiedBy | string(24) | user who last modified this record | |
| 379 | modifiedIn | enum : SysEnvironment | ||
| 382 | timestamp | DateTime | timestamp of last modification |
REPEATING FIELDS
ChildOrders
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 151 | clOrdId | long | ||
| 154 | orderSize | int | ||
| 157 | cumFillQuantity | int | ||
| 160 | avgFillPrice | double | ||
| 163 | streetClOrdId | string(24) | usually clOrdID.X16 but can be different if street gateway was translating clOrdId | |
| 166 | streetOrderId | string(24) | street side order ID (for canceling order) |
Fragments
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 172 | accnt | string(16) | SR alloc accnt | |
| 385 | clientFirm | string(16) | SR client firm | |
| 175 | allocAccnt | string(16) | clearing firm alloc accnt (maps to Fix.AllocAccount) | |
| 178 | allocFragId | long | unique ID of this alloc/fragment (maps to Fix.IndividualAllocID) | |
| 181 | allocSize | int | accnt alloc size |
OrderLegs
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 386 | secKey | OptionKey | ||
| 387 | secType | enum : SpdrKeyType | ||
| 388 | mult | ushort | ||
| 389 | side | enum : BuySell | ||
| 390 | legId | long | SR leg Id | |
| 391 | altLegId | string(24) | client leg Id (usually from a FIX order) | |
| 392 | sumLegQty | int | ||
| 393 | sumLegMny | double |
LegPosType
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 395 | secKey | OptionKey | ||
| 396 | secType | enum : SpdrKeyType | ||
| 397 | accnt | string(16) | SR alloc accnt (matches fragment) | |
| 398 | clientFirm | string(16) | SR client firm | |
| 399 | ssaleFlag | enum : ShortSaleFlag | ssale flag (if secType = Stock) | |
| 400 | positionType | enum : PositionType | positionType (if secType != Stock) | |
| 401 | firmPosition | int |
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 = 'SpdrAllocationNotice'
# 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=SpdrAllocationNotice'
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 = 'SpdrAllocationNotice'
# 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 = 'tradeDate|clientFirm|omniAccnt|secKey|secType|mlegLegKey|orderSide|ssaleFlag|positionType|noticeState|noticeText|allocMethod|execBrkrCode|allocExDest|orderShape|cumFillQuantity|avgFillPrice|netMoney|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 = 'clientFirm: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=SpdrAllocationNotice' \
--data-urlencode 'view=tradeDate|clientFirm|omniAccnt|secKey|secType|mlegLegKey|orderSide|ssaleFlag|positionType|noticeState|noticeText|allocMethod|execBrkrCode|allocExDest|orderShape|cumFillQuantity|avgFillPrice|netMoney|modifiedBy|modifiedIn|timestamp' \
--data-urlencode 'where=clientFirm: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 = 'SpdrAllocationNotice'
# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'tradeDate|clientFirm|omniAccnt|secKey|secType|mlegLegKey|orderSide|ssaleFlag|positionType|noticeState|noticeText|allocMethod|execBrkrCode|allocExDest|orderShape|cumFillQuantity|avgFillPrice|netMoney|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 = 'clientFirm: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 = 'tradeDate: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=SpdrAllocationNotice' \
--data-urlencode 'view=tradeDate|clientFirm|omniAccnt|secKey|secType|mlegLegKey|orderSide|ssaleFlag|positionType|noticeState|noticeText|allocMethod|execBrkrCode|allocExDest|orderShape|cumFillQuantity|avgFillPrice|netMoney|modifiedBy|modifiedIn|timestamp' \
--data-urlencode 'where=clientFirm:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=tradeDate: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 = 'SpdrAllocationNotice'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'tradeDate|clientFirm|omniAccnt|secKey|secType|mlegLegKey|orderSide|ssaleFlag|positionType|noticeState|noticeText|allocMethod|execBrkrCode|allocExDest|orderShape|cumFillQuantity|avgFillPrice|netMoney|modifiedBy|modifiedIn|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'secType|orderSide|ssaleFlag|positionType|noticeState|allocMethod|orderShape|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 = 'clientFirm: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=SpdrAllocationNotice' \
--data-urlencode 'measure=tradeDate|clientFirm|omniAccnt|secKey|secType|mlegLegKey|orderSide|ssaleFlag|positionType|noticeState|noticeText|allocMethod|execBrkrCode|allocExDest|orderShape|cumFillQuantity|avgFillPrice|netMoney|modifiedBy|modifiedIn|timestamp' \
--data-urlencode 'group=secType|orderSide|ssaleFlag|positionType|noticeState|allocMethod|orderShape|modifiedIn' \
--data-urlencode 'where=clientFirm: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 = 'SpdrAllocationNotice'
# 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 = 'clientFirm: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=SpdrAllocationNotice' \
--data-urlencode 'where=clientFirm:eq:ExampleString'