Indicator

1. indicator.signal

Definition: This function, serving as a signal indicator, must be executed for each candle in the declaration statement to discern whether the indicator delivers a positive or neutral output for that specific candle.

Syntax: indicator.signal(output) β†’ void

Returns: -

Arguments:

Name
Type
Description

output

series bool

The output refers to the result of the indicator's evaluation for a specific candle, which can range from a positive, neutral signal.

2. indicator

Definition: This declaration statement designates the script as an indicator and sets a number of indicator-related properties.

Syntax: indicator(title, shorttitle, description) β†’ void

Returns: -

Arguments:

Name
Type
Description

title

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.

description

const string

When creating your trading strategy, the description will be displayed upon selecting your indicator.

Example:

csharpCopy code//@version=5
indicator("My script", shorttitle="Script")
plot(close)

Last updated