Schema: SpdrAutoHedgeState (ID: 5300)
SpdrAutoHedgeState records are published by autohedge servers and describe the current state of an autohedge controller that is managing RiskGroup autohedge orders.
METADATA
| Attribute | Value |
|---|---|
| Topic | 5290-strategy-autohedge |
| MLink Token | ClientTrading |
| SRSE Product | SRTrade |
Note: The symbol
=next to a field number indicates that it is a primary key.
BODY
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 10= | accnt | string(16) | ||
| 11= | riskGroupId | long | ||
| 12= | hedgeSecKey | ExpiryKey | Execution Hedge SecKey (from SpdrAutoHedgeControl.targetSecKey) | |
| 13= | hedgeSecType | enum : SpdrKeyType | Execution Hedge SecType (from SpdrAutoHedgeControl.targetSecType) [can be None] | |
| 14= | clientFirm | string(16) | ||
| 100 | groupingCode | long | ||
| 106 | ticker | TickerKey | ticker group (eg. @ES, @ZN) | |
| 109 | securityDesc | text1 | ||
| 112 | ssaleFlag | enum : ShortSaleFlag | ||
| 263 | positionType | enum : PositionType | ||
| 115 | hedgeState | enum : HedgeGroupState | ||
| 118 | hedgeText | text1 | ||
| 121 | uPrc | double | hedge target underlier price | |
| 264 | hedgePrcLmt | float | price limit of the hedge order (if hedge is using hedgeFillUMarkLmtPrc) | |
| 124 | isDeltaMixed | enum : YesNo | ||
| 127 | accumulatorError | text1 | ||
| 130 | grpDeltaBot | double | option delta bot (in ctrlDe units) | |
| 133 | grpDeltaSld | double | ||
| 136 | grpDDeltaBot | double | option $delta bot (using uMid at time of option fill) | |
| 139 | grpDDeltaSld | double | ||
| 142 | lastGrpFillDttm | DateTime | ||
| 145 | ctrlDeltaBot | double | hedge target delta (units) bot | |
| 148 | ctrlDeltaSld | double | ||
| 151 | ctrlDDeltaBot | double | hedge target $delta bot (using actual fill price) | |
| 154 | ctrlDDeltaSld | double | ||
| 157 | lastCtrlFillDttm | DateTime | ||
| 160 | absOptCn | int | total number of option contracts executed in this hedge group | |
| 163 | netDelta | double | grpDeltaBot - grpDeltaSld + ctrlDeltaBot - ctrlDeltaSld | |
| 166 | netDDelta | double | grpDDeltaBot - grpDDeltaSld + ctrlDDeltaBot - ctrlDDeltaSld | |
| 169 | openHedgeTime | float | size weighted average time (in seconds) hedge risk has been open (executions to fills) | |
| 172 | hedgeTargetVol | float | implied / expected today (annualized) volatility for hedge target | |
| 175 | expectedPrcRange | float | SQRT(avgHedgeTime x hedgeTargetVol) cone | |
| 178 | opnDeltaBot | double | open risk delta bot (in ctrlDe units) | |
| 181 | opnDeltaSld | double | ||
| 184 | opnDDeltaBot | double | open risk $delta bot (in ctrlDe units) | |
| 187 | opnDDeltaSld | double | ||
| 190 | clsDeltaBot | double | close risk delta bot (in ctrlDe units) | |
| 193 | clsDeltaSld | double | ||
| 196 | clsDDeltaBot | double | close risk $delta bot (in ctrlDe units) | |
| 199 | clsDDeltaSld | double | ||
| 202 | slippagePnL | float | opnDeltaBot * (clsDeltaPrcSld - opnDeltaPrcBot) + opnDeltaSld * (opnDeltaPrcSld - clsDeltaPrcBot) | |
| 205 | slippageUnitPnL | float | slippagePnL / (grpDeltaBot + grpDeltaSld) [pnl / unit (share or fc)] | |
| 208 | slippageNormPnL | float | slippageUnitPnL / expectedPrcRange | |
| 211 | minDDeltaBand | float | ||
| 214 | maxDDeltaBand | float | ||
| 217 | bParentNumber | long | ||
| 220 | bActiveSize | int | ||
| 223 | bBrkrStatus | text1 | ||
| 226 | bBrkrError | text1 | ||
| 229 | sParentNumber | long | ||
| 232 | sActiveSize | int | ||
| 235 | sBrkrStatus | text1 | ||
| 238 | sBrkrError | text1 | ||
| 241 | ddMult | double | ||
| 244 | underliersPerCn | int | future underliers per contract | |
| 247 | underlierType | enum : UnderlierType | type of underlier (affects $greek calculations) | |
| 250 | pointValue | double | $NLV value of a single point change in display premium (hedge target) | |
| 253 | pointCurrency | enum : Currency | ||
| 256 | liveHedgeMark | double | hedgeSecKey live mark (mid-market) [zero in SRSE] | |
| 259 | updtReason | string(20) | ||
| 262 | timestamp | DateTime | SR system timestamp |
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 = 'SpdrAutoHedgeState'
# 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=SpdrAutoHedgeState'
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 = 'SpdrAutoHedgeState'
# 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 = 'groupingCode|ticker|securityDesc|ssaleFlag|positionType|hedgeState|hedgeText|uPrc|hedgePrcLmt|isDeltaMixed|accumulatorError|grpDeltaBot|grpDeltaSld|grpDDeltaBot|grpDDeltaSld|lastGrpFillDttm|ctrlDeltaBot|ctrlDeltaSld|ctrlDDeltaBot|ctrlDDeltaSld|lastCtrlFillDttm|absOptCn|netDelta|netDDelta|openHedgeTime|hedgeTargetVol|expectedPrcRange|opnDeltaBot|opnDeltaSld|opnDDeltaBot|opnDDeltaSld|clsDeltaBot|clsDeltaSld|clsDDeltaBot|clsDDeltaSld|slippagePnL|slippageUnitPnL|slippageNormPnL|minDDeltaBand|maxDDeltaBand|bParentNumber|bActiveSize|bBrkrStatus|bBrkrError|sParentNumber|sActiveSize|sBrkrStatus|sBrkrError|ddMult|underliersPerCn|underlierType|pointValue|pointCurrency|liveHedgeMark|updtReason|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=SpdrAutoHedgeState' \
--data-urlencode 'view=groupingCode|ticker|securityDesc|ssaleFlag|positionType|hedgeState|hedgeText|uPrc|hedgePrcLmt|isDeltaMixed|accumulatorError|grpDeltaBot|grpDeltaSld|grpDDeltaBot|grpDDeltaSld|lastGrpFillDttm|ctrlDeltaBot|ctrlDeltaSld|ctrlDDeltaBot|ctrlDDeltaSld|lastCtrlFillDttm|absOptCn|netDelta|netDDelta|openHedgeTime|hedgeTargetVol|expectedPrcRange|opnDeltaBot|opnDeltaSld|opnDDeltaBot|opnDDeltaSld|clsDeltaBot|clsDeltaSld|clsDDeltaBot|clsDDeltaSld|slippagePnL|slippageUnitPnL|slippageNormPnL|minDDeltaBand|maxDDeltaBand|bParentNumber|bActiveSize|bBrkrStatus|bBrkrError|sParentNumber|sActiveSize|sBrkrStatus|sBrkrError|ddMult|underliersPerCn|underlierType|pointValue|pointCurrency|liveHedgeMark|updtReason|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 = 'SpdrAutoHedgeState'
# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'groupingCode|ticker|securityDesc|ssaleFlag|positionType|hedgeState|hedgeText|uPrc|hedgePrcLmt|isDeltaMixed|accumulatorError|grpDeltaBot|grpDeltaSld|grpDDeltaBot|grpDDeltaSld|lastGrpFillDttm|ctrlDeltaBot|ctrlDeltaSld|ctrlDDeltaBot|ctrlDDeltaSld|lastCtrlFillDttm|absOptCn|netDelta|netDDelta|openHedgeTime|hedgeTargetVol|expectedPrcRange|opnDeltaBot|opnDeltaSld|opnDDeltaBot|opnDDeltaSld|clsDeltaBot|clsDeltaSld|clsDDeltaBot|clsDDeltaSld|slippagePnL|slippageUnitPnL|slippageNormPnL|minDDeltaBand|maxDDeltaBand|bParentNumber|bActiveSize|bBrkrStatus|bBrkrError|sParentNumber|sActiveSize|sBrkrStatus|sBrkrError|ddMult|underliersPerCn|underlierType|pointValue|pointCurrency|liveHedgeMark|updtReason|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 = 'groupingCode: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=SpdrAutoHedgeState' \
--data-urlencode 'view=groupingCode|ticker|securityDesc|ssaleFlag|positionType|hedgeState|hedgeText|uPrc|hedgePrcLmt|isDeltaMixed|accumulatorError|grpDeltaBot|grpDeltaSld|grpDDeltaBot|grpDDeltaSld|lastGrpFillDttm|ctrlDeltaBot|ctrlDeltaSld|ctrlDDeltaBot|ctrlDDeltaSld|lastCtrlFillDttm|absOptCn|netDelta|netDDelta|openHedgeTime|hedgeTargetVol|expectedPrcRange|opnDeltaBot|opnDeltaSld|opnDDeltaBot|opnDDeltaSld|clsDeltaBot|clsDeltaSld|clsDDeltaBot|clsDDeltaSld|slippagePnL|slippageUnitPnL|slippageNormPnL|minDDeltaBand|maxDDeltaBand|bParentNumber|bActiveSize|bBrkrStatus|bBrkrError|sParentNumber|sActiveSize|sBrkrStatus|sBrkrError|ddMult|underliersPerCn|underlierType|pointValue|pointCurrency|liveHedgeMark|updtReason|timestamp' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=groupingCode: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 = 'SpdrAutoHedgeState'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'groupingCode|ticker|securityDesc|ssaleFlag|positionType|hedgeState|hedgeText|uPrc|hedgePrcLmt|isDeltaMixed|accumulatorError|grpDeltaBot|grpDeltaSld|grpDDeltaBot|grpDDeltaSld|lastGrpFillDttm|ctrlDeltaBot|ctrlDeltaSld|ctrlDDeltaBot|ctrlDDeltaSld|lastCtrlFillDttm|absOptCn|netDelta|netDDelta|openHedgeTime|hedgeTargetVol|expectedPrcRange|opnDeltaBot|opnDeltaSld|opnDDeltaBot|opnDDeltaSld|clsDeltaBot|clsDeltaSld|clsDDeltaBot|clsDDeltaSld|slippagePnL|slippageUnitPnL|slippageNormPnL|minDDeltaBand|maxDDeltaBand|bParentNumber|bActiveSize|bBrkrStatus|bBrkrError|sParentNumber|sActiveSize|sBrkrStatus|sBrkrError|ddMult|underliersPerCn|underlierType|pointValue|pointCurrency|liveHedgeMark|updtReason|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'ssaleFlag|positionType|hedgeState|isDeltaMixed|underlierType|pointCurrency'
# 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=SpdrAutoHedgeState' \
--data-urlencode 'measure=groupingCode|ticker|securityDesc|ssaleFlag|positionType|hedgeState|hedgeText|uPrc|hedgePrcLmt|isDeltaMixed|accumulatorError|grpDeltaBot|grpDeltaSld|grpDDeltaBot|grpDDeltaSld|lastGrpFillDttm|ctrlDeltaBot|ctrlDeltaSld|ctrlDDeltaBot|ctrlDDeltaSld|lastCtrlFillDttm|absOptCn|netDelta|netDDelta|openHedgeTime|hedgeTargetVol|expectedPrcRange|opnDeltaBot|opnDeltaSld|opnDDeltaBot|opnDDeltaSld|clsDeltaBot|clsDeltaSld|clsDDeltaBot|clsDDeltaSld|slippagePnL|slippageUnitPnL|slippageNormPnL|minDDeltaBand|maxDDeltaBand|bParentNumber|bActiveSize|bBrkrStatus|bBrkrError|sParentNumber|sActiveSize|sBrkrStatus|sBrkrError|ddMult|underliersPerCn|underlierType|pointValue|pointCurrency|liveHedgeMark|updtReason|timestamp' \
--data-urlencode 'group=ssaleFlag|positionType|hedgeState|isDeltaMixed|underlierType|pointCurrency' \
--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 = 'SpdrAutoHedgeState'
# 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=SpdrAutoHedgeState' \
--data-urlencode 'where=accnt:eq:ExampleString'