Skip to content
TradequixDocsOpen the terminal
OverviewStart here, search, progress
  • Introduction
  • Quickstart
  • How a script runs
  • Types and qualifiers
  • Operators, conditionals and loops
  • Functions and methods
  • Objects and enums
  • Arrays, matrices and maps
  • Strings and colours
  • Time and sessions
  • Bar states
  • Plotting
  • Inputs
  • Technical analysis
  • Drawings and tables
  • Multiple timeframes
  • Strategies
  • Alerts in scripts
  • Repainting
  • The Pine editor
  • Indicator settings
  • Coming from TradingView
  • The data
  • Publish and sell
  • Catalogue and community
  • Your dashboard and earnings
  • Errors and debugging
  • Limits
  • Coverage
  • Built-in catalogue
  • Cookbook
  • Write Pine with AI
  • FAQ
  • Glossary
  • Cheat sheet
  • Function reference
  • Will it run here?
  • Error index

Language

Types and qualifiers

The types Pine values have, and the qualifiers (const, input, simple, series) that say when a value is known. Why some arguments refuse a series.

View as MarkdownOpen in ClaudeOpen in ChatGPT

Every value in Pine has a type (what it is) and a qualifier (when it is known). Most of the time Pine works both out for you; you only meet them in error messages, or when a function insists on a value that does not change.

Types#

TypeHoldsExample
intWhole numbers14, bar_index
floatDecimalsclose, 1.5
booltrue or falseclose > open
stringText"EMA"
colorA colourcolor.teal, #8b7cff
label, line, box, table…An id for a drawingthe result of label.new(...)
array<float>, matrix<int>, map<string, float>Collectionssee Arrays, matrices and maps
Your own typesFields you definesee Objects and enums

na is a value of any type that means "no value". int mixes freely with float.

Qualifiers, from strictest to loosest#

QualifierKnownExample
constWhen the script is written20, "title"
inputWhen settings are appliedinput.int(20)
simpleOn the first bar, then fixedsyminfo.mintick
seriesCan change on every barclose, ta.rsi(close, 14)

A function argument documented as simple int accepts a const, input or simple value, but not a series. This is why some lengths cannot vary per bar.

RunnableQualifiers
1//@version=62indicator("Qualifiers")3len = input.int(14, "Length") // input int: fine as a length4r = ta.rsi(close, len) // series float5plot(r, "RSI", color = color.purple)

Declaring with a type#

Type keywords are optional; add one when a variable starts as na, so Pine knows what it will hold:

pine
1float lastHigh = na2var label tag = na

Converting#

int(x) truncates a float, float(x) widens an int, str.tostring(x) makes text. Use math.round(x) rather than int(x) when you mean "nearest".

PreviousHow a script runsNext Operators, conditionals and loops

On this page

  • Types
  • Qualifiers, from strictest to loosest
  • Declaring with a type
  • Converting

Use with AI

View as MarkdownOpen in ClaudeOpen in ChatGPT