Q4Widgets API Documentation

q4.historical

Retrieves price and volume information for a stock on a specific date.
Script link
q4.historical.2.2.5.min.js
Source file
q4.historical.js, line 2
Requires

Options

url string
The base URL of the Q4 website.
Example
//feeds.q4websystems.com
exchange string
The stock exchange to use. If this is not specified, the widget will look for `?Indice=EXCH:SYM` in the URL.
symbol string
The stock symbol to use. If this is not specified, the widget will look for `?Indice=EXCH:SYM` in the URL.
dateFormat string
A date format string to use with jQuery UI's Datepicker.
Default value
M d, yy
startDate Date
The earliest date that will be available as an option. Default is Jan 1, 1970.
endDate Date
The latest date that will be available as an option. Default is the current day.
datepicker string
A selector for the element to use as a datepicker. Usually an ``.
Default value
input:first
datepickerOpts Object
A set of options to pass directly to the datepicker constructor.
updateDatepicker boolean
Whether to update the datepicker field after fetching the stock quote. If there is no data for the selected date, this option will clear the field.
Default value
true
fetchOnInit boolean
Whether to fetch today's stock quote when the table is initialized.
Default value
true
trigger string
A selector for a trigger element that will perform the lookup when clicked. If this is not specified, the lookup will occur when the `datepicker` element's value changes.
quoteContainer string
A selector for the container that will be filled with the lookup results.
Default value
.quote
quoteTemplate string
A Mustache template used to render the lookup results in the quote container. The following tags are available: - `{{date}}` The date of the historical stock quote. - `{{volume}}` The trading volume of the stock on that date. - `{{open}}` The opening stock price on that date. - `{{close}}` The closing stock price on that date. - `{{high}}` The stock's highest trading price on that date. - `{{low}}` The stock's lowest trading price on that date.
Example
'Date: {{date}}<br>' +
'Volume: {{volume}}<br>' +
'Open: {{open}}<br>' +
'Close: {{close}}<br>' +
'High: {{high}}<br>' +
'Low: {{low}}'
notFoundMessage string
A message to display in the quote container in case no results were found.
Default value
No stock data is available for this date.
loadingClass string
A CSS class to add to the widget while data is loading. This can be used to show and hide elements within the widget.