Class
caplin.chart.series

SeriesRequest

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 config)

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 xml)

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.

Number getTimeout()

Returns the timeout (in milliseconds) for this request.

String getType()

Returns the type of this request.

Boolean isIntraperiod()

Returns true if this is a intraperiod request, false otherwise.

<static> Boolean isValidRequestType(String requestType)

Checks if requestType 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 config)

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.
timeout no 3000 Timeout (in milliseconds) for the request.
intraperiod no false If this is a real-time or combined request, this option controls whether to request intraperiod updates or to only request completed period updates.
object from a map of configuration properties.

Parameters
Map config 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 xml)

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

Parameters
Element xml 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.

Number getTimeout()

Returns the timeout (in milliseconds) for this request.

Returns
{Number} The timeout in milliseconds.

String getType()

Returns the type of this request. Possible return values: caplin.chart.series.SeriesRequest.REQUEST_HISTORIC, caplin.chart.series.SeriesRequest.REQUEST_REALTIME or caplin.chart.series.SeriesRequest.REQUEST_BOTH.

Returns
{String}

Boolean isIntraperiod()

Returns true if this is a intraperiod request, false otherwise..

Returns
{Boolean}

<static> Boolean isValidRequestType(String requestType)

Checks if requestType 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 requestType 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.