Skip to content

Aggregation action

Use this action with change({ id: 'Aggregation', context }).

Context

  • id?: Get | Update (Update is assumed if omitted)
  • aggregation fields for Update:
    • unit: Tick | Intraday | Day | Week | Month | Quarter | Year
    • size: number
    • spec: None | Nearest | Continue | PerCount | PerVolume | PerRange | PerSeconds
    • isContractVolume: boolean
    • dividendsAdjust: boolean
    • backAdjust: boolean
    • daysToExpiration: number
    • contractRoll: expiration | combined

Behavior

Aggregation supports two sub-actions:

  • Get: returns the current aggregation object in the same shape as aggregation Update fields.
  • Update: merges provided aggregation fields into the current aggregation.

Only provided fields are changed.

Example (Get):

const currentAggregation = chart.change({
id: "Aggregation",
context: { id: "Get" },
});