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)

Post 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'

# Request Parameters
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'postmsgs',
"postaction": "U", # (U)pdate, (I)nsert, (R)eplace, or (D)elete
"postmerge": "Y", # (Y)es or (N)o
}

payload = {
"header": {
"mTyp": "SpdrAutoHedgeControl"
},
"message": {
"pkey": {
"accnt": "exampleString", // string
"riskGroupId": 1, // long
"hedgeSecKey": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL",
"dt": "2025-01-01"
},
"hedgeSecType": "enumValue", // enum(SpdrKeyType) - None, Stock, Future, Option, MLeg
"clientFirm": "exampleString" // string
},
"altOrderId": "exampleString", // string
"altAccnt": "exampleString", // string
"altUserName": "exampleString", // string
"srcRoutingCode": "exampleString", // string
"execBrkrCode": "exampleString", // string
"externExDest": "exampleString", // string
"externParams": "exampleString", // text1
"strategy": "exampleString", // string
"userName": "exampleString", // string
"autoHedge": "enumValue", // enum(AutoHedge) - None, Static, AutoMid, AutoCrx, AutoTrn, SpdrAuto, Spdr10S, Spdr30S, Spdr90S, Spdr5M, Spdr30M, SpdrDay, SmartFast, SmartNorm, FastCrx, FastDark, SlowDark, AlphaVwap1pct, AlphaVwap2pct, AlphaVwap5pct, AlphaVwap25pct, Custom, AwayAlgo
"hedgeTarget": "enumValue", // enum(HedgeTarget) - None, HedgeToZero, HedgeToBand
"minHedgeDDelta": 1.0, // float
"maxHedgeDDelta": 1.0, // float
"orderSize": 1, // int
"ssaleFlag": "enumValue", // enum(ShortSaleFlag) - None, Long, Short, Exempt, Auto, Open, Close, Cover, NA
"positionType": "enumValue", // enum(PositionType) - None, Opening, Closing, Auto
"maxExposureSize": 1, // int
"numMakeExchanges": 1, // byte
"publicSize": "enumValue", // enum(PublicSizeHandling) - None, Randomize, MktSize, FullSize, MktSizeA, MktSizeB, MktSizeC, FullSizeR, Max25Pct, Max50Pct, Max75Pct, NoSize
"canOverlapCxlRepl": "enumValue", // enum(YesNo) - None, Yes, No
"progressRule": "enumValue", // enum(ProgressRule) - None, Twap, Vwap, TwapReset, VwapReset, FastReset, SlowReset, TwapAlpha, VwapAlpha, TwapAlphaC, VwapAlphaC, AutoComplete, AllowImmediate, Manual, SpdrPulse, IOC, FlashMakeTake
"progressSliceCnt": 1, // byte
"progressExposeTime": 1, // int
"vwapParticipation": 1.0, // float
"minMktOnClosePct": 1, // byte
"maxMakeExchFee": 1.0, // float
"maxTakeExchFee": 1.0, // float
"incTakeExchFee": "enumValue", // enum(IncExchFee) - None, ExclFee, IncFee
"incMakeExchFee": "enumValue", // enum(IncExchFee) - None, ExclFee, IncFee
"makeExchRule": "enumValue", // enum(MakeExchRule) - None, MaxPart, FeeOptimal, ImprvOnly, FeeStrict, RoundRobin, ProRataOptim
"maxChildOrders": 1, // int
"exchMask": 1, // uint
"marketSession": "enumValue", // enum(MarketSession) - None, PreMkt, RegMkt, PostMkt, PreRegMkt, RegPostMkt, AllDay
"startDttm": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"orderDuration": 1, // int
"activeDuration": 1, // int
"goodTillDttm": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"parentOrderHandling": "enumValue", // enum(ParentOrderHandling) - None, ActiveTaker, PostOnly, DMA, MktOnOpn, MktOnCls, Facilitate, Matrix, Legger, Seeker, SeekerLegger, CrossResponse, AuctionResponse, MLegAuctionResp, RFQRequest, AwayAlgo, ExchPing, BlockAuction, BlockResponse, SweepTake, CobMaker, FaceOmni, TestParent
"parentBalanceHandling": "enumValue", // enum(ParentBalanceHandling) - None, PostWith, PostTurn, PostImprove, PostLimit, MaxIntern, PostWthF, PostImprvR, PostFlash, PostFlashW, PostPeg, PostFlashI
"orderLimitType": "enumValue", // enum(SpdrLimitType) - None, Market, MarketArrival, Prc, PrcDe, PrcDeX, PrcDeT, PrcDeP, PrcDeXT, PrcDeXP, Vol, VolX, PrcV, PrcVX, NoLimit, RelMid, RelJoin, RelCross, SmrtFast, SmrtNorm, RelTurn, PrcDeEm, VolEm, Aux, UPrcPct, PkgNeutral, RcPrem, SynthLimitMM, SynthLimitBW, SynthLimitWW
"takeLimitClass": "enumValue", // enum(SpdrLimitClass) - Simple, Surface, Probability, SurfProb
"makeLimitClass": "enumValue", // enum(SpdrLimitClass) - Simple, Surface, Probability, SurfProb
"orderPrcLimit": 1.0, // double
"orderPrcOffset": 1.0, // double
"stateModel": "enumValue", // enum(StateModel) - None, M1, M2, M3, M4
"takeAlphaType": "enumValue", // enum(AlphaType) - None, Static, Eagle, Hawk, Falcon, Relative
"makeAlphaType": "enumValue", // enum(AlphaType) - None, Static, Eagle, Hawk, Falcon, Relative
"takeAlphaFactor": 1.0, // float
"makeAlphaFactor": 1.0, // float
"takeProbability": 1.0, // float
"makeProbability": 1.0, // float
"timestamp": "2025-01-01 12:00:00.000000" // yyyy-MM-dd HH:mm:ss.SSSSSS
}
}

response = requests.post(MLINK_PROD_URL, params=params, json=payload)