Functions
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.
Syntax
indicator(const string title, const string shorttitle, const bool overlay, const string format, const int precision, const bool calc_on_every_tick, const int max_lines_count, const int max_boxes_count, const int max_labels_count, const int max_polylines_count, const bool behind_chart) → void
Arguments
title required const string The title of the script. It is displayed on the chart when no shorttitle argument is used, and becomes the publication's default title when publishing the script. shorttitle const string The script's display name on charts. If specified, it will replace the title argument in most chart-related windows. Optional. The default is the argument used for title overlay const bool If true, the indicator will be displayed over the chart. If false, it will be added in a separate pane. Optional. The default is false. format const string Specifies the formatting of the script's displayed values precision const int Specifies the number of digits after the floating point of the script's displayed values calc_on_every_tick const bool If true, the indicator recalculates on every realtime tick update of the last bar. If false, it recalculates only when the bar is confirmed. Optional. The default is true. max_lines_count const int max_boxes_count const int max_labels_count const int max_polylines_count const int behind_chart const bool Return Type
void Example
//@lipi=2
indicator(title="Simple Moving Average", overlay=true,shorttitle="SMA")
sma_value = talib.sma(close, 14)
plot(sma_value, title="SMA 14", color=color.blue, linewidth=2)