Sidechair

runtime.* constants

Browse the reference

The two values of runtime.calculation.mode: runtime.calculation.mode.chart and runtime.calculation.mode.alert.

Try it in the editor

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

NameValueDescription
runtime.calculation.mode.alertThe script is calculating for an alert.
runtime.calculation.mode.chartThe script is calculating for the chart.

Remarks

  • Available in Pine v6 only.
  • On Sidechair: runtime.calculation.mode and these constants are not supported yet.

Example

Pine ScriptSkip drawing during alertsOpen in editor
//@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