Caplin Trader 4.8.0

Class: module:caplin/chart/series/SeriesRequest

module: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 module:caplin/chart/service/StreamLinkChartService's subscribe method in order to request a new OHLC(V) series.

Constructor

new module:caplin/chart/series/SeriesRequest(config)

Constructs a new caplin.chart.series.SeriesRequest object from a map of configuration properties.
Parameters:
Name Type Description
config Map The configuration properties for the request object.
Properties
Name Type Attributes Default Description
instrument String The currency pair for which you wish to request chart series data
seriesType String <optional>
'Bid' Bid or Other depending on which series the chart is to render.
interval String <optional>
1m The Tick interval. Possible values are configured on the back end.
type String <optional>
module:caplin/chart/series/SeriesRequest.REQUEST_HISTORIC The type of data you wish to request (historic, real-time, both).
begin Integer <optional>
Only used if requesting historic data. Used to determine the beginning date of the data you wish to request. A delta from the creation timestamp module:caplin/chart/series/SeriesRequest#getCreationTimestamp.
end Integer <optional>
Only used if requesting historic data. Used to determine the end date of the data you wish to request. A delta from the creation timestamp module:caplin/chart/series/SeriesRequest#getCreationTimestamp.
timeout int <optional>
3000 Timeout (in milliseconds) for the request.
intraperiod boolean <optional>
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.

Members

(static) REQUEST_BOTH :String

Request both historic and real-time chart series data.
Type:
  • String

(static) REQUEST_HISTORIC :String

Request historic chart series data.
Type:
  • String

(static) REQUEST_REALTIME :String

Request real-time chart series data.
Type:
  • String

Methods

(static) deserialize(xml) → {module:caplin/chart/series/SeriesRequest}

Creates a new instance of module:caplin/chart/series/SeriesRequest based on the values in the serialised XML.
Parameters:
Name Type Description
xml Element A XML element representing the state of the module:caplin/chart/series/SeriesRequest object.
Returns:
The deserialised instance.
Type
module:caplin/chart/series/SeriesRequest

(static) isValidRequestType(requestType) → {Boolean}

Parameters:
Name Type Description
requestType String The request type to check.
Returns:
Returns true if the passed request type is valid, false otherwise.
Type
Boolean

getBegin() → {String}

Returns the Unix time-stamp that indicates how far back historic data should be requested.
Returns:
The string representation of the time-stamp.
Type
String

getCreationTimestamp() → {Number}

Returns:
The series creation timestamp (milliseconds).
Type
Number

getDisplayName() → {String}

Returns:
The display name for the series.
Type
String

getEnd() → {String}

Returns the Unix time-stamp that indicates the point in time up until which historic data should be requested.
Returns:
The string representation of the time-stamp.
Type
String

getId() → {String}

Returns the unique identifier for this request.
Returns:
The request id.
Type
String

getInstrument() → {String}

Returns the instrument that this request relates to.
Returns:
The instrument for this request.
Type
String

getInterval() → {String}

Returns the interval to be requested.
Returns:
The interval to be requested.
Type
String

getSeriesType() → {String}

Returns the series type required for the request.
Returns:
The series type.
Type
String

getTimeout() → {Number}

Returns the timeout (in milliseconds) for this request.
Returns:
The timeout in milliseconds.
Type
Number

getType() → {String}

Returns:
Type
String

isIntraperiod() → {Boolean}

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

serialize() → {String}

Returns the serialised representation of the Request object, which can be later used to recreate the object (using module:caplin/chart/series/SeriesRequest.deserialize).
Returns:
The XML representation of the object.
Type
String