Skip to main content
Version: 8.6.3.4

Schema: SpdrPairLeggerOrder (ID: 5355)

METADATA

AttributeValue
Topic5355-strategy-legger
MLink TokenInternal
MLink EndpointMLink-Live
SRSE ProductSRTrade

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

BODY

#FieldTypeDefault ValueComment
10=orderNumberlongpair legger order number (should be an SR Guid)
100spdrSourceenum : SpdrSource
101accntstring(16)SR trading account
102clientFirmstring(16)SR client firm
103pairCtrlStateenum : PairCtrlState
104strategystring(36)client-supplied strategy string; visible on SpiderRock GUI tools and other order reports.
105userNamestring(24)name of the user entering the order
106orderSizeintpair size (number of complete spreads)
107leggerLimitdoublepair limit
108leggerLimitTypeenum : LeggerLimitTypepair limit type (stock: Price, future: Price, optExpiry: AtmVol only, option: StrikeVol)
109leggerAlgoenum : LeggerAlgo
110legRatioTypeenum : LegRatioTypevega = 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
111numAtmStrikesushortnumber of OptExpiry atm strikes [max 6]
112legExposurePctfloatpercentage of legger order size than can be exposed on a single leg without completing related legs
113legCompletionSlippagedoublemaximum leg slippage to complete an open pair order (in leggerLimitType units)
114marketSessionenum : MarketSession
115orderDurationint[optional] (number of seconds)
116goodTillDttmDateTime[optional] (default: 2099-01-01)
117maxMktPctMovedouble[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
118autoHedgeenum : AutoHedgeonly for optExpiry/optExpiry and option/option pairs
119hedgeSessionenum : MarketSession
120userData1text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
121userData2text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
122childDatatext1client supplied data field; passes through to down stream child orders
123timestampDateTime

REPEATING FIELDS

Legs

#FieldTypeDefault ValueComment
125secKeyOptionKeyleg 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]
126secTypeenum : LeggerSecTypenote: stock/stock, stock/future, future/future, optExpiry/optExpiry or option/option are allowed
127ratioushortleg ratio (note: can be in shares, contracts, vega, wvega, tvega, or wtvega terms) (optExpiry must be in one of the xVega choices)
128legPriorityenum : LegPriorityLead leg(s) fill first (note: if there are no lead legs the first leg in the list will be treated as the lead leg)
129posTypeenum : PositionTypenote: must be Auto for optExpiry (not required for stock)
130ssaleFlagenum : ShortSaleFlagonly for stock legs (and autohedging)
131hedgeInstrumentenum : HedgeInst
132hedgeSecKeyExpiryKeyautohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]

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

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

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

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

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