=> - Pine Script Operator
=>
Overview
Section titled “Overview”The ’=>’ operator is used in user-defined function declarations and in switch statements.
Syntax
Section titled “Syntax”<identifier>([<parameter_name>[=<default_value>]], ...) => <local_block> <function_result>Remarks
Section titled “Remarks”- You can learn more about user-defined functions in the User Manual’s pages on Declaring functions and Libraries.
Example
Section titled “Example”//@version=6indicator("=>")// single-line functionf1(x, y) => x + y// multi-line functionf2(x, y) => sum = x + y sumChange = ta.change(sum, 10) // Function automatically returns the last expression used in itplot(f1(30, 8) + f2(1, 3))