The two values of runtime.calculation.mode: runtime.calculation.mode.chart and runtime.calculation.mode.alert.
runtime.calculation.mode is a simple string that tells you whether the script is calculating for the chart or for an alert. Compare it with runtime.calculation.mode.chart and runtime.calculation.mode.alert to run work only in one of them, such as skipping drawings in the alert copy of the script.
The two copies are separate runs: an alert's copy does not draw anything the user sees, so building labels and tables there wastes time.
Constants
| Name | Value | Description |
|---|---|---|
runtime.calculation.mode.alert | The script is calculating for an alert. | |
runtime.calculation.mode.chart | The script is calculating for the chart. |
Remarks
- Available in Pine v6 only.
- On Sidechair:
runtime.calculation.modeand these constants are not supported yet.
Example
//@version=6
indicator("Calculation mode", overlay = true)
plot(close, "Close", color.gray)
if runtime.calculation.mode == runtime.calculation.mode.chart and barstate.islast
label.new(bar_index, high, "drawn for the chart only")See also
Not on Sidechair yet