Miscellaneous blocks

Miscellaneous blocks

Analytics block

The Analytics block generates bar data using current and historical data for an instrument. You define the duration of a bar and how many rolling bars of data you want the block to store. As each new bar is added, the oldest bar is dropped. Essentially the Analytics block creates a numeric representation of a standard bar chart, similar to the following.

NOTE: you cannot use more than five Analytics blocks in a single algo.

The Analytics block requires three inputs:

  • The instrument port identifies the instrument whose data you want to collect.

    Note: The Analytics block does begin to function until a trade has occurred for the instrument after the algo has started.
  • The interval port defines the length, in minutes, to aggregate data. Supported values: 1-1440.
  • The index port indicates which bar for which to retrieve data. Supported values: 1-number-of-bars (as defined in the block properties).

For each interval, or bar, the block ouputs:

  • Time the interval started and its duration
  • Price at the start of the interval (Open) and the price at the end of the interval (Close)
  • High and low prices during the interval
  • Total volume traded during the interval

At the end of each interval, the block also outputs a discrete event message through its onBarComplete output port to indicate that the next bar's data is available.

Example The Analytics block contains the data for the 10 most recent 1-minute bars for the CME ES Mar19 contract.

You can iterate over the contents of an Analytics block, for example, using a Loop block.

Block properties

To customize the block, update the Block Properties.

Property Description
Name Name to display beneath the block on the ADL canvas
Number of Bars to show/store Number of bars to track. The block outputs the most-recent number of bars. As a new bar is added the oldest bar is dropped.
Expose Bar Outputs Output ports to display for each bar period.

Valid values include:
  • Open: Price at the start of the bar period
  • Close: Price at the end of the bar period
  • High: Highest traded price during the bar period
  • Low: Lowest traded price during the bar period
  • Volume: Volume traded during the bar period
  • OnBarComplete: Discrete message to fire when the current bar completes
  • Start time: Start time of the bar, in seconds since epoch
  • Bar Duration: Elapsed time for the bar, in seconds.