Message: TimeBarParameters

File: WebAPI/historical_2.proto

Description

Parameters of a time bar request.

Used in

TimeBarRequest

Fields

contract_id

Type: uint32

Description: Contract ID for a bar request. If the contract is a synthetic strategy, the request provides Spread Bars.

Source: metadata_2.ContractMetadata.contract_id.

bar_unit

Type: uint32

Description: For a spread bar request this field specifies spread bar interval bar unit.

Source: BarUnit.

unit_number

Type: uint32

Description: Number of units per a single bar for Intra-day bars (must be within 24 hours period). For a spread bar request this field specifies spread bar interval unit number.

leg_bar_unit

Type: uint32

Description: Leg bar unit for a spread bar request (when contract_id represents a Synthetic Strategy). This field is associated with BarUnit enum type. Minimal allowed intervals:

•      Month leg bar interval - for Year, Semiannual, and Quarter spread bar interval,

•      Day leg bar interval - for Month spread bar interval,

•      Hour leg bar interval - for Week spread bar interval,

•      5 min leg bar interval - for Day spread bar interval.

•      1 min leg bar interval - for intra-day spread bar intervals.

Default value is the minimal allowed.

leg_unit_number

Type: uint32

Description: Leg bar unit number for a spread bar request (when contract_id represents a Synthetic Strategy). Number of units per a single bar for Intra-day leg bars (must be within 24 hours period). Default value - see leg_bar_unit.

last_bar_spans_to_end_of_all_sessions

Type: bool

Description: For inter-commodity spreads, or any spread where the two contracts have different trading hours, the option defines how to handle the pricing when one entity is not trading.

•      If true, the spread is calculated using the closing value for each subsequent bar of the later closing commodity plotted against the closing value of the contract with the earlier close.

•      If false, the spread stops updating when the early contract closes, with all the values representing concurrent prices between the two commodities.

Applicable to spread bar requests with intra-day leg bars only. Default value is false.

from_utc_time

Type: sint64

Description: Optional bars period time to start from.

Note: Either from_utc_time or bar_count must be specified.

1.  For daily and multi-day bars represents starting trade date (time part is ignored), inclusive.

2.  For intra-day bars represents starting time, inclusive.

3.  Start time is automatically aligned to the closest starting time of selected unit. For example if bar_unit is BAR_UNIT_MONTH and from_utc_time is November 08 bar starting time will be set the first working day of November.

bar_count

Type: uint32

Description: Optional number of requested bars.

Note: Either from_utc_time or bar_count must be specified. When specified, from_utc_time is calculated based on to_utc_time, bar_count, selected bar_unit and unit_number (for intra-day bars).

Note: The maximum number of bars that can be requested in one message is limited, 100000 by default.

to_utc_time

Type: sint64

Description: Optional bars period finish time.

Note: Latest allowed and available time is used if it is not specified.

1.  For daily and multi-day bars represents trade date of the last returned bar (time part is ignored), inclusive.

2.  For intra-day bars represents finish time, exclusive.

3.  Finish time is automatically aligned to the closest finish time of selected unit. For example if bar_unit is BAR_UNIT_MONTH and to_utc_time is November 08 bar finish time will be set to the last working day of November.

deprecated_close_price_preference (deprecated)

Type: uint32

Description: Note: Use close_sources instead.

close_sources

Type: uint32[]

Description: List of sources for closing price in bar building.

Note: Order of sources defines what is used if several sources are available (from highest to lowest priority). This field is associated with metadata_2.CloseSource enum type. When the list is empty, default close sources are used (ContractMetadata.close_sources). If the list is not empty, it must contain CLOSE_SOURCE_LAST_QUOTE, otherwise the request is rejected. Can be non-empty for requests with bar_unit equal to BAR_UNIT_DAY or greater, otherwise request is rejected.

continuation_parameters

Type: ContinuationParameters

Description: Continuation parameters.

Request for Spread Bars with continuation uses bars for legs with continuation, so the continuation parameters are adapted for each leg:

•      a Future leg takes the continuation type specified,

•      a Bond leg takes active continuation if any continuation type is specified,

•      bars for other legs are requested without continuation,

•      equalization is not supported.

tick_types

Type: uint32[]

Description: List of tick types to be used in bar building.

Note: When the list is empty, commodity default tick types are used. It can be non-empty for intra-day bar requests only, otherwise the request is rejected. BAR_BUILDING_TICK_TYPE_SETTLEMENT tick type can only be used in combination with other type(s), otherwise request is rejected.

Note: not supported for Spread Bar requests.

Source: BarBuildingTickType.

update_interval

Type: uint32

Description: Update interval, in milliseconds, after which bar is reported, if changed.

Note: Minimum is 1 second for Intra-day bars and 10 seconds for historical bars. Maximum is 1 hour for both. Maximum update interval for Intra-day bars is also limited by chosen bar_unit and bar_number values (e.g., if bar_unit is MINUTE and bar_number is 10 update interval can’t exceed 600 seconds). Default is 1 second for Intra-day bars or 10 seconds for historical bars, if omitted.