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):
symbolexpressionforwardseasonaluid(optional)
Behavior
Changes the current main plot.
- If
uidis omitted, the main plot keeps its current uid. - If
uidis supplied, the main plot adopts it. - A supplied
uidmust 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 exampleVolumeorHigh). - 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: futures-only plot that behaves similarly to a comparison chart. Expressions are supported. Studies are not available for seasonal plots.