Schema: SpdrStrategyStateLegX (ID: 5375)
METADATA
Attribute | Value |
---|---|
Topic | 5355-strategy-legger |
MLink Token | Internal |
SRSE Product | SRTrade |
Note: The symbol
=
next to a field number indicates that it is a primary key.
BODY
# | Field | Type | Comment |
---|---|---|---|
10= | strategyNumber | long | strategy order number |
11= | legId | long | |
100 | accnt | string(16) | SR trading account |
103 | clientFirm | string(16) | SR client firm |
106 | spdrSource | enum : SpdrSource | |
109 | secKey | OptionKey | leg Security |
112 | secType | enum : SpdrKeyType | |
115 | mult | ushort | leg ratio |
118 | side | enum : BuySell | |
121 | legState | enum : LegState | |
124 | limitPrice | double | current/live effective limit price |
127 | orderSize | int | working size (from parentBrkrState.orderSize) |
130 | activeSize | int | order active size (from parentBrkrState.orderActiveSize) |
133 | cumFillQty | int | |
136 | avgFillPrc | double | |
139 | cpx1 | float | child price level #1 |
142 | csz1 | int | cumulative size represented at this price |
145 | cpx2 | float | child price level #2 |
148 | csz2 | int | cumulative size represented at this price |
151 | cMore | byte | number of additional child orders at inferior prices (if any) |
154 | numStateUpdates | int | number of record updates (cumulative for the day) |
157 | stateTimestamp | DateTime | SR system timestamp |
160 | spdrBrokerStatus | enum : SpdrBrokerStatus | |
163 | spdrOrderStatus | enum : SpdrOrderStatus | status of the most recent parent order handled by this broker |
166 | spdrCloseReason | enum : SpdrCloseReason | close reason of most recent parent order |
169 | spdrRejectReason | enum : SpdrRejectReason | reject reason (if any) of most recent parent order |
172 | spdrComment | text1 | |
175 | brkrUpdateDttm | DateTime | |
178 | riskLimitSize | int | risk limit size (maximum size to nearest risk limit) |
181 | riskLimitDesc | enum : SpdrRisk | reason for size reduction |
184 | brkrLimitPrice | double | simple limit |
187 | brkrLimitErr | enum : LimitError | |
190 | makeLimitPrice | double | make limit |
193 | makeLimitErr | enum : LimitError | |
196 | takeLimitPrice | double | take limit |
199 | takeLimitErr | enum : LimitError | |
202 | maxProgress | enum : MaxProgress | maximum point of progress for most recent parent order |
205 | maxProgressDetail | text1 | additional detail on point of maximum progress |
208 | maxProgressTime | DateTime | time of last max progress advance |
211 | brokerState | enum : BrokerState | broker monitor state |
214 | brokerCounter | int | number of times order checked by broker monitor (note: most checks result in no action)] |
217 | makeState | enum : AlgoState | [enum] current state of non-marketable order handler (maker) |
220 | makeCounter | int | number of times order checked by post handler (note: most checks result in no action) |
223 | takeState | enum : AlgoState | [enum] current state of marketable order handler (taker) |
226 | takeCounter | int | number of times order checked by take handler (note: most checks result in no action) |
229 | lastChildEvent | enum : ChildEvent | [enum] last event code from broker/child order handler(s) |
232 | lastChildRejectDttm | DateTime | last child order reject dttm (if any) |
235 | lastChildRejectText | text1 | last child order reject reason/text (if any) |
238 | spdrMktState | enum : SpdrMarketState | [enum] market state |
241 | numNewOrders | int | number of child orders generated by this broker (all parent orders) |
244 | numParentLimits | ushort | number of parent limit messages received for this broker |
247 | activeSeconds | float | number of seconds that the parent order was active |
250 | workingSeconds | float | number of child order seconds (can be greater than activeSeconds if working on more than one exchange) |
253 | timestamp | DateTime |
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 = '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)
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=SpdrStrategyStateLegX'
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 = '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)
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=SpdrStrategyStateLegX' \
--data-urlencode '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' \
--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 = '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)
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=SpdrStrategyStateLegX' \
--data-urlencode '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' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=accnt: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 = '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)
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=SpdrStrategyStateLegX' \
--data-urlencode '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' \
--data-urlencode 'group=spdrSource|secType|side|legState|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|riskLimitDesc|brkrLimitErr|makeLimitErr|takeLimitErr|maxProgress|brokerState|makeState|takeState|lastChildEvent|spdrMktState' \
--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 = '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)
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=SpdrStrategyStateLegX' \
--data-urlencode 'where=accnt:eq:ExampleString'