How to use QM_List function to get OptionChain and Interval Data
The QM_List functions provide a robust method for extracting data from the Quotemedia’s API. They offer a wide array of applications, typically returning the results in a structured, table-like form.
For instance, should you wish to retrieve intraday history data for a certain symbol, you could utilize a QM_List function in the manner shown below:
=QM_List("getIntervals", "symbol","MSFT", "interval","5")
In the event you required data from a specific interval, the following applications would become relevant:
=QM_List("getIntervals", "symbol","MSFT", "interval","5","start","2020-03-18")
This function will obtain all data from March 18th, 2020.
=QM_List("getIntervals", "symbol","MSFT", "interval","5","start","2020-03-18","end","2020-04-15")
This function will fetch all data between March 18th, 2020 and April 15th, 2020.
Please adhere to the “YYYY-MM-DD” format for dating. Additionally, the symbol can also be an option symbol, provided it is yet to expire.
Thus, the structuring of a QM_List function may appear as:
=QM_List("Method Name", "Parameter1", "Parameter Value 1", "Parameter2", "Parameter Value 2",......,"Parameter N", "Parameter Value N")
Please refer to the examples listed below for a swift means of accessing the EOD History:
To fetch a month's history, apply this function: =QM_List("getHistory","symbol","AAL")
To extract history from a specific starting date, make use of this function: =QM_List("getHistory","symbol","AAL","start","2019-02-15")
To obtain historical data from a certain starting date till an end date, apply this function: =QM_List("getHistory","symbol","AAL","start","2019-02-15", "end","2020-05-25")
Note: The availability of QM_List methods is contingent upon the data package you have procured from Quotemedia. For instance, only those with the Options data package will have access to options-related methods.
The QM_List function, and its counterpart qm_listDynamic function, can be used to sieve through options contracts. This is particularly useful given that a single stock option could potentially have thousands of contracts. These functions can be used to filter out specific options:
Here is how to retrieve all options for AAL expiring between July 19th, 2020 and September 18th, 2020: =QM_List("getOptionchain","symbol","AAL","expireMin","2020-07-19","expireMax","2020-09-18")
If you want the options with a minimum strike price of 12: =QM_List("getOptionchain","symbol","AAL","expireMin","2020-07-19","expireMax","2020-09-18","strikeMin",12)
If you wish to set a range for the strike price, say, between 12 and 14: =QM_List("getOptionchain","symbol","AAL","expireMin","2020-07-19","expireMax","2020-09-18","strikeMin",12,"strikeMax",14)
If you want to exclude zero volume contracts and only get options yet to expire: =QM_List("getOptionchain","symbol","AAL","expireMin","2020-07-19","expireMax","2020-09-18","strikeMin",12,"strikeMax",14,"inclExpired","false","inclZeroVol","false")
If you only need put options: =QM_List("getOptionchain","symbol","AAL","expireMin","2020-07-19","expireMax","2020-09-18","strikeMin",12,"strikeMax",14,"inclExpired","false","inclZeroVol","false","callput","put")
To retrieve the entire history of an options contract: =QM_List(“getHistory”,”symbol”,”@AAL 200717P00018000″,”start”,”2001-01-01″)
Created by: Nikita
I invite you to book a demo with me or my team to save time, enhance your investment research, and streamline your workflows.