Schema: SpdrPairLeggerOrder (ID: 5355)
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 | strategy | string(36) | client-supplied strategy string; visible on SpiderRock GUI tools and other order reports. | |
| 105 | userName | string(24) | name of the user entering the order | |
| 106 | orderSize | int | pair size (number of complete spreads) | |
| 107 | leggerLimit | double | pair limit | |
| 108 | leggerLimitType | enum : LeggerLimitType | pair limit type (stock: Price, future: Price, optExpiry: AtmVol only, option: StrikeVol) | |
| 109 | leggerAlgo | enum : LeggerAlgo | ||
| 110 | legRatioType | enum : LegRatioType | vega = ve * qty * pv; wVega = vol * ve * qty * pv; tVega = ve / Max(4 * years, 0.1) * qty * pv; wtVega = vol * ve / Max(4 * years, 0.1) * qty * pv | |
| 111 | numAtmStrikes | ushort | number of OptExpiry atm strikes [max 6] | |
| 112 | legExposurePct | float | percentage of legger order size than can be exposed on a single leg without completing related legs | |
| 113 | legCompletionSlippage | double | maximum leg slippage to complete an open pair order (in leggerLimitType units) | |
| 114 | marketSession | enum : MarketSession | ||
| 115 | orderDuration | int | [optional] (number of seconds) | |
| 116 | goodTillDttm | DateTime | [optional] (default: 2099-01-01) | |
| 117 | maxMktPctMove | double | [optional] if any leg stock price, future price, or option underlier price moves more than maxMktPctMove from values at order activation then the entire order will be automatically put on hold | |
| 118 | autoHedge | enum : AutoHedge | only for optExpiry/optExpiry and option/option pairs | |
| 119 | hedgeSession | enum : MarketSession | ||
| 120 | userData1 | text1 | client supplied data field; passes through to parent and child executions and reports as well as FIX drops | |
| 121 | userData2 | text1 | client supplied data field; passes through to parent and child executions and reports as well as FIX drops | |
| 122 | childData | text1 | client supplied data field; passes through to down stream child orders | |
| 123 | timestamp | DateTime |
REPEATING FIELDS
Legs
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 125 | 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] | |
| 126 | secType | enum : LeggerSecType | note: stock/stock, stock/future, future/future, optExpiry/optExpiry or option/option are allowed | |
| 127 | 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) | |
| 128 | legPriority | enum : LegPriority | Lead leg(s) fill first (note: if there are no lead legs the first leg in the list will be treated as the lead leg) | |
| 129 | posType | enum : PositionType | note: must be Auto for optExpiry (not required for stock) | |
| 130 | ssaleFlag | enum : ShortSaleFlag | only for stock legs (and autohedging) | |
| 131 | hedgeInstrument | enum : HedgeInst | ||
| 132 | hedgeSecKey | ExpiryKey | autohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future] |
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 = 'SpdrPairLeggerOrder'
# 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=SpdrPairLeggerOrder'
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 = 'SpdrPairLeggerOrder'
# 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|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|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=SpdrPairLeggerOrder' \
--data-urlencode 'view=spdrSource|accnt|clientFirm|pairCtrlState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|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 = 'SpdrPairLeggerOrder'
# 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|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|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=SpdrPairLeggerOrder' \
--data-urlencode 'view=spdrSource|accnt|clientFirm|pairCtrlState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|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 = 'SpdrPairLeggerOrder'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'spdrSource|accnt|clientFirm|pairCtrlState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrSource|pairCtrlState|leggerLimitType|leggerAlgo|legRatioType|marketSession|autoHedge|hedgeSession'
# 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=SpdrPairLeggerOrder' \
--data-urlencode 'measure=spdrSource|accnt|clientFirm|pairCtrlState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|timestamp' \
--data-urlencode 'group=spdrSource|pairCtrlState|leggerLimitType|leggerAlgo|legRatioType|marketSession|autoHedge|hedgeSession' \
--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 = 'SpdrPairLeggerOrder'
# 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=SpdrPairLeggerOrder' \
--data-urlencode 'where=accnt:eq:ExampleString'