Class
caplin.chart.series

SeriesRequest

The class is still in Beta and is subject to API changes.
Represents a request to be made for an OHLC(V) (open-high-low-close-volume) chart series. A SeriesRequest object can be passed through to caplin.chart.service.StreamLinkChartService's subscribe method in order to request a new OHLC(V) series.

Constructor Summary

Attributes Name and Description
caplin.chart.series.SeriesRequest(Map mConfig)

Constructs a new caplin.chart.series.SeriesRequest.

Field Summary

Attributes Name and Description
<static> caplin.chart.series.SeriesRequest.REQUEST_BOTH

Request both historic and real-time chart series data.

<static> caplin.chart.series.SeriesRequest.REQUEST_HISTORIC

Request historic chart series data.

<static> caplin.chart.series.SeriesRequest.REQUEST_REALTIME

Request real-time chart series data.

Method Summary

Attributes Name and Description
<static> Object deserialize(Element A)

Creates a new instance of caplin.chart.series.SeriesRequest based on the values in the serialised XML.

String getBegin()

Returns the Unix time-stamp that indicates how far back historic data should be requested.

Number getCreationTimestamp()

String getDisplayName()

String getEnd()

Returns the Unix time-stamp that indicates the point in time up until which historic data should be requested.

String getId()

Returns the unique identifier for this request.

String getInstrument()

Returns the instrument that this request relates to.

String getInterval()

Returns the interval to be requested.

String getSeriesType()

Returns the series type required for the request.

<static> Boolean isValidRequestType(String sRequestType)

Checks if sRequestType is valid.

String serialize()

Returns the serialised representation of the Request object, which can be later used to recreate the object (using caplin.chart.series.SeriesRequest.deserialize)

Constructor Detail

caplin.chart.series.SeriesRequest(Map mConfig)

Constructs a new caplin.chart.series.SeriesRequest.

Configuration should contain the following fields:

namerequireddefaultdescription
instrument yes The currency pair for which you wish to request chart series data
seriesType no Bid Bid or Other depending on which series the chart is to render.
interval no 1m Tick interval. Possible values are configured on the backend.
type no caplin.chart.series.SeriesRequest.REQUEST_HISTORIC The type of data you wish to request (historic, real-time, both).
begin no Only used if requesting historic data. Used to determine the beginning date of the data you wish to request.
end no Only used if requesting historic data. Used to determine the end date of the data you wish to request.
object from a map of configuration properties.

Parameters
Map mConfig The configuration properties for the request object.

Field Detail

<static> caplin.chart.series.SeriesRequest.REQUEST_BOTH

Request both historic and real-time chart series data.

<static> caplin.chart.series.SeriesRequest.REQUEST_HISTORIC

Request historic chart series data.

<static> caplin.chart.series.SeriesRequest.REQUEST_REALTIME

Request real-time chart series data.

Method Detail

<static> Object deserialize(Element A)

Creates a new instance of caplin.chart.series.SeriesRequest based on the values in the serialised XML.

Parameters
Element A XML element representing the state of the caplin.chart.series.SeriesRequest object.
Returns
{Object} New instance of caplin.chart.series.SeriesRequest

String getBegin()

Returns the Unix time-stamp that indicates how far back historic data should be requested.

Returns
{String} The string representation of the time-stamp.

Number getCreationTimestamp()

Returns
{Number} The series creation timestamp (milliseconds).

String getDisplayName()

Returns
{String} The display name for the series

String getEnd()

Returns the Unix time-stamp that indicates the point in time up until which historic data should be requested.

Returns
{String} The string representation of the time-stamp.

String getId()

Returns the unique identifier for this request.

Returns
{String} The request id.

String getInstrument()

Returns the instrument that this request relates to.

Returns
{String} The instrument for this request.

String getInterval()

Returns the interval to be requested.

Returns
{String} The interval to be requested.

String getSeriesType()

Returns the series type required for the request.

Returns
{String} The series type.

<static> Boolean isValidRequestType(String sRequestType)

Checks if sRequestType is valid. Valid request types are:

- caplin.chart.series.SeriesRequest.REQUEST_HISTORIC
- caplin.chart.series.SeriesRequest.REQUEST_REALTIME
- caplin.chart.series.SeriesRequest.REQUEST_BOTH

Parameters
String sRequestType The request type to check.
Returns
{Boolean} Returns true if the passed request type is valid, false otherwise.

String serialize()

Returns the serialised representation of the Request object, which can be later used to recreate the object (using caplin.chart.series.SeriesRequest.deserialize)

Returns
{String} The XML representation of the object.