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| Parameter | Type | Required | Description |
|---|---|---|---|
title | const string | yes | The script’s name. Required, and const-form, so it must be a constant. |
shorttitle | const string | no | A shorter name for the script. |
overlay | const bool | no | Sets the overlay for the whole script. A single plot has its own overlay switch as well; the two are separate settings. |
format | const string | no | The format the script’s values are presented in. |
precision | const int | no | The 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.