Skip to content

MainPlot action

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

Symbol as an action id is deprecated; use MainPlot.

Context

Set one of the following (exactly one):

  • symbol
  • expression
  • forward
  • seasonal
  • uid (optional)

Behavior

Changes the current main plot.

  • If uid is omitted, the main plot keeps its current uid.
  • If uid is supplied, the main plot adopts it.
  • A supplied uid must not already be used by any other plot on the chart, regardless of plot type.
  • Re-supplying the current main plot uid is allowed.
  • The package exports generateUid() if you want to pre-generate a main plot id in the host app.

Notes

MainPlot determines the primary dataset the chart is built around.

  • Symbol plot: loads historical data for one symbol. Most studies can be added and will use this symbol as input.
  • Expression plot: computes values from multiple symbols (for example {ZC*1} - 3 * {ZC*2}). After switching to an expression, some studies may be removed because they require fields the expression does not provide (for example Volume or High).
  • Forward plot: synthetic plot based on contracts for a futures root, charted by expiration month. Expressions are supported (using roots instead of full symbols). Studies are not available for forward plots.
  • Seasonal plot: overlays the same instrument across years, similarly to a comparison chart. Futures move to the contract of each prior year (for example HEZ26, HEZ25, …), while other symbols are sliced into calendar years. Expressions are supported and may mix futures with other symbols (for example {$CHOL} - {HE*1}). Studies can be added to seasonal plots.