Skip to main content
Version: 8.6.3.4

Schema: StkOrderGateway (ID: 5225)

Records inserted, updated, or replaced into the StockOrderGateway table are validated and then converted to SpdrParentOrder records and forwarded to the appropriate execution engine for futher processing. Parent orders can be inserted as either active/ready or in a wait start mode that requires subsequent release.

See the SpiderRock Execution Engine concept guide for more details.

METADATA

AttributeValue
Topic5120-srse-gateway
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=tickerTickerKey
11=accntstring(16)SR Account (default = primary account associated with SRSE login)
12=orderSideenum : BuySellOrder side. Values: Buy/Sell.
13=groupingCodelongClient supplied order
14=clientFirmstring(16)
103spdrActionTypeenum : SpdrActionTypeAddReplace[Add (new order), AddReplace (add or replace order), Cancel (cxl existing), Replace (update existing only), Release (modify order active size)]
106altOrderIdstring(24)Alternate client order ID. This order ID will be copied to all execution reports.
109altAccntstring(32)alternate (client assigned) "long" account string (optional) [used to map between client and SR account strings]
112altUserNamestring(24)alternate (client assigned) user name (optional) [used to map between client and SR account strings]
335execBrkrCodestring(16)(optional) override the default execBrkrCode for this order
336externExDeststring(16)routing code for orders directed to an external order router (default = null); should match FixRoutingTable.destination (in SR accnt config)
121externParamstext1external algo names/parameters (usually just an algo name)
124strategystring(36)Client strategy string. This value will appear on the SR Trade Monitor and in execution reports.
339strategyAccntstring(16)SR strategy account (option; if exists will be validated)
340visibleInSVenum : YesNoallow order to be visible in SV (do not use for high volume of orders)
130orderDttmDateTimeorder entry time (from client;if any)
133orderSizeint-1parent order size (contracts) [-1 = no change;used when spdrActionType=Release]
136orderActiveSizeint-1total activated size (total size released for execution) (-1 = all available size)
139addCumFillQuantityenum : YesNoNoIf Yes then OrderSize is calculated @ order arrival as requested OrderSize + existing 'CumFillQuantity'.
341exchMasklong0eligible exchanges (0 = all)
145maxExposureSizeint-1maximum simultaneous cumulative child order public size exposure (-1 = orderActiveSize) [order can overfill if > orderActiveSize and numMakeExchanges > 1]
148numMakeExchangesbyte1number of exchanges (1 - 4) on which to publish public making orders. Effective number might be less than requested number if sufficient exchanges are not available.
151publicSizeenum : PublicSizeHandlingNonepublic order size handling: None=use default size handling (usually limits public size to 'typical' market size); Randomize=randomize public size; MktSize=expose only 'typical' market size; FullSize=expose entire order size where possible
154randomizeSizeenum : YesNoYesrandomize public order size
157canOverlapCxlReplenum : YesNoNocan execution engines overlap cancel/replace operations [order can overfill if YES] (at most one active overlapping cxl/replace operation for each parent order)
160progressRuleenum : ProgressRuleNoneNone = all size immediately available;TWAP = size released in time intervals;VWAP = size released in volume intervals;
163twapSliceCntbyte0[ProgressSliceCnt] number of progress slices to use. if none given will compute based on active size and duration. [max 20]
166progressExposeTimeint0minimum time (secs) to expose order (0 = no minimum; used to guarantee that the order is exposed at mid-market for some time before actively taking)
169vwapParticipationfloat0.10target vwap participation rate (target % of trade activity)
172minMktOnClosePctbyte0Minimum pct [0 - 100] of order reserved for the on-close auction
175auctionResponderenum : AuctionResponderNoneif set, parent order can be an auction responder
178maxMakeExchFeefloat0maximum making exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
181maxTakeExchFeefloat0maximum taking exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
184triggerTypeenum : TriggerTypeNonetype of trigger (PrintVol/SurfVol only for options) [print = print or actionable quote]
187triggerLevelfloat0stop/trigger price for parent order to go active
190cxlUPrcRangeenum : UPrcCxlNonecancel parent order if/when outside min/max uPrc range [_Halt = also cancel if the security/underlier has been halted]
193minUBidfloat0[optional]
196maxUAskfloat0[optional] (< $0.01 = none)
199minMaxTypeenum : MinMaxTypePrcif Prc minUBid/maxUAsk are expressed as prices; if Pct then they are expresses as pct change since parent order arrival
202maxChildOrdersint1000maximum number of child orders that can be generated by this parent order [order will terminate if/when this cap is reached;zero or neg = unlimited]
205spdrStageTypeenum : SpdrStageTypeNoneSizeLock = stage pending modification (can reduce size); SizeModify = stage pending modification (can increase/reduce size)
326marketSessionenum : MarketSessionRegMkt
211startDttmDateTime2000-01-01[optional] (parent order start time)
214orderDurationint-1[optional] (number of seconds)
327activeDurationint-1[optional] (number of seconds)
217goodTillDttmDateTime2000-01-01[optional] (default: 2000-01-01)
220startTypeenum : StartTypeNone[None, WaitTrigger]
226parentOrderHandlingenum : ParentOrderHandlingActiveTaker
229parentBalanceHandlingenum : ParentBalanceHandlingPostLimit
232orderLimitTypeenum : SpdrLimitTypeMarketVarious (Market, Prc, etc.); establishes the primary LimitPrice for a parent order
235takeLimitClassenum : SpdrLimitClassSimpleSimple = LimitPrice, Probability = BEST(LimitPrice, ProbLimit)
238makeLimitClassenum : SpdrLimitClassSimpleSimple = LimitPrice, Probability = BEST(LimitPrice, ProbLimit)
241takeReachRuleenum : ReachRuleNoneNone = reach room immediately available; Delayed = available after [1-3] seconds; Passive = available if contra side aggresses; WeakOnly = only take if available size < avgMarketSize; ISOSweep = Intermarket Sweep [requires WaitTrigger]
244orderPrcLimitdouble0Applies if LimitType = Prc[]
247orderPrcOffsetdouble0default=0
250takeAlphaTypeenum : AlphaTypeNoneApplies if takeLimitClass = Probability
253makeAlphaTypeenum : AlphaTypeNoneApplies if makeLimitClass = Probability
256takeAlphaFactorfloat0[-2,+2] takeProbLimit = MAX(takeProbability, takeProbAvg + takeAlphaFactor * takeProbStd) [if takeAlphaType = Relative]
259makeAlphaFactorfloat0[-2,+2] makeProbLimit = MAX(makeProbability, makeProbAvg + makeAlphaFactor * makeProbStd) [if makeAlphaType = Relative]
262takeProbabilityfloat0takeProbLimit = takeProbability [if takeAlphaType = Static]
265makeProbabilityfloat0makeProbLimit = makeProbability [if makeAlphaType = Static]
268autoHedgeenum : AutoHedgeNone
271hedgeSecKeyExpiryKey-EQT-NMS-1900-01-01auto-hedge instrument (either TickerKey or ExpiryKey) [hedgeSecKey.TickerKey cannot equal order.ticker]
274hedgeSecTypeenum : SpdrKeyTypeNoneNone, Stock, or Future
277hedgeBetaRatiofloat1.0Portion of executed $money to auto-hedge (can be 1.0 / Beta for beta hedging) [-4.0 to +4.0]
280hedgeScopeenum : HedgeScopeRiskGroupAuto-hedge at the RiskGroup or Accnt level
328hedgeSessionenum : MarketSessionRegMkt
286ssaleFlagenum : ShortSaleFlagAutoUsed to determine stock auto-hedge flags.
337locateFirmstring(6)firm granting the locate if using an away locate source for this order
338locatePoolstring(16)locate pool @ firm granting the locate
289maxExchFeefloat99maximum exchange fee allowed when generating orders
292riskGroupIdlong0All group (grp) risk limits below are relative to this riskGroupId. Default: 0 (none). Required to be non-zero if autoHedge is something other than None.
329reqAuxRiskGroupCtrlenum : YesNo
330symDayDDeltaOffsetfloat0max acct+symbol day $delta offset (target)
301maxSymDayDDeltaLnfloat-1max acct+symbol day $delta long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)
304maxSymDayDDeltaShfloat-1max acct+symbol day $delta short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)
307maxGrpDayDDeltaLnfloat-1max acct+riskGroup day $delta long (positive number;-1=no limit);risk limit = max limit - current net counter
310maxGrpDayDDeltaShfloat-1max acct+riskGroup day $delta short (positive number;-1=no limit);risk limit = max limit + current net counter
331maxGrpDayRMetric1Lnfloat-1max acct+riskGroup day rMetric1 long (positive number;-1=no limit);risk limit = max limit - current net counter
332maxGrpDayRMetric1Shfloat-1max acct+riskGroup day rMetric1 short (positive number;-1=no limit);risk limit = max limit + current net counter
333maxGrpDayRMetric1Absfloat-1max acct+riskGroup day rMetric1 abs (positive number;-1=no limit);risk limit = max limit - abs(current net counter)
334grpDayRMetric1Ratiofloat1.0target bot / sld ratio (eg ratio=0.5 means that neutral is bot rMetric1 = 0.5x sld rMetric1)
313traderNamestring(32)Name of the trader associated with the order
316userData1text1client supplied data field; passes through to parent and child executions and reports as well as FIX child orders and drops
319userData2text1client supplied data field; passes through to parent and child executions and reports as well as FIX child orders and drops
322childDatatext1client supplied data field; passes through to down stream child orders
325checksumbyteMust be set to 13. This helps detect some column/value misalignments.

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

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

# 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 = 'spdrActionType|altOrderId|altAccnt|altUserName|execBrkrCode|externExDest|externParams|strategy|strategyAccnt|visibleInSV|orderDttm|orderSize|orderActiveSize|addCumFillQuantity|exchMask|maxExposureSize|numMakeExchanges|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|twapSliceCnt|progressExposeTime|vwapParticipation|minMktOnClosePct|auctionResponder|maxMakeExchFee|maxTakeExchFee|triggerType|triggerLevel|cxlUPrcRange|minUBid|maxUAsk|minMaxType|maxChildOrders|spdrStageType|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|startType|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|orderPrcLimit|orderPrcOffset|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|autoHedge|hedgeSecKey|hedgeSecType|hedgeBetaRatio|hedgeScope|hedgeSession|ssaleFlag|locateFirm|locatePool|maxExchFee|riskGroupId|reqAuxRiskGroupCtrl|symDayDDeltaOffset|maxSymDayDDeltaLn|maxSymDayDDeltaSh|maxGrpDayDDeltaLn|maxGrpDayDDeltaSh|maxGrpDayRMetric1Ln|maxGrpDayRMetric1Sh|maxGrpDayRMetric1Abs|grpDayRMetric1Ratio|traderName|userData1|userData2|childData|checksum'

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

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'spdrActionType|altOrderId|altAccnt|altUserName|execBrkrCode|externExDest|externParams|strategy|strategyAccnt|visibleInSV|orderDttm|orderSize|orderActiveSize|addCumFillQuantity|exchMask|maxExposureSize|numMakeExchanges|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|twapSliceCnt|progressExposeTime|vwapParticipation|minMktOnClosePct|auctionResponder|maxMakeExchFee|maxTakeExchFee|triggerType|triggerLevel|cxlUPrcRange|minUBid|maxUAsk|minMaxType|maxChildOrders|spdrStageType|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|startType|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|orderPrcLimit|orderPrcOffset|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|autoHedge|hedgeSecKey|hedgeSecType|hedgeBetaRatio|hedgeScope|hedgeSession|ssaleFlag|locateFirm|locatePool|maxExchFee|riskGroupId|reqAuxRiskGroupCtrl|symDayDDeltaOffset|maxSymDayDDeltaLn|maxSymDayDDeltaSh|maxGrpDayDDeltaLn|maxGrpDayDDeltaSh|maxGrpDayRMetric1Ln|maxGrpDayRMetric1Sh|maxGrpDayRMetric1Abs|grpDayRMetric1Ratio|traderName|userData1|userData2|childData|checksum'

# 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 = 'spdrActionType: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 = 'StkOrderGateway'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'spdrActionType|altOrderId|altAccnt|altUserName|execBrkrCode|externExDest|externParams|strategy|strategyAccnt|visibleInSV|orderDttm|orderSize|orderActiveSize|addCumFillQuantity|exchMask|maxExposureSize|numMakeExchanges|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|twapSliceCnt|progressExposeTime|vwapParticipation|minMktOnClosePct|auctionResponder|maxMakeExchFee|maxTakeExchFee|triggerType|triggerLevel|cxlUPrcRange|minUBid|maxUAsk|minMaxType|maxChildOrders|spdrStageType|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|startType|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|orderPrcLimit|orderPrcOffset|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|autoHedge|hedgeSecKey|hedgeSecType|hedgeBetaRatio|hedgeScope|hedgeSession|ssaleFlag|locateFirm|locatePool|maxExchFee|riskGroupId|reqAuxRiskGroupCtrl|symDayDDeltaOffset|maxSymDayDDeltaLn|maxSymDayDDeltaSh|maxGrpDayDDeltaLn|maxGrpDayDDeltaSh|maxGrpDayRMetric1Ln|maxGrpDayRMetric1Sh|maxGrpDayRMetric1Abs|grpDayRMetric1Ratio|traderName|userData1|userData2|childData|checksum'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrActionType|visibleInSV|addCumFillQuantity|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|auctionResponder|triggerType|cxlUPrcRange|minMaxType|spdrStageType|marketSession|startType|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|takeAlphaType|makeAlphaType|autoHedge|hedgeSecType|hedgeScope|hedgeSession|ssaleFlag|reqAuxRiskGroupCtrl'

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

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