Schema: VolTimeCalculator (ID: 5065)
This table allows custom span risk calculations based on either user or SR supplied input values.
METADATA
Attribute | Value |
---|---|
Topic | 5030-srse-calculators |
MLink Token | SRMLinkAnalytics |
SRSE Product | SRAnalytics |
Note: The symbol
=
next to a field number indicates that it is a primary key.
BODY
# | Field | Type | Comment |
---|---|---|---|
10= | ticker | TickerKey | |
11= | secType | enum : SpdrKeyType | |
12= | endDate | DateKey | period end date (CST) |
13= | userName | string(24) | |
100 | endTime | TimeSpan | period end time (CST) |
103 | nowDttm | DateTime | period start time (CST) |
106 | nowSrc | enum : FieldSrc | default is clock time when selecting |
115 | holidayCalendar | enum : CalendarCode | |
118 | holidayCalendarSrc | enum : FieldSrc | |
152 | yearsVT70 | double | volatility years from nowDttm to endDttm using TradingCalendar (SR NMS Trading/Volatility Calendar) |
153 | yearsY252 | double | |
154 | yearsY365 | double | |
127 | partialDays | int | number of partial trading days (half-days) between endpoints. |
130 | holidayDays | int | number of holidays (days that would otherwise be trading days) between endpoints. |
133 | completeDays | int | number of complete trading days between endpoints. |
148 | error | string(32) | calculation error |
151 | timestamp | DateTime |
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 = 'VolTimeCalculator'
# 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=VolTimeCalculator'
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 = 'VolTimeCalculator'
# 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 = 'endTime|nowDttm|nowSrc|holidayCalendar|holidayCalendarSrc|yearsVT70|yearsY252|yearsY365|partialDays|holidayDays|completeDays|error|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 = 'userName: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=VolTimeCalculator' \
--data-urlencode 'view=endTime|nowDttm|nowSrc|holidayCalendar|holidayCalendarSrc|yearsVT70|yearsY252|yearsY365|partialDays|holidayDays|completeDays|error|timestamp' \
--data-urlencode 'where=userName: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 = 'VolTimeCalculator'
# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'endTime|nowDttm|nowSrc|holidayCalendar|holidayCalendarSrc|yearsVT70|yearsY252|yearsY365|partialDays|holidayDays|completeDays|error|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 = 'userName: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 = 'endTime: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=VolTimeCalculator' \
--data-urlencode 'view=endTime|nowDttm|nowSrc|holidayCalendar|holidayCalendarSrc|yearsVT70|yearsY252|yearsY365|partialDays|holidayDays|completeDays|error|timestamp' \
--data-urlencode 'where=userName:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=endTime: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 = 'VolTimeCalculator'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'endTime|nowDttm|nowSrc|holidayCalendar|holidayCalendarSrc|yearsVT70|yearsY252|yearsY365|partialDays|holidayDays|completeDays|error|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'nowSrc|holidayCalendar|holidayCalendarSrc'
# 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 = 'userName: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=VolTimeCalculator' \
--data-urlencode 'measure=endTime|nowDttm|nowSrc|holidayCalendar|holidayCalendarSrc|yearsVT70|yearsY252|yearsY365|partialDays|holidayDays|completeDays|error|timestamp' \
--data-urlencode 'group=nowSrc|holidayCalendar|holidayCalendarSrc' \
--data-urlencode 'where=userName: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 = 'VolTimeCalculator'
# 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 = 'userName: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=VolTimeCalculator' \
--data-urlencode 'where=userName:eq:ExampleString'
Post 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'
# Request Parameters
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'postmsgs',
"postaction": "I", # (I)nsert, (R)eplace, (U)pdate, or (D)elete
"postmerge": "Y", # (Y)es or (N)o
}
payload = {
"header": {
"mTyp": "VolTimeCalculator"
},
"message": {
"pkey": {
"ticker": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL"
},
"secType": "enumValue", // enum(SpdrKeyType) - None, Stock, Future, Option, MLeg
"endDate": "2025-01-01", // yyyy-MM-dd
"userName": "exampleString" // string
},
"endTime": "12:00:00.000000", // HH:mm:ss.SSSSSS
"nowDttm": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"nowSrc": "enumValue", // enum(FieldSrc) - Default, User
"holidayCalendar": "enumValue", // enum(CalendarCode) - None, NYSE, EUREX, CBOE_EU, NXAM, NXBR, NXLS, NXML, NXOS, NXP, ICEFE, CME, NYMEX, COMEX, MGEX, BXE, CXE, DXE, EUX
"holidayCalendarSrc": "enumValue", // enum(FieldSrc) - Default, User
"yearsVT70": 1.0, // double
"yearsY252": 1.0, // double
"yearsY365": 1.0, // double
"partialDays": 1, // int
"holidayDays": 1, // int
"completeDays": 1, // int
"error": "exampleString", // string
"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)
curl -X POST 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=postmsgs' \
--data-urlencode 'postaction=I' \ # (I)nsert, (R)eplace, (U)pdate, or (D)elete
--data-urlencode 'postmerge=Y' \ # (Y)es or (N)o
--header 'Content-Type: application/json' \
--data '{
"header": {
"mTyp": "VolTimeCalculator"
},
"message": {
"pkey": {
"ticker": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL"
},
"secType": "enumValue", // enum(SpdrKeyType) - None, Stock, Future, Option, MLeg
"endDate": "2025-01-01", // yyyy-MM-dd
"userName": "exampleString" // string
},
"endTime": "12:00:00.000000", // HH:mm:ss.SSSSSS
"nowDttm": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"nowSrc": "enumValue", // enum(FieldSrc) - Default, User
"holidayCalendar": "enumValue", // enum(CalendarCode) - None, NYSE, EUREX, CBOE_EU, NXAM, NXBR, NXLS, NXML, NXOS, NXP, ICEFE, CME, NYMEX, COMEX, MGEX, BXE, CXE, DXE, EUX
"holidayCalendarSrc": "enumValue", // enum(FieldSrc) - Default, User
"yearsVT70": 1.0, // double
"yearsY252": 1.0, // double
"yearsY365": 1.0, // double
"partialDays": 1, // int
"holidayDays": 1, // int
"completeDays": 1, // int
"error": "exampleString", // string
"timestamp": "2025-01-01 12:00:00.000000" // yyyy-MM-dd HH:mm:ss.SSSSSS
}
}'