indicator

Declares the script and names it. Put it first. Only title is required, and every parameter is const-form, so none of them can be built from series data or handed a value that came out of an input.

indicator(const string title, const string shorttitle, const bool overlay, const string format, const int precision) → void
ParameterTypeRequiredDescription
titleconst stringyesThe script’s name. Required, and const-form, so it must be a constant.
shorttitleconst stringnoA shorter name for the script.
overlayconst boolnoSets the overlay for the whole script. A single plot has its own overlay switch as well; the two are separate settings.
formatconst stringnoThe format the script’s values are presented in.
precisionconst intnoThe precision the script’s values are presented to.

Returns void — void. The call declares the script rather than producing a value.

indicator("Percent from the open", "pctopen", false)
plot((close - open) / open * 100)

See also anatomy

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade