Schema: SpdrPairLeggerState (ID: 5370)
METADATA
| Attribute | Value |
|---|---|
| Topic | 5355-strategy-legger |
| MLink Token | Internal |
| MLink Endpoint | MLink-Live |
| 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= | orderNumber | long | pair legger order number (should be an SR Guid) | |
| 100 | spdrSource | enum : SpdrSource | ||
| 101 | accnt | string(16) | SR trading account | |
| 102 | clientFirm | string(16) | SR client firm | |
| 103 | pairCtrlState | enum : PairCtrlState | ||
| 104 | pairState | enum : PairState | ||
| 105 | strategy | string(36) | client-supplied strategy string; visible on SpiderRock GUI tools and other order reports. | |
| 106 | userName | string(24) | name of the user entering the order | |
| 107 | orderSize | int | pair size (number of complete spreads) | |
| 108 | leggerLimit | double | pair limit | |
| 109 | leggerLimitType | enum : LeggerLimitType | pair limit type (stock: Price, future: Price, optExpiry: AtmVol only, option: Price or StrikeVol) | |
| 110 | leggerAlgo | enum : LeggerAlgo | ||
| 111 | legRatioType | enum : LegRatioType | ||
| 112 | numAtmStrikes | ushort | number of OptExpiry atm strikes [max 6] | |
| 113 | legExposurePct | float | percentage of legger order size than can be exposed on a single leg without completing related legs | |
| 114 | legCompletionSlippage | double | maximum leg slippage to complete an open pair order (in leggerLimitType units) | |
| 115 | marketSession | enum : MarketSession | ||
| 116 | orderDuration | int | [optional] (number of seconds) | |
| 117 | goodTillDttm | DateTime | [optional] (default: 2099-01-01) | |
| 118 | maxMktPctMove | double | [optional] if any leg stock price, future price, or option underlier price moves move that maxMktPctMove from values at order activation then the entire order will be automatically put on hold | |
| 119 | autoHedge | enum : AutoHedge | only for optExpiry/optExpiry and option/option pairs | |
| 120 | hedgeSession | enum : MarketSession | ||
| 121 | userData1 | text1 | client supplied data field; passes through to parent and child executions and reports as well as FIX drops | |
| 122 | userData2 | text1 | client supplied data field; passes through to parent and child executions and reports as well as FIX drops | |
| 123 | childData | text1 | client supplied data field; passes through to down stream child orders | |
| 124 | pairStatus | enum : PairStatus | ||
| 125 | pairDetail | text1 | ||
| 126 | cumSquareFillQty | int | ||
| 127 | cumPartialFillQty | int | ||
| 128 | avgSquareFillPrc | double | ||
| 129 | pairBidPx | double | synthetic pair bid (from individual leg markets) | |
| 130 | pairAskPx | double | synthetic pair ask (from individual leg markets) | |
| 131 | pairBidSz | double | ||
| 132 | pairAskSz | double | ||
| 133 | timestamp | DateTime |
REPEATING FIELDS
Legs
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 135 | secKey | OptionKey | leg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry] | |
| 136 | secType | enum : LeggerSecType | note: stock/stock, stock/future, future/future, optExpiry/optExpiry or option/option are allowed | |
| 137 | ratio | ushort | leg ratio (note: can be in shares, contracts, vega, wvega, tvega, or wtvega terms) (optExpiry must be in one of the xVega choices) | |
| 138 | legPriority | enum : LegPriority | Lead leg(s) fill first | |
| 139 | posType | enum : PositionType | note: must be Auto for optExpiry (not required for stock) | |
| 140 | ssaleFlag | enum : ShortSaleFlag | only for stock legs (and autohedging) | |
| 141 | hedgeInstrument | enum : HedgeInst | ||
| 142 | hedgeSecKey | ExpiryKey | autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future] | |
| 143 | orderSize | int | working size (from parentBrkrState.orderSize) (sum of all individual orders; in cn/share terms) | |
| 144 | orderActiveSize | int | order active size (from parentBrkrState.orderActiveSize) (sum of all individual orders; in cn/share terms) | |
| 145 | numActiveBrkrs | ushort | number of parent order legs with leg.activeSize > leg.cumFillQty | |
| 146 | numAvailLegBrkrs | ushort | number of parent order legs created | |
| 147 | cumFillQty | double | in LeggerLimitType terms | |
| 148 | avgFillPrc | double | ||
| 149 | activeSprdSize | double | active size (sum of all individual orders; in ratio type terms) | |
| 150 | legStatus | string(32) | ||
| 151 | targetState | enum : LeggerTargetState | ||
| 152 | targetSprdSize | float | ||
| 153 | targetLimitPrice | float | ||
| 154 | bestBidPrc | float | leg best bid price (in terms of limit type) | |
| 155 | bestAskPrc | float | leg best ask price | |
| 156 | bestBidSize | float | leg best bid size (in terms of ratio type) | |
| 157 | bestAskSize | float | leg best ask size | |
| 158 | numNewOrders | int | number of parent orders published | |
| 159 | numLimitUpdates | int | number of parent limit messages published |
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 = 'SpdrPairLeggerState'
# 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=SpdrPairLeggerState'
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 = 'SpdrPairLeggerState'
# 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 = 'spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|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=SpdrPairLeggerState' \
--data-urlencode 'view=spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|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 = 'SpdrPairLeggerState'
# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|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 = 'spdrSource: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=SpdrPairLeggerState' \
--data-urlencode 'view=spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|timestamp' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=spdrSource: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 = 'SpdrPairLeggerState'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrSource|pairCtrlState|pairState|leggerLimitType|leggerAlgo|legRatioType|marketSession|autoHedge|hedgeSession|pairStatus'
# 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=SpdrPairLeggerState' \
--data-urlencode 'measure=spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|timestamp' \
--data-urlencode 'group=spdrSource|pairCtrlState|pairState|leggerLimitType|leggerAlgo|legRatioType|marketSession|autoHedge|hedgeSession|pairStatus' \
--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 = 'SpdrPairLeggerState'
# 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=SpdrPairLeggerState' \
--data-urlencode 'where=accnt:eq:ExampleString'