While using HistoricalCriteriaSearch or FuturesAndOptionsSearch API in TRTH

While using HistoricalCriteriaSearch or FuturesAndOptionsSearch API in TRTH, I was wondering if it is possible to specify a regex style identification in the 'Identifier' key,

e.g. If i want the results for HSI*D2.HF and HSI*P2.HF in the same search request, how would I specify it? Example RIC expected in output HSI14600D2.HF


What changes do I need to make to the below code:


https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/HistoricalCriteriaSearch

{"Request":

{"Range":

{"End":"2022-12-10T23:59:59.999",

"Start":"2022-04-01T00:00:00.000"},

"RicPattern":"^HSI[ABCDEFGHIJKLMNOPQRSTUVWXYZ][D2.HF]$",

"ExpiryDate":null,

"OptionMonthCodes":null,

"OptionTypeCodes":null,

"CouponRate":null,

"StrikePrice":null,

"MaturityDate":null,

"BondTypeCodes":null,

"ContributorIds":null,

"CountryCodes":null,

"CurrencyCodes":null,

"ExchangeCodes":null,

"FutureMonthCodes":null,

"InstrumentTypeCodes":null

}}

Tagged:

Best Answer

  • Hello @mohamed.hisham ,

    You could specify it with HistoricalCriteriaSearch :

    {{protocol}}{{host}}{{api}}Search/HistoricalCriteriaSearch 
    {"Request":
    {"Range":
    {"End":"2022-12-10T23:59:59.999",
    "Start":"2022-04-01T00:00:00.000"},
    "RicPattern":"^HSI[0-9]{5}[D,P]2.HF$",
    "ExpiryDate":null,
    "OptionMonthCodes":null,
    "OptionTypeCodes":null,
    "CouponRate":null,
    "StrikePrice":null,
    "MaturityDate":null,
    "BondTypeCodes":null,
    "ContributorIds":null,
    "CountryCodes":null,
    "CurrencyCodes":null,
    "ExchangeCodes":null,
    "FutureMonthCodes":null,
    "InstrumentTypeCodes":null
    }}

    If you are looking to use FuturesAndOptionsSearch- it is more aligned with the nature of the instrument- Option.

    Letters D and P denote expiration months. I.e. April, May, etc. and you would be looking for a specific range of expiration months. So to look up the expiration date range that you require, rather then a discrete list of months, could be simple:

    {{protocol}}{{host}}{{api}}Search/FuturesAndOptionsSearch 

    "SearchRequest": {
    "FileCodes": null,
    "CurrencyCodes": null,
    "ExchangeCodes": null,
    "AssetStatus": "Active",
    "StrikePrice": null,
    "ExpirationDate": {
    "@odata.type": "#DataScope.Select.Api.Search.DateRangeComparison",
    "From": "2022-04-01T00:00:00.000Z",
    "To": "2022-06-30T00:00:00.000Z"
    },
    "IdentifierType": "RICRoot",
    "Identifier": "HSI*",
    "FuturesAndOptionsType": "Option
    }
    }