Identifiers
Identifiers in Pine Script
Identifiers are names utilized for user-created variables and functions within Pine Script. They must adhere to a certain format and set of rules:
They must start with an uppercase (A-Z) or lowercase (a-z) letter, or an underscore (_).
Following the first character, the identifier can include letters, underscores, or digits (0-9).
They are case-sensitive.
Here are some examples of valid identifiers:
Please note, the identifier '3barsDown' is not valid since it begins with a digit.
The Pine Scriptβ’ Style Guide recommends adopting the uppercase SNAKE_CASE for constants, and camelCase for other identifiers:
Below is an example function definition following the prescribed naming conventions:
Remember, these conventions help maintain readability and consistency throughout your Pine Script code.
Last updated