Skip to main content
Version: Upcoming

Schema: SpdrAutoHedgeControl (ID: 5295)

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

BridgeFromV7:SpdrRiskGroupControl

METADATA

AttributeValue
Topic5290-strategy-autohedge
MLink TokenClientTrading
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)
103altOrderIdstring(24)alternate order ID (usually clOrdId from client)
106altAccntstring(32)alternate (client assigned) "long" account string (optional) [used to map between client and SR account strings]
109altUserNamestring(24)alternate (client assigned) user name (optional) [used to map between client and SR account strings]
112srcRoutingCodestring(65)inbound FIX routing code or SRSE/tool server appID (if any)
254execBrkrCodestring(16)(optional) override the default execBrkrCode for this order
255externExDeststring(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-supplied strategy string;visible on SpiderRock GUI tools and other order reports.
127userNamestring(24)name of the user entering the order
130autoHedgeenum : AutoHedgeauto-hedge algorithm (used for restoring tickets)
133hedgeTargetenum : HedgeTarget
136minHedgeDDeltafloatdo not generate autohedge orders if total group Deltaisbetween[minHedgeDDeltaandmaxHedgeDDelta](eg.[Delta is between [minHedgeDDelta and maxHedgeDDelta] (eg.[-100,000, +$100,000])
139maxHedgeDDeltafloat
142orderSizeintinitial (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
145ssaleFlagenum : ShortSaleFlag
251positionTypeenum : PositionType
148maxExposureSizeintmaximum simultaneous cumulative child order public size exposure (-1 = orderActiveSize) [order can overfill if > orderActiveSize and numMakeExchanges > 1]
151numMakeExchangesbytenumber 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.
154publicSizeenum : 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
157canOverlapCxlReplenum : YesNocan execution engines overlap cancel/replace operations [order can overfill if YES] (at most one active overlapping cxl/replace operation for each parent order)
160progressRuleenum : 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
163progressSliceCntbytenumber of twap slices to use (default = 4 or 8) [max 20]
166progressExposeTimeintminimum 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)
169vwapParticipationfloattarget vwap participation rate (target % of trade activity)
172minMktOnClosePctbyteMinimum pct [0 - 100] of order reserved for the on-close auction
175maxMakeExchFeefloatmaximum making exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
178maxTakeExchFeefloatmaximum taking exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
181incTakeExchFeeenum : IncExchFeeinclude exchange fee in probability
184incMakeExchFeeenum : IncExchFeeinclude exchange fee in probability
187makeExchRuleenum : 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.
190maxChildOrdersintmaximum 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]
193exchMaskuinteligible exchanges (0 = all)
252marketSessionenum : MarketSession
199startDttmDateTime[optional] (parent order start time)
202orderDurationint[optional] (number of seconds)
253activeDurationint[optional] (number of seconds)
205goodTillDttmDateTime[optional] (default: 2099-01-01)
208parentOrderHandlingenum : ParentOrderHandling
211parentBalanceHandlingenum : ParentBalanceHandling
214orderLimitTypeenum : SpdrLimitType
217takeLimitClassenum : SpdrLimitClassSimple = LimitPrice, Probability = BEST(LimitPrice, ProbLimit)
220makeLimitClassenum : SpdrLimitClassSimple = LimitPrice, Probability = BEST(LimitPrice, ProbLimit)
223orderPrcLimitdoubleApplies if LimitType = Prc[]
226orderPrcOffsetdoubledefault=0
229stateModelenum : StateModel
232takeAlphaTypeenum : AlphaTypeApplies if takeLimitClass = Probability
235makeAlphaTypeenum : AlphaTypeApplies if makeLimitClass = Probability
238takeAlphaFactorfloat[-2,+2] takeProbLimit = MAX(takeProbability, takeProbAvg + takeAlphaFactor * takeProbStd) [if AlphaType = Relative]
241makeAlphaFactorfloat[-2,+2] makeProbLimit = MAX(makeProbability, makeProbAvg + makeAlphaFactor * makeProbStd) [if AlphaType = Relative]
244takeProbabilityfloattakeProbLimit = takeProbability [if AlphaType = Static]
247makeProbabilityfloatmakeProbLimit = makeProbability [if AlphaType = Static]
250timestampDateTimerecord 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 = 'SpdrAutoHedgeControl'

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

# 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|execBrkrCode|externExDest|externParams|strategy|userName|autoHedge|hedgeTarget|minHedgeDDelta|maxHedgeDDelta|orderSize|ssaleFlag|positionType|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 = 'SpdrAutoHedgeControl'

# 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|execBrkrCode|externExDest|externParams|strategy|userName|autoHedge|hedgeTarget|minHedgeDDelta|maxHedgeDDelta|orderSize|ssaleFlag|positionType|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 = 'SpdrAutoHedgeControl'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'altOrderId|altAccnt|altUserName|srcRoutingCode|execBrkrCode|externExDest|externParams|strategy|userName|autoHedge|hedgeTarget|minHedgeDDelta|maxHedgeDDelta|orderSize|ssaleFlag|positionType|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|positionType|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 = 'SpdrAutoHedgeControl'

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