Bulltrading
WebsiteLaunch AppYoutube(FR)Youtube(EN)
  • 📘Preface
  • Bulltrading Designer
    • ⚒️Designer
    • 💻Editor
      • My indicators
      • MarketPlace
      • Create your first indicator
    • 📈My strategies
      • Publish
        • Personal Strategy
        • Strategy To Rent
    • 👨‍💻Pinescript
      • First indicator
      • Pine Script™ v5 User Manual
        • Pine Script™ Execution Model
        • Time Series
        • Pine Script Structure
        • Identifiers
        • Operators
        • Variable declarations
        • Conditional structures
        • Loops
        • Type system
        • Built-ins
        • User-Defined Functions
      • Built-ins
        • Variables
          • Candles
          • Colors
          • Math
          • Ta
        • Functions
          • Indicator
          • Input
          • Plot
          • Na - Nz
          • Math
          • Ta
      • Bulltrading vs TradingView
  • Bulltrading tokens (BLT)
    • 🪙BLT Tokenomics
    • 🧾BLT Contract
    • 🏦Hold Program
    • 🔒BLT Audit
    • 🎯[EN] How to buy BLT ?
    • 🎯[FR] Acheter du BLT
  • Other
    • ⁉️Frequently Asked Question
    • 📺Video Tutorials
    • 📒Glossary
  • 📺[FR] Youtube
  • 📺[EN] Youtube
  • 🦊Twitter
  • 🦊Discord
  • 🦊Telegram
Powered by GitBook
On this page
  1. Bulltrading Designer
  2. Pinescript
  3. Pine Script™ v5 User Manual

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:

myVar
_myVar
my123Var
functionName
MAX_LEN
max_len
maxLen

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:

GREEN_COLOR = #4CAF50  // Constant in SNAKE_CASE
MAX_LOOKBACK = 100  // Constant in SNAKE_CASE
int fastLength = 7  // Variable in camelCase

Below is an example function definition following the prescribed naming conventions:

// This function returns 1 if the argument is `true`, 0 if it is `false` or `na`.
zeroOne(boolValue) => boolValue ? 1 : 0  // Function in camelCase

Remember, these conventions help maintain readability and consistency throughout your Pine Script code.

PreviousPine Script StructureNextOperators

Last updated 1 year ago

👨‍💻