Class: Quotes

STX. Quotes


new Quotes()

This class is maintained for legacy implementations only. New implementations should use STX.QuoteFeed
Base class for Quotes infrastructure. Many of the built in UI capabilities such as comparison charts expect to follow this infrastructure. You should define your own classes that follow this pattern (or derive a class from STX.Quotes) in order to adapt your quote feed to make the most use of the built in componentry.

Version:
  • ChartIQ Advanced Package

Methods


<static> barsToFetch(params, stx)

Returns how many bars should be fetched. If we're fetching a series then it's simply the number of bars already in the chart. Otherwise it's the number of bars to fetch to fill up the screen.

Parameters:
Name Type Description
params object

Parameters

stx object

The chart object

Version:
  • ChartIQ Advanced Package
Returns:

Number of bars to fetch

Type
number

<static> fetch(params [, source], cb)

Fetch data. This will automatically fetch data from your data source, if you pass the approprite params.source string.

Parameters:
Name Type Argument Default Description
params object

Parameters required by your quote feed (such as start date, end date, number of bars, etc)

Properties
Name Type Description
stx object

The Chart object

source string <optional>
Demo

The name of the requested data source

cb function

Callback function will return fc(error, data) where error will be null if no error and data should be in format required by kernel

Version:
  • ChartIQ Advanced Package

<static> multiFetch(arr, cb)

Fetch multiple quotes asynchronously, possibly from various data sources. This method can be used to update a chart with multiple symbols such as a comparison chart.

Parameters:
Name Type Description
arr array

Array of params see STX.Quotes.fetch

cb function

Function to callback when quotes are fetched. Will be passed an array of results. Each result is an object {err, data}. err will either be null or an error message.

Version:
  • ChartIQ Advanced Package

<static> nextDataSource(params, currentSource)

If you support multiple data sources then this can be used to cascade through them if data is not available.

Parameters:
Name Type Description
params object

Standard parameters

currentSource string

Current source

Version:
  • ChartIQ Advanced Package
Returns:

The next source in the cascade, or null if no more available

Type
string