Lipi Reference Lipi

Keywords

return

Hands a value back from a braced function body. It takes an expression. A tuple is written as a bracketed list, so a function can return several values at once. The arrow body form needs no `return` — the expression after the arrow is the result.

Syntax

                return <expression>
              

Example


          indicator("Return Example", overlay=true)
func getSquare(float x) {
    // Returns the square of x
    return x * x
}
plot(getSquare(close), title="Squared Close Price", color=color.blue)