Class: QuoteFeed

QuoteFeed

Quote feed instance, as created by configuration. A quote feed contains both configuration (its behavior) as well as the implementation of the remote fetching functions for the data (its engine). It may also utilize a filter function to determine if the quote feed is to be used for the given request, Some sample quote feed engines can be found in examples folder (quoteFeedSimulator, EventSimulator). You should make a copy of these files and customize to your quote feed's requirements. You can leverage the quote feed engine you may have built for the ChartIQ SDK Library. To do this, you would utilize the examples/quoteFeedAdapter.js to load the SDK quotefeed, and configure the CompactChart configuration to use the adapter as its quotefeed. For more information on quotefeeds, see DataIntegrationQuoteFeeds.

Since:
  • 9.4.0

Type Definitions


EngineFunction(symbol, suggestedStartDate, suggestedEndDate, QuoteFeedParams)

Function that needs to be implemented by the developer using this library in order to fetch quotes from a remote source. The developer also needs to make sure that results comply with QuoteFeedDataRecord structure. Not all parameters are used in all cases.

Parameters:
Name Type Description
symbol string

Security symbol of request.

suggestedStartDate Date

Sometimes called startDate, first date for which to fetch quotes.

suggestedEndDate Date

Sometimes called endDate, last date for which to fetch quotes. This argument is omitted for the fetchUpdateData function.

QuoteFeedParams params

Parameters providing context to fetch.

Since:
  • 9.4.0

Returns:

Object containing results from quote engine.

Type
QuoteFeedDataRecord

FilterFunction( [params])

Function that determines whether this quotefeed applies, given general quote feed parameters. When multiple quote feeds supply this function, the list of quotefeeds in the quote driver configuration is iterated, and the first one to match the criteria in the QuoteFeedParams is selected as the quote feed to use for the request.

Parameters:
Name Type Argument Description
params QuoteFeedParams <optional>

General quote feed parameters.

Since:
  • 9.4.0

Returns:

True if quotefeed is to be used for this request.

Type
boolean

PriceRecord

Defines an object representing the price quote at a specific time.

Type:
  • object
Properties:
Name Type Argument Description
DT Date <optional>

Date of record as JS Date.

Date string <optional>

Date of record as an ISO string.

Close number <optional>

Closing price.

Open number <optional>

Open price.

High number <optional>

High price.

Low number <optional>

Low price.

Volume number <optional>

Volume.

Adj_Close number <optional>

Adjusted Close (factoring in corp actions).

Last number <optional>

Last price. Would be used in lieu of Close.

Value number <optional>

Value of security. Would be used in lieu of Close or Last.

Since:
  • 9.4.0


QuoteEngine

Quote feed engine. These are the three functions that need to be implemented by the developer using this library in order to fetch quotes from a remote source.

Type:
  • object
Properties:
Name Type Argument Description
fetchInitialData EngineFunction <optional>

Function that fetches initial data.

fetchUpdateData EngineFunction <optional>

Function that fetches data updates.

fetchPaginationData EngineFunction <optional>

Function that fetches subsequent data after an initial load.

Since:
  • 9.4.0


QuoteFeedBehavior

Configuration related to an individual quote feed.

Type:
Properties:
Name Type Argument Description
updateMode number <optional>

Indicates whether update is being performed as a result of an initial request or a pagination request.

  • 1: initial request
  • 2: update request
  • 3: pagination request
  • 4: request for series data
Since:
  • 9.4.0


QuoteFeedConfig

Configuration for the quote feed.

Type:
Properties:
Name Type Argument Description
export string

Name of the exported class.

filter FilterFunction <optional>

Function that determines whether this quotefeed applies, given general quote feed parameters.

behavior QuoteFeedConfigBehavior

Parameters relating to the quote feed.

engine QuoteEngine <optional>

The implementation of the remote fetch functions.

Since:
  • 9.4.0


QuoteFeedConfigBehavior

Configuration related to an individual quote feed.

Type:
  • object
Properties:
Name Type Argument Description
bufferSize number <optional>

Number of quotes to fetch before and after requested start and end time.

maximumTicks number <optional>

Maximum number of ticks that can be fetched in one request.

refreshInterval number <optional>

Number of milliseconds to wait between polling for updates, set to 0 to disable polling.

Since:
  • 9.4.0


QuoteFeedDataRecord

Definition of result object returned by a QuoteEngine for any request type.

Type:
  • object
Properties:
Name Type Argument Description
attribution Attribution <optional>

Attribution for quote.

moreAvailable boolean <optional>

Indicates more data available in the past.

upToDate boolean <optional>

Indicates no more data available up to the current time.

quotes Array.<(PriceRecord|EventRecord)> <optional>

Array of quote results.

error string <optional>

Error message.

Since:
  • 9.4.0


QuoteFeedParams

Quote feed parameters. These are used to provide context for the fetch of data.

Type:
  • object
Properties:
Name Type Argument Description
qc CompactChart <optional>

CompactChart instance.

symbolObject object <optional>

Object containing symbol.

symbol string <optional>

Symbol as a string.

interval TimeUnit | number <optional>

Interval of quote requested.

period number <optional>

Period of quote. This is used to roll up the data returned into a periodicity the end-user would like to see.

ticks number <optional>

Number of ticks to fetch.

extended boolean <optional>

Indicates whether extended hours quotes is requested.

quoteDriverID string <optional>

Unique quote driver id.

startDate Date <optional>

Requested start date.

endDate Date <optional>

Requested end date.

future boolean <optional>

Whether to fetch records that occur in the future.

series boolean <optional>

Whether request is for a series or the main symbol.

feed QuoteFeed <optional>

Quote feed being used for this request.

maximumTicks number <optional>

The most number of ticks to fetch from the data source.

forceLoadMore boolean <optional>

If true, attempts to load more data even if no more data seems to be indicated.

fetchMaximumBars boolean <optional>

Whether to fetch the most bars a quote engine can handle.

eventParams EventParameters <optional>

Parameters used to construct events from the results.

behavior QuoteFeedBehavior <optional>

Behavior from the quote feed.

mode number <optional>

Type of fetch to be performed by the quote engine.

  • 1: initial request
  • 2: update request
  • 3: pagination request
  • 4: request for series data
initializeChart boolean <optional>

Whether to initialize chart after fetch complete.

Since:
  • 9.4.0