Skip to main content
Version: 8.4.10.2

Schema: SpdrStrategyStateLegX (ID: 5375)

METADATA

AttributeValue
Topic5355-strategy-legger
MLink TokenInternal
SRSE ProductSRTrade

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

BODY

#FieldTypeComment
10=strategyNumberlongstrategy order number
11=legIdlong
100accntstring(16)SR trading account
103clientFirmstring(16)SR client firm
106spdrSourceenum : SpdrSource
109secKeyOptionKeyleg Security
112secTypeenum : SpdrKeyType
115multushortleg ratio
118sideenum : BuySell
121legStateenum : LegState
124limitPricedoublecurrent/live effective limit price
127orderSizeintworking size (from parentBrkrState.orderSize)
130activeSizeintorder active size (from parentBrkrState.orderActiveSize)
133cumFillQtyint
136avgFillPrcdouble
139cpx1floatchild price level #1
142csz1intcumulative size represented at this price
145cpx2floatchild price level #2
148csz2intcumulative size represented at this price
151cMorebytenumber of additional child orders at inferior prices (if any)
154numStateUpdatesintnumber of record updates (cumulative for the day)
157stateTimestampDateTimeSR system timestamp
160spdrBrokerStatusenum : SpdrBrokerStatus
163spdrOrderStatusenum : SpdrOrderStatusstatus of the most recent parent order handled by this broker
166spdrCloseReasonenum : SpdrCloseReasonclose reason of most recent parent order
169spdrRejectReasonenum : SpdrRejectReasonreject reason (if any) of most recent parent order
172spdrCommenttext1
175brkrUpdateDttmDateTime
178riskLimitSizeintrisk limit size (maximum size to nearest risk limit)
181riskLimitDescenum : SpdrRiskreason for size reduction
184brkrLimitPricedoublesimple limit
187brkrLimitErrenum : LimitError
190makeLimitPricedoublemake limit
193makeLimitErrenum : LimitError
196takeLimitPricedoubletake limit
199takeLimitErrenum : LimitError
202maxProgressenum : MaxProgressmaximum point of progress for most recent parent order
205maxProgressDetailtext1additional detail on point of maximum progress
208maxProgressTimeDateTimetime of last max progress advance
211brokerStateenum : BrokerStatebroker monitor state
214brokerCounterintnumber of times order checked by broker monitor (note: most checks result in no action)]
217makeStateenum : AlgoState[enum] current state of non-marketable order handler (maker)
220makeCounterintnumber of times order checked by post handler (note: most checks result in no action)
223takeStateenum : AlgoState[enum] current state of marketable order handler (taker)
226takeCounterintnumber of times order checked by take handler (note: most checks result in no action)
229lastChildEventenum : ChildEvent[enum] last event code from broker/child order handler(s)
232lastChildRejectDttmDateTimelast child order reject dttm (if any)
235lastChildRejectTexttext1last child order reject reason/text (if any)
238spdrMktStateenum : SpdrMarketState[enum] market state
241numNewOrdersintnumber of child orders generated by this broker (all parent orders)
244numParentLimitsushortnumber of parent limit messages received for this broker
247activeSecondsfloatnumber of seconds that the parent order was active
250workingSecondsfloatnumber of child order seconds (can be greater than activeSeconds if working on more than one exchange)
253timestampDateTime

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

# 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 = 'SpdrStrategyStateLegX'

# 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 = 'accnt|clientFirm|spdrSource|secKey|secType|mult|side|legState|limitPrice|orderSize|activeSize|cumFillQty|avgFillPrc|cpx1|csz1|cpx2|csz2|cMore|numStateUpdates|stateTimestamp|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|brkrUpdateDttm|riskLimitSize|riskLimitDesc|brkrLimitPrice|brkrLimitErr|makeLimitPrice|makeLimitErr|takeLimitPrice|takeLimitErr|maxProgress|maxProgressDetail|maxProgressTime|brokerState|brokerCounter|makeState|makeCounter|takeState|takeCounter|lastChildEvent|lastChildRejectDttm|lastChildRejectText|spdrMktState|numNewOrders|numParentLimits|activeSeconds|workingSeconds|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 = 'SpdrStrategyStateLegX'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'accnt|clientFirm|spdrSource|secKey|secType|mult|side|legState|limitPrice|orderSize|activeSize|cumFillQty|avgFillPrc|cpx1|csz1|cpx2|csz2|cMore|numStateUpdates|stateTimestamp|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|brkrUpdateDttm|riskLimitSize|riskLimitDesc|brkrLimitPrice|brkrLimitErr|makeLimitPrice|makeLimitErr|takeLimitPrice|takeLimitErr|maxProgress|maxProgressDetail|maxProgressTime|brokerState|brokerCounter|makeState|makeCounter|takeState|takeCounter|lastChildEvent|lastChildRejectDttm|lastChildRejectText|spdrMktState|numNewOrders|numParentLimits|activeSeconds|workingSeconds|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 = 'accnt: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 = 'SpdrStrategyStateLegX'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'accnt|clientFirm|spdrSource|secKey|secType|mult|side|legState|limitPrice|orderSize|activeSize|cumFillQty|avgFillPrc|cpx1|csz1|cpx2|csz2|cMore|numStateUpdates|stateTimestamp|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|brkrUpdateDttm|riskLimitSize|riskLimitDesc|brkrLimitPrice|brkrLimitErr|makeLimitPrice|makeLimitErr|takeLimitPrice|takeLimitErr|maxProgress|maxProgressDetail|maxProgressTime|brokerState|brokerCounter|makeState|makeCounter|takeState|takeCounter|lastChildEvent|lastChildRejectDttm|lastChildRejectText|spdrMktState|numNewOrders|numParentLimits|activeSeconds|workingSeconds|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrSource|secType|side|legState|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|riskLimitDesc|brkrLimitErr|makeLimitErr|takeLimitErr|maxProgress|brokerState|makeState|takeState|lastChildEvent|spdrMktState'

# 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 = 'SpdrStrategyStateLegX'

# 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)