Aggregation action
Use this action with change({ id: 'Aggregation', context }).
Context
id?:Get|Update(Updateis assumed if omitted)- aggregation fields for
Update:unit:Tick|Intraday|Day|Week|Month|Quarter|Yearsize: numberspec:None|Nearest|Continue|PerCount|PerVolume|PerRange|PerSeconds|TopOfBookisContractVolume: booleandividendsAdjust: booleanbackAdjust: booleandaysToExpiration: numbercontractRoll:expiration|combined
Behavior
Aggregation supports two sub-actions:
Get: returns the current aggregation object in the same shape as aggregationUpdatefields.Update: merges provided aggregation fields into the current aggregation.
Only provided fields are changed.
TopOfBook is a specialized tick aggregation which fetches historical quote rows (best bid, best ask and their sizes) instead of the usual trade-based tick shape. It is primarily meant for consumers which read the raw container data directly, such as historical tables, and is not intended for normal chart visualization.
Example (Get):
const currentAggregation = chart.change({ id: "Aggregation", context: { id: "Get" },});