Skip to main content
Version: Upcoming

Schema: AutoHedgeControlGateway (ID: 5130)

SpdrAutoHedgeControl contains autohedge / risk group control details. Can be uploaded from SRSE, created from ExecutionEngines, or created by SR tools.

METADATA

AttributeValue
Topic5120-srse-gateway
MLink TokenInternal
SRSE ProductSRTrade

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

BODY

#FieldTypeComment
10=accntstring(16)
11=riskGroupIdlongriskGroupId = 0 means hedgeScope = Accnt
12=hedgeSecKeyExpiryKeyExecution Hedge SecKey (from SpdrParentExecution.hedgeSecKey)
13=hedgeSecTypeenum : SpdrKeyTypeExecution Hedge SecType (Stock or Future)
14=clientFirmstring(16)
100altOrderIdstring(24)alternate order ID (usually clOrdId from client)
103altAccntstring(32)alternate (client assigned) "long" account string (optional) [used to map between client and SR account strings]
106altUserNamestring(24)alternate (client assigned) user name (optional) [used to map between client and SR account strings]
109srcRoutingCodestring(65)inbound FIX routing code or SRSE/tool server appID (if any)
112accntRouteCodetext1accntRoute acronym
250externExDeststring(16)routing code for orders directed to an external order router (default = null); should match FixRoutingTable.destination (in SR accnt config)
118externParamstext1external algo names/parameters (usually just an algo name)
121strategystring(36)client-supplied strategy string;visible on SpiderRock GUI tools and other order reports.
124userNamestring(24)name of the user entering the order
127autoHedgeenum : AutoHedgeauto-hedge algorithm (used for restoring tickets)
130hedgeTargetenum : HedgeTarget
133minHedgeDDeltafloatdo not generate autohedge orders if total group Deltaisbetween[minHedgeDDeltaandmaxHedgeDDelta](eg.[Delta is between [minHedgeDDelta and maxHedgeDDelta] (eg.[-100,000, +$100,000])
136maxHedgeDDeltafloat
139orderSizeintinitial (and maximum) size of a hedge parent buy or sell order. note: actual working size will be controlled by the autohedge server based on filled deltas but working size cannot exceed orderSize
142ssaleFlagenum : ShortSaleFlag
145maxExposureSizeintmaximum simultaneous cumulative child order public size exposure (-1 = orderActiveSize) [order can overfill if > orderActiveSize and numMakeExchanges > 1]
148numMakeExchangesbytenumber 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 : PublicSizeHandlingpublic order size handling: None=use default size handling (usually limits public size to 'typical' market size); Randomize=randomize public size; FullSize=expose entire order size where possible
154canOverlapCxlReplenum : YesNocan execution engines overlap cancel/replace operations [order can overfill if YES] (at most one active overlapping cxl/replace operation for each parent order)
157progressRuleenum : ProgressRuleImmediate = all size immediately available; TWAP = size released in time intervals;VWAP = size released in volume intervals;TwapForce = size released in intervals/execution forced at the end of interval
160progressSliceCntbytenumber of twap slices to use (default = 4 or 8) [max 20]
163progressExposeTimeintminimum 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)
166vwapParticipationfloattarget vwap participation rate (target % of trade activity)
169minMktOnClosePctbyteMinimum pct [0 - 100] of order reserved for the on-close auction
172maxMakeExchFeefloatmaximum making exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
175maxTakeExchFeefloatmaximum taking exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
178incTakeExchFeeenum : IncExchFeeinclude exchange fee in probability
181incMakeExchFeeenum : IncExchFeeinclude exchange fee in probability
184makeExchRuleenum : MakeExchRuleActiveMaker exchange preference rule: 'MaxPart' will pick exchanges to maximize participation; 'FeeOrder' will pick exchanges to minimize fees [maximize rebates]; 'ImprvOnly' will only make when improving NBBO.
187maxChildOrdersintmaximum 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]
190exchMaskuinteligible exchanges (0 = all)
248marketSessionenum : MarketSession
196startDttmDateTime[optional] (parent order start time)
199orderDurationint[optional] (number of seconds)
249activeDurationint
202goodTillDttmDateTime[optional] (default: 2099-01-01)
205parentOrderHandlingenum : ParentOrderHandling
208parentBalanceHandlingenum : ParentBalanceHandling
211orderLimitTypeenum : SpdrLimitType
214takeLimitClassenum : SpdrLimitClassSimple = LimitPrice, Probability = BEST(LimitPrice, ProbLimit)
217makeLimitClassenum : SpdrLimitClassSimple = LimitPrice, Probability = BEST(LimitPrice, ProbLimit)
220orderPrcLimitdoubleApplies if LimitType = Prc[]
223orderPrcOffsetdoubledefault=0
226stateModelenum : StateModel
229takeAlphaTypeenum : AlphaTypeApplies if takeLimitClass = Probability
232makeAlphaTypeenum : AlphaTypeApplies if makeLimitClass = Probability
235takeAlphaFactorfloat[-2,+2] takeProbLimit = MAX(takeProbability, takeProbAvg + takeAlphaFactor * takeProbStd) [if AlphaType = Relative]
238makeAlphaFactorfloat[-2,+2] makeProbLimit = MAX(makeProbability, makeProbAvg + makeAlphaFactor * makeProbStd) [if AlphaType = Relative]
241takeProbabilityfloattakeProbLimit = takeProbability [if AlphaType = Static]
244makeProbabilityfloatmakeProbLimit = makeProbability [if AlphaType = Static]
247timestampDateTimerecord timestamp

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

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

# 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 = 'altOrderId|altAccnt|altUserName|srcRoutingCode|accntRouteCode|externExDest|externParams|strategy|userName|autoHedge|hedgeTarget|minHedgeDDelta|maxHedgeDDelta|orderSize|ssaleFlag|maxExposureSize|numMakeExchanges|publicSize|canOverlapCxlRepl|progressRule|progressSliceCnt|progressExposeTime|vwapParticipation|minMktOnClosePct|maxMakeExchFee|maxTakeExchFee|incTakeExchFee|incMakeExchFee|makeExchRule|maxChildOrders|exchMask|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|orderPrcLimit|orderPrcOffset|stateModel|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|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 = 'AutoHedgeControlGateway'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'altOrderId|altAccnt|altUserName|srcRoutingCode|accntRouteCode|externExDest|externParams|strategy|userName|autoHedge|hedgeTarget|minHedgeDDelta|maxHedgeDDelta|orderSize|ssaleFlag|maxExposureSize|numMakeExchanges|publicSize|canOverlapCxlRepl|progressRule|progressSliceCnt|progressExposeTime|vwapParticipation|minMktOnClosePct|maxMakeExchFee|maxTakeExchFee|incTakeExchFee|incMakeExchFee|makeExchRule|maxChildOrders|exchMask|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|orderPrcLimit|orderPrcOffset|stateModel|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|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 = 'altOrderId: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 = 'AutoHedgeControlGateway'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'altOrderId|altAccnt|altUserName|srcRoutingCode|accntRouteCode|externExDest|externParams|strategy|userName|autoHedge|hedgeTarget|minHedgeDDelta|maxHedgeDDelta|orderSize|ssaleFlag|maxExposureSize|numMakeExchanges|publicSize|canOverlapCxlRepl|progressRule|progressSliceCnt|progressExposeTime|vwapParticipation|minMktOnClosePct|maxMakeExchFee|maxTakeExchFee|incTakeExchFee|incMakeExchFee|makeExchRule|maxChildOrders|exchMask|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|orderPrcLimit|orderPrcOffset|stateModel|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'autoHedge|hedgeTarget|ssaleFlag|publicSize|canOverlapCxlRepl|progressRule|incTakeExchFee|incMakeExchFee|makeExchRule|marketSession|parentOrderHandling|parentBalanceHandling|orderLimitType|takeLimitClass|makeLimitClass|stateModel|takeAlphaType|makeAlphaType'

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

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