0% found this document useful (0 votes)
35 views16 pages

Pine Script™ v5 User (3)

The Pine Script™ v5 User Manual provides comprehensive guidance on using Pine Script for scripting and developing indicators and strategies. It covers various topics including script structure, language features, built-in functions, and error handling, along with migration guides and FAQs. The manual serves as a resource for both beginners and experienced users to enhance their scripting skills in the TradingView platform.

Uploaded by

edgarcvmx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views16 pages

Pine Script™ v5 User (3)

The Pine Script™ v5 User Manual provides comprehensive guidance on using Pine Script for scripting and developing indicators and strategies. It covers various topics including script structure, language features, built-in functions, and error handling, along with migration guides and FAQs. The manual serves as a resource for both beginners and experienced users to enhance their scripting skills in the TradingView platform.

Uploaded by

edgarcvmx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Pine Script™ v5 User Manual ( #)

User Manual • Pine Script™ v5 User Manual

Search...

Welcome to Pine Script™ v5


Pine Script™ v5 User
(Introduction.html)

Pine Script™ primer


Manual
Welcome to Pine Script™ v5 (Introduction.html)
(primer/index.html)
Pine Script™ primer (primer/index.html)
Language (language/index.html) First steps (primer/First_steps.html)
Introduction (primer/First_steps.html#introduction)
Concepts (concepts/index.html)
Using scripts (primer/First_steps.html#using-scripts)
Writing scripts (writing/index.html) Reading scripts (primer/First_steps.html#reading-
scripts)
FAQ (Faq.html) Writing scripts (primer/First_steps.html#writing-
scripts)
Error messages
First indicator (primer/First_indicator.html)
(Error_messages.html)
The Pine Editor (primer/First_indicator.html#the-
Release notes (Release_notes.html) pine-editor)
First version (primer/First_indicator.html#first-
Migration guides
version)
(migration_guides/index.html)
Second version (primer/First_indicator.html#second-
Where can I get more information? version)
(Where_can_I_get_more_information Next (primer/First_indicator.html#next)
.html) Next steps (primer/Next_steps.html)
“indicators” vs “strategies”
(primer/Next_steps.html#indicators-vs-strategies)
How scripts are executed
(primer/Next_steps.html#how-scripts-are-executed)
Time series (primer/Next_steps.html#time-series)
Publishing scripts
(primer/Next_steps.html#publishing-scripts)
Getting around the Pine Script™ documentation
(primer/Next_steps.html#getting-around-the-pine-
script-documentation)
Where to go from here?
(primer/Next_steps.html#where-to-go-from-here)
Language (language/index.html)
Execution model (language/Execution_model.html)
Calculation based on historical bars
(language/Execution_model.html#calculation-based-
on-historical-bars)
Calculation based on realtime bars
(language/Execution_model.html#calculation-based-
on-realtime-bars)
Options v: v5
Events triggering the execution of a script
Pine Script™ v5 User Manual ( #)
(language/Execution_model.html#events-triggering-
the-execution-of-a-script)
More information
(language/Execution_model.html#more-information)
Historical values of functions
Welcome to Pine Script™ v5 (language/Execution_model.html#historical-values-
(Introduction.html) of-functions)
Time series (language/Time_series.html)
Pine Script™ primer
Script structure (language/Script_structure.html)
(primer/index.html)
Version (language/Script_structure.html#version)
Language (language/index.html) Declaration statement
(language/Script_structure.html#declaration-
Concepts (concepts/index.html) statement)
Code (language/Script_structure.html#code)
Writing scripts (writing/index.html)
Comments
FAQ (Faq.html) (language/Script_structure.html#comments)
Line wrapping (language/Script_structure.html#line-
Error messages
wrapping)
(Error_messages.html)
Compiler annotations
Release notes (Release_notes.html) (language/Script_structure.html#compiler-
annotations)
Migration guides Identifiers (language/Identifiers.html)
(migration_guides/index.html)
Operators (language/Operators.html)
Where can I get more information? Introduction (language/Operators.html#introduction)
(Where_can_I_get_more_information Arithmetic operators
.html) (language/Operators.html#arithmetic-operators)
Comparison operators
(language/Operators.html#comparison-operators)
Logical operators (language/Operators.html#logical-
operators)
`?:` ternary operator
(language/Operators.html#ternary-operator)
`[ ]` history-referencing operator
(language/Operators.html#history-referencing-
operator)
Operator precedence
(language/Operators.html#operator-precedence)
`=` assignement operator
(language/Operators.html#assignement-operator)
`:=` reassignement operator
(language/Operators.html#reassignement-operator)
Variable declarations
(language/Variable_declarations.html)
Introduction
(language/Variable_declarations.html#introduction)
Variable reassignment
Options v: v5 (language/Variable_declarations.html#variable-
reassignment)
Pine Script™ v5 User Manual ( #)
Declaration modes
(language/Variable_declarations.html#declaration-
modes)
Conditional structures
(language/Conditional_structures.html)
Welcome to Pine Script™ v5 Introduction
(Introduction.html) (language/Conditional_structures.html#introduction)
`if` structure
Pine Script™ primer
(language/Conditional_structures.html#if-structure)
(primer/index.html)
`switch` structure
Language (language/index.html) (language/Conditional_structures.html#switch-
structure)
Concepts (concepts/index.html) Matching local block type requirement
(language/Conditional_structures.html#matching-
Writing scripts (writing/index.html)
local-block-type-requirement)
FAQ (Faq.html) Loops (language/Loops.html)
Introduction (language/Loops.html#introduction)
Error messages
`for` (language/Loops.html#for)
(Error_messages.html)
`while` (language/Loops.html#while)
Release notes (Release_notes.html) Type system (language/Type_system.html)
Introduction
Migration guides (language/Type_system.html#introduction)
(migration_guides/index.html)
Qualifiers (language/Type_system.html#qualifiers)
Where can I get more information? Types (language/Type_system.html#types)
(Where_can_I_get_more_information `na` value (language/Type_system.html#na-value)
.html) Type templates (language/Type_system.html#type-
templates)
Type casting (language/Type_system.html#type-
casting)
Tuples (language/Type_system.html#tuples)
Built-ins (language/Built-ins.html)
Introduction (language/Built-ins.html#introduction)
Built-in variables (language/Built-ins.html#built-in-
variables)
Built-in functions (language/Built-ins.html#built-in-
functions)
User-defined functions (language/User-
defined_functions.html)
Introduction (language/User-
defined_functions.html#introduction)
Single-line functions (language/User-
defined_functions.html#single-line-functions)
Multi-line functions (language/User-
defined_functions.html#multi-line-functions)
Scopes in the script (language/User-
defined_functions.html#scopes-in-the-script)
Options v: v5
Functions that return multiple results
Pine Script™ v5 User Manual ( #)
(language/User-defined_functions.html#functions-
that-return-multiple-results)
Limitations (language/User-
defined_functions.html#limitations)
Objects (language/Objects.html)
Welcome to Pine Script™ v5 Introduction (language/Objects.html#introduction)
(Introduction.html) Creating objects (language/Objects.html#creating-
objects)
Pine Script™ primer
Changing field values
(primer/index.html)
(language/Objects.html#changing-field-values)
Language (language/index.html) Collecting objects
(language/Objects.html#collecting-objects)
Concepts (concepts/index.html) Copying objects (language/Objects.html#copying-
Writing scripts (writing/index.html)
objects)
Shadowing (language/Objects.html#shadowing)
FAQ (Faq.html) Methods (language/Methods.html)
Introduction (language/Methods.html#introduction)
Error messages
Built-in methods (language/Methods.html#built-in-
(Error_messages.html)
methods)
Release notes (Release_notes.html) User-defined methods (language/Methods.html#user-
defined-methods)
Migration guides Method overloading
(migration_guides/index.html)
(language/Methods.html#method-overloading)
Where can I get more information? Advanced example
(Where_can_I_get_more_information (language/Methods.html#advanced-example)
.html) Arrays (language/Arrays.html)
Introduction (language/Arrays.html#introduction)
Declaring arrays (language/Arrays.html#declaring-
arrays)
Reading and writing array elements
(language/Arrays.html#reading-and-writing-array-
elements)
Looping through array elements
(language/Arrays.html#looping-through-array-
elements)
Scope (language/Arrays.html#scope)
History referencing (language/Arrays.html#history-
referencing)
Inserting and removing array elements
(language/Arrays.html#inserting-and-removing-
array-elements)
Calculations on arrays
(language/Arrays.html#calculations-on-arrays)
Manipulating arrays
(language/Arrays.html#manipulating-arrays)
Searching arrays (language/Arrays.html#searching-
Options v: v5 arrays)
Error handling (language/Arrays.html#error-handling)
Pine Script™ v5 User Manual ( #)
Matrices (language/Matrices.html)
Introduction (language/Matrices.html#introduction)
Declaring a matrix
(language/Matrices.html#declaring-a-matrix)
Reading and writing matrix elements
Welcome to Pine Script™ v5 (language/Matrices.html#reading-and-writing-
(Introduction.html) matrix-elements)
Rows and columns (language/Matrices.html#rows-
Pine Script™ primer
and-columns)
(primer/index.html)
Looping through a matrix
Language (language/index.html) (language/Matrices.html#looping-through-a-matrix)
Copying a matrix (language/Matrices.html#copying-
Concepts (concepts/index.html) a-matrix)
Scope and history (language/Matrices.html#scope-
Writing scripts (writing/index.html)
and-history)
FAQ (Faq.html) Inspecting a matrix
(language/Matrices.html#inspecting-a-matrix)
Error messages
Manipulating a matrix
(Error_messages.html)
(language/Matrices.html#manipulating-a-matrix)
Release notes (Release_notes.html) Matrix calculations (language/Matrices.html#matrix-
calculations)
Migration guides Error handling (language/Matrices.html#error-
(migration_guides/index.html)
handling)
Where can I get more information? Maps (language/Maps.html)
(Where_can_I_get_more_information Introduction (language/Maps.html#introduction)
.html) Declaring a map (language/Maps.html#declaring-a-
map)
Reading and writing (language/Maps.html#reading-
and-writing)
Looping through a map
(language/Maps.html#looping-through-a-map)
Copying a map (language/Maps.html#copying-a-map)
Scope and history (language/Maps.html#scope-and-
history)
Maps of other collections
(language/Maps.html#maps-of-other-collections)
Concepts (concepts/index.html)
Alerts (concepts/Alerts.html)
Introduction (concepts/Alerts.html#introduction)
Script alerts (concepts/Alerts.html#script-alerts)
`alertcondition()` events
(concepts/Alerts.html#alertcondition-events)
Avoiding repainting with alerts
(concepts/Alerts.html#avoiding-repainting-with-
alerts)
Backgrounds (concepts/Backgrounds.html)
Options v: v5 Bar coloring (concepts/Bar_coloring.html)
Bar plotting (concepts/Bar_plotting.html)
Pine Script™ v5 User Manual ( #)
Introduction
(concepts/Bar_plotting.html#introduction)
Plotting candles with `plotcandle()`
(concepts/Bar_plotting.html#plotting-candles-with-
plotcandle)
Welcome to Pine Script™ v5 Plotting bars with `plotbar()`
(Introduction.html) (concepts/Bar_plotting.html#plotting-bars-with-
plotbar)
Pine Script™ primer
Bar states (concepts/Bar_states.html)
(primer/index.html)
Introduction
Language (language/index.html) (concepts/Bar_states.html#introduction)
Bar state built-in variables
Concepts (concepts/index.html) (concepts/Bar_states.html#bar-state-built-in-
variables)
Writing scripts (writing/index.html)
Example (concepts/Bar_states.html#example)
FAQ (Faq.html) Chart information (concepts/Chart_information.html)
Introduction
Error messages
(concepts/Chart_information.html#introduction)
(Error_messages.html)
Prices and volume
Release notes (Release_notes.html) (concepts/Chart_information.html#prices-and-
volume)
Migration guides Symbol information
(migration_guides/index.html)
(concepts/Chart_information.html#symbol-
Where can I get more information? information)
(Where_can_I_get_more_information Chart timeframe
.html) (concepts/Chart_information.html#chart-timeframe)
Session information
(concepts/Chart_information.html#session-
information)
Colors (concepts/Colors.html)
Introduction (concepts/Colors.html#introduction)
Constant colors (concepts/Colors.html#constant-
colors)
Conditional coloring
(concepts/Colors.html#conditional-coloring)
Calculated colors (concepts/Colors.html#calculated-
colors)
Mixing transparencies (concepts/Colors.html#mixing-
transparencies)
Tips (concepts/Colors.html#tips)
Fills (concepts/Fills.html)
Introduction (concepts/Fills.html#introduction)
`plot()` and `hline()` fills (concepts/Fills.html#plot-
and-hline-fills)
Line fills (concepts/Fills.html#line-fills)
Inputs (concepts/Inputs.html)
Options v: v5 Introduction (concepts/Inputs.html#introduction)
Input functions (concepts/Inputs.html#input-
Pine Script™ v5 User Manual ( #)
functions)
Input function parameters
(concepts/Inputs.html#input-function-parameters)
Input types (concepts/Inputs.html#input-types)
Other features affecting Inputs
Welcome to Pine Script™ v5 (concepts/Inputs.html#other-features-affecting-
(Introduction.html) inputs)
Tips (concepts/Inputs.html#tips)
Pine Script™ primer
Levels (concepts/Levels.html)
(primer/index.html)
`hline()` levels (concepts/Levels.html#hline-levels)
Language (language/index.html) Fills between levels (concepts/Levels.html#fills-
between-levels)
Concepts (concepts/index.html) Libraries (concepts/Libraries.html)
Introduction (concepts/Libraries.html#introduction)
Writing scripts (writing/index.html)
Creating a library (concepts/Libraries.html#creating-
FAQ (Faq.html) a-library)
Publishing a library
Error messages
(concepts/Libraries.html#publishing-a-library)
(Error_messages.html)
Using a library (concepts/Libraries.html#using-a-
Release notes (Release_notes.html) library)
Lines and boxes (concepts/Lines_and_boxes.html)
Migration guides Introduction
(migration_guides/index.html)
(concepts/Lines_and_boxes.html#introduction)
Where can I get more information? Lines (concepts/Lines_and_boxes.html#lines)
(Where_can_I_get_more_information Boxes (concepts/Lines_and_boxes.html#boxes)
.html) Polylines (concepts/Lines_and_boxes.html#polylines)
Realtime behavior
(concepts/Lines_and_boxes.html#realtime-behavior)
Limitations
(concepts/Lines_and_boxes.html#limitations)
Non-standard charts data (concepts/Non-
standard_charts_data.html)
Introduction (concepts/Non-
standard_charts_data.html#introduction)
`ticker.heikinashi()` (concepts/Non-
standard_charts_data.html#id1)
`ticker.renko()` (concepts/Non-
standard_charts_data.html#id2)
`ticker.linebreak()` (concepts/Non-
standard_charts_data.html#id4)
`ticker.kagi()` (concepts/Non-
standard_charts_data.html#id6)
`ticker.pointfigure()` (concepts/Non-
standard_charts_data.html#id8)
Other timeframes and data
(concepts/Other_timeframes_and_data.html)
Options v: v5
Introduction
Pine Script™ v5 User Manual ( #)
(concepts/Other_timeframes_and_data.html#introduction)
Common characteristics
(concepts/Other_timeframes_and_data.html#common-
characteristics)
Data feeds
Welcome to Pine Script™ v5 (concepts/Other_timeframes_and_data.html#data-
(Introduction.html) feeds)
`request.security()`
Pine Script™ primer
(concepts/Other_timeframes_and_data.html#request-
(primer/index.html)
security)
Language (language/index.html) `request.security_lower_tf()`
(concepts/Other_timeframes_and_data.html#request-
Concepts (concepts/index.html) security-lower-tf)
Writing scripts (writing/index.html)
Custom contexts
(concepts/Other_timeframes_and_data.html#custom-
FAQ (Faq.html) contexts)
Historical and realtime behavior
Error messages
(concepts/Other_timeframes_and_data.html#historical-
(Error_messages.html)
and-realtime-behavior)
Release notes (Release_notes.html) `request.currency_rate()`
(concepts/Other_timeframes_and_data.html#request-
Migration guides currency-rate)
(migration_guides/index.html)
`request.dividends()`, `request.splits()`, and
Where can I get more information? `request.earnings()`
(Where_can_I_get_more_information (concepts/Other_timeframes_and_data.html#request-
.html) dividends-request-splits-and-request-earnings)
`request.quandl()`
(concepts/Other_timeframes_and_data.html#request-
quandl)
`request.financial()`
(concepts/Other_timeframes_and_data.html#request-
financial)
`request.economic()`
(concepts/Other_timeframes_and_data.html#request-
economic)
`request.seed()`
(concepts/Other_timeframes_and_data.html#request-
seed)
Plots (concepts/Plots.html)
Introduction (concepts/Plots.html#introduction)
`plot()` parameters (concepts/Plots.html#plot-
parameters)
Plotting conditionally (concepts/Plots.html#plotting-
conditionally)
Levels (concepts/Plots.html#levels)
Offsets (concepts/Plots.html#offsets)
Options v: v5
Plot count limit (concepts/Plots.html#plot-count-
Pine Script™ v5 User Manual ( #)
limit)
Scale (concepts/Plots.html#scale)
Repainting (concepts/Repainting.html)
Introduction
(concepts/Repainting.html#introduction)
Welcome to Pine Script™ v5 Historical vs realtime calculations
(Introduction.html) (concepts/Repainting.html#historical-vs-realtime-
calculations)
Pine Script™ primer
Plotting in the past
(primer/index.html)
(concepts/Repainting.html#plotting-in-the-past)
Language (language/index.html) Dataset variations
(concepts/Repainting.html#dataset-variations)
Concepts (concepts/index.html) Sessions (concepts/Sessions.html)
Introduction (concepts/Sessions.html#introduction)
Writing scripts (writing/index.html)
Session strings (concepts/Sessions.html#session-
FAQ (Faq.html) strings)
Session states (concepts/Sessions.html#session-
Error messages
states)
(Error_messages.html)
Using sessions with `request.security()`
Release notes (Release_notes.html) (concepts/Sessions.html#using-sessions-with-
request-security)
Migration guides Strategies (concepts/Strategies.html)
(migration_guides/index.html)
Introduction (concepts/Strategies.html#introduction)
Where can I get more information? A simple strategy example
(Where_can_I_get_more_information (concepts/Strategies.html#a-simple-strategy-
.html) example)
Applying a strategy to a chart
(concepts/Strategies.html#applying-a-strategy-to-a-
chart)
Strategy tester (concepts/Strategies.html#strategy-
tester)
Broker emulator (concepts/Strategies.html#broker-
emulator)
Orders and entries
(concepts/Strategies.html#orders-and-entries)
Position sizing (concepts/Strategies.html#position-
sizing)
Closing a market position
(concepts/Strategies.html#closing-a-market-
position)
OCA groups (concepts/Strategies.html#oca-groups)
Currency (concepts/Strategies.html#currency)
Altering calculation behavior
(concepts/Strategies.html#altering-calculation-
behavior)
Simulating trading costs
Options v: v5 (concepts/Strategies.html#simulating-trading-costs)
Risk management (concepts/Strategies.html#risk-
Pine Script™ v5 User Manual ( #)
management)
Margin (concepts/Strategies.html#margin)
Strategy Alerts (concepts/Strategies.html#strategy-
alerts)
Notes on testing strategies
Welcome to Pine Script™ v5 (concepts/Strategies.html#notes-on-testing-
(Introduction.html) strategies)
Tables (concepts/Tables.html)
Pine Script™ primer
Introduction (concepts/Tables.html#introduction)
(primer/index.html)
Creating tables (concepts/Tables.html#creating-
Language (language/index.html) tables)
Tips (concepts/Tables.html#tips)
Concepts (concepts/index.html) Text and shapes (concepts/Text_and_shapes.html)
Introduction
Writing scripts (writing/index.html)
(concepts/Text_and_shapes.html#introduction)
FAQ (Faq.html) `plotchar()`
(concepts/Text_and_shapes.html#plotchar)
Error messages
`plotshape()`
(Error_messages.html)
(concepts/Text_and_shapes.html#plotshape)
Release notes (Release_notes.html) `plotarrow()`
(concepts/Text_and_shapes.html#plotarrow)
Migration guides Labels (concepts/Text_and_shapes.html#labels)
(migration_guides/index.html)
Time (concepts/Time.html)
Where can I get more information? Introduction (concepts/Time.html#introduction)
(Where_can_I_get_more_information Time variables (concepts/Time.html#time-variables)
.html) Time functions (concepts/Time.html#time-functions)
Formatting dates and time
(concepts/Time.html#formatting-dates-and-time)
Timeframes (concepts/Timeframes.html)
Introduction
(concepts/Timeframes.html#introduction)
Timeframe string specifications
(concepts/Timeframes.html#timeframe-string-
specifications)
Comparing timeframes
(concepts/Timeframes.html#comparing-timeframes)
Writing scripts (writing/index.html)
Style guide (writing/Style_guide.html)
Introduction (writing/Style_guide.html#introduction)
Naming Conventions
(writing/Style_guide.html#naming-conventions)
Script organization (writing/Style_guide.html#script-
organization)
Spacing (writing/Style_guide.html#spacing)
Line wrapping (writing/Style_guide.html#line-
wrapping)
Options v: v5
Vertical alignment
Pine Script™ v5 User Manual ( #)
(writing/Style_guide.html#vertical-alignment)
Explicit typing (writing/Style_guide.html#explicit-
typing)
Debugging (writing/Debugging.html)
Introduction (writing/Debugging.html#introduction)
Welcome to Pine Script™ v5 The lay of the land (writing/Debugging.html#the-lay-
(Introduction.html) of-the-land)
Displaying numeric values
Pine Script™ primer
(writing/Debugging.html#displaying-numeric-values)
(primer/index.html)
Displaying strings
Language (language/index.html) (writing/Debugging.html#displaying-strings)
Debugging conditions
Concepts (concepts/index.html) (writing/Debugging.html#debugging-conditions)
Debugging from inside functions
Writing scripts (writing/index.html)
(writing/Debugging.html#debugging-from-inside-
FAQ (Faq.html) functions)
Debugging from inside `for` loops
Error messages
(writing/Debugging.html#debugging-from-inside-for-
(Error_messages.html)
loops)
Release notes (Release_notes.html) Tips (writing/Debugging.html#tips)
Publishing scripts (writing/Publishing.html)
Migration guides Script visibility and access
(migration_guides/index.html)
(writing/Publishing.html#script-visibility-and-access)
Where can I get more information? Preparing a publication
(Where_can_I_get_more_information (writing/Publishing.html#preparing-a-publication)
.html) Publishing a script
(writing/Publishing.html#publishing-a-script)
Updating a publication
(writing/Publishing.html#updating-a-publication)
Limitations (writing/Limitations.html)
Introduction (writing/Limitations.html#introduction)
Time (writing/Limitations.html#time)
Chart visuals (writing/Limitations.html#chart-visuals)
`request.*()` calls
(writing/Limitations.html#request-calls)
Script size and memory
(writing/Limitations.html#script-size-and-memory)
Other limitations (writing/Limitations.html#other-
limitations)
FAQ (Faq.html)
Get real OHLC price on a Heikin Ashi chart (Faq.html#get-
real-ohlc-price-on-a-heikin-ashi-chart)
Get non-standard OHLC values on a standard chart
(Faq.html#get-non-standard-ohlc-values-on-a-standard-
chart)
Plot arrows on the chart (Faq.html#plot-arrows-on-the-
Options v: v5 chart)
Plot a dynamic horizontal line (Faq.html#plot-a-dynamic-
Pine Script™ v5 User Manual ( #)
horizontal-line)
Plot a vertical line on condition (Faq.html#plot-a-vertical-
line-on-condition)
Access the previous value (Faq.html#access-the-previous-
value)
Welcome to Pine Script™ v5 Get a 5-days high (Faq.html#get-a-5-days-high)
(Introduction.html) Count bars in a dataset (Faq.html#count-bars-in-a-
dataset)
Pine Script™ primer
Enumerate bars in a day (Faq.html#enumerate-bars-in-a-
(primer/index.html)
day)
Language (language/index.html) Find the highest and lowest values for the entire dataset
(Faq.html#find-the-highest-and-lowest-values-for-the-
Concepts (concepts/index.html) entire-dataset)
Query the last non-na value (Faq.html#query-the-last-non-
Writing scripts (writing/index.html)
na-value)
FAQ (Faq.html) Error messages (Error_messages.html)
The if statement is too long (Error_messages.html#the-if-
Error messages
statement-is-too-long)
(Error_messages.html)
Script requesting too many securities
Release notes (Release_notes.html) (Error_messages.html#script-requesting-too-many-
securities)
Migration guides Script could not be translated from: null
(migration_guides/index.html)
(Error_messages.html#script-could-not-be-translated-
Where can I get more information? from-null)
(Where_can_I_get_more_information line 2: no viable alternative at character ‘$’
.html) (Error_messages.html#line-2-no-viable-alternative-at-
character)
Mismatched input <…> expecting <???>
(Error_messages.html#mismatched-input-expecting)
Loop is too long (> 500 ms) (Error_messages.html#loop-is-
too-long-500-ms)
Script has too many local variables
(Error_messages.html#script-has-too-many-local-variables)
Pine Script™ cannot determine the referencing length of a
series. Try using max_bars_back in the indicator or
strategy function (Error_messages.html#pine-script-
cannot-determine-the-referencing-length-of-a-series-try-
using-max-bars-back-in-the-indicator-or-strategy-function)
Release notes (Release_notes.html)
2023 (Release_notes.html#id1)
December 2023 (Release_notes.html#december-
2023)
November 2023 (Release_notes.html#november-
2023)
October 2023 (Release_notes.html#october-2023)
September 2023 (Release_notes.html#september-
Options v: v5 2023)
August 2023 (Release_notes.html#august-2023)
Pine Script™ v5 User Manual ( #)
July 2023 (Release_notes.html#july-2023)
June 2023 (Release_notes.html#june-2023)
May 2023 (Release_notes.html#may-2023)
April 2023 (Release_notes.html#april-2023)
March 2023 (Release_notes.html#march-2023)
Welcome to Pine Script™ v5 February 2023 (Release_notes.html#february-2023)
(Introduction.html) January 2023 (Release_notes.html#january-2023)
2022 (Release_notes.html#id2)
Pine Script™ primer
December 2022 (Release_notes.html#december-
(primer/index.html)
2022)
Language (language/index.html) November 2022 (Release_notes.html#november-
2022)
Concepts (concepts/index.html) October 2022 (Release_notes.html#october-2022)
Writing scripts (writing/index.html)
September 2022 (Release_notes.html#september-
2022)
FAQ (Faq.html) August 2022 (Release_notes.html#august-2022)
July 2022 (Release_notes.html#july-2022)
Error messages
June 2022 (Release_notes.html#june-2022)
(Error_messages.html)
May 2022 (Release_notes.html#may-2022)
Release notes (Release_notes.html) April 2022 (Release_notes.html#april-2022)
March 2022 (Release_notes.html#march-2022)
Migration guides February 2022 (Release_notes.html#february-2022)
(migration_guides/index.html)
January 2022 (Release_notes.html#january-2022)
Where can I get more information? 2021 (Release_notes.html#id9)
(Where_can_I_get_more_information December 2021 (Release_notes.html#december-
.html) 2021)
November 2021 (Release_notes.html#november-
2021)
October 2021 (Release_notes.html#october-2021)
September 2021 (Release_notes.html#september-
2021)
July 2021 (Release_notes.html#july-2021)
June 2021 (Release_notes.html#june-2021)
May 2021 (Release_notes.html#may-2021)
April 2021 (Release_notes.html#april-2021)
March 2021 (Release_notes.html#march-2021)
February 2021 (Release_notes.html#february-2021)
January 2021 (Release_notes.html#january-2021)
2020 (Release_notes.html#id10)
December 2020 (Release_notes.html#december-
2020)
November 2020 (Release_notes.html#november-
2020)
October 2020 (Release_notes.html#october-2020)
September 2020 (Release_notes.html#september-
2020)
Options v: v5 August 2020 (Release_notes.html#august-2020)
July 2020 (Release_notes.html#july-2020)
Pine Script™ v5 User Manual ( #)
June 2020 (Release_notes.html#june-2020)
May 2020 (Release_notes.html#may-2020)
April 2020 (Release_notes.html#april-2020)
March 2020 (Release_notes.html#march-2020)
February 2020 (Release_notes.html#february-2020)
Welcome to Pine Script™ v5 January 2020 (Release_notes.html#january-2020)
(Introduction.html) 2019 (Release_notes.html#id11)
December 2019 (Release_notes.html#december-
Pine Script™ primer
2019)
(primer/index.html)
October 2019 (Release_notes.html#october-2019)
Language (language/index.html) September 2019 (Release_notes.html#september-
2019)
Concepts (concepts/index.html) July-August 2019 (Release_notes.html#july-august-
2019)
Writing scripts (writing/index.html)
June 2019 (Release_notes.html#june-2019)
FAQ (Faq.html) 2018 (Release_notes.html#id12)
October 2018 (Release_notes.html#october-2018)
Error messages
April 2018 (Release_notes.html#april-2018)
(Error_messages.html)
2017 (Release_notes.html#id13)
Release notes (Release_notes.html) August 2017 (Release_notes.html#august-2017)
June 2017 (Release_notes.html#june-2017)
Migration guides May 2017 (Release_notes.html#may-2017)
(migration_guides/index.html)
April 2017 (Release_notes.html#april-2017)
Where can I get more information? March 2017 (Release_notes.html#march-2017)
(Where_can_I_get_more_information February 2017 (Release_notes.html#february-2017)
.html) 2016 (Release_notes.html#id14)
December 2016 (Release_notes.html#december-
2016)
October 2016 (Release_notes.html#october-2016)
September 2016 (Release_notes.html#september-
2016)
July 2016 (Release_notes.html#july-2016)
March 2016 (Release_notes.html#march-2016)
February 2016 (Release_notes.html#february-2016)
January 2016 (Release_notes.html#january-2016)
2015 (Release_notes.html#id15)
October 2015 (Release_notes.html#october-2015)
September 2015 (Release_notes.html#september-
2015)
July 2015 (Release_notes.html#july-2015)
June 2015 (Release_notes.html#june-2015)
April 2015 (Release_notes.html#april-2015)
March 2015 (Release_notes.html#march-2015)
February 2015 (Release_notes.html#february-2015)
2014 (Release_notes.html#id16)
August 2014 (Release_notes.html#august-2014)
Options v: v5 July 2014 (Release_notes.html#july-2014)
June 2014 (Release_notes.html#june-2014)
Pine Script™ v5 User Manual ( #)
April 2014 (Release_notes.html#april-2014)
February 2014 (Release_notes.html#february-2014)
2013 (Release_notes.html#id17)
Migration guides (migration_guides/index.html)
To Pine Script™ version 5
Welcome to Pine Script™ v5 (migration_guides/To_Pine_version_5.html)
(Introduction.html) Introduction
(migration_guides/To_Pine_version_5.html#introduction)
Pine Script™ primer
v4 to v5 converter
(primer/index.html)
(migration_guides/To_Pine_version_5.html#v4-to-v5-
Language (language/index.html) converter)
Renamed functions and variables
Concepts (concepts/index.html) (migration_guides/To_Pine_version_5.html#renamed-
Writing scripts (writing/index.html)
functions-and-variables)
Renamed function parameters
FAQ (Faq.html) (migration_guides/To_Pine_version_5.html#renamed-
function-parameters)
Error messages
Removed an `rsi()` overload
(Error_messages.html)
(migration_guides/To_Pine_version_5.html#removed-
Release notes (Release_notes.html) an-rsi-overload)
Reserved keywords
Migration guides (migration_guides/To_Pine_version_5.html#reserved-
(migration_guides/index.html)
keywords)
Where can I get more information? Removed `iff()` and `offset()`
(Where_can_I_get_more_information (migration_guides/To_Pine_version_5.html#removed-
.html) iff-and-offset)
Split of `input()` into several functions
(migration_guides/To_Pine_version_5.html#split-of-
input-into-several-functions)
Some function parameters now require built-in
arguments
(migration_guides/To_Pine_version_5.html#some-
function-parameters-now-require-built-in-
arguments)
Deprecated the `transp` parameter
(migration_guides/To_Pine_version_5.html#deprecated-
the-transp-parameter)
Changed the default session days for `time()` and
`time_close()`
(migration_guides/To_Pine_version_5.html#changed-
the-default-session-days-for-time-and-time-close)
`strategy.exit()` now must do something
(migration_guides/To_Pine_version_5.html#strategy-
exit-now-must-do-something)
Common script conversion errors
(migration_guides/To_Pine_version_5.html#common-
Options v: v5 script-conversion-errors)
All variable, function, and parameter name changes
Pine Script™ v5 User Manual ( #)
(migration_guides/To_Pine_version_5.html#all-
variable-function-and-parameter-name-changes)
To Pine Script™ version 4
(migration_guides/To_Pine_version_4.html)
Converter
Welcome to Pine Script™ v5 (migration_guides/To_Pine_version_4.html#converter)
(Introduction.html) Renaming of built-in constants, variables, and
functions
Pine Script™ primer
(migration_guides/To_Pine_version_4.html#renaming-
(primer/index.html)
of-built-in-constants-variables-and-functions)
Language (language/index.html) Explicit variable type declaration
(migration_guides/To_Pine_version_4.html#explicit-
Concepts (concepts/index.html) variable-type-declaration)
Writing scripts (writing/index.html)
To Pine Script™ version 3
(migration_guides/To_Pine_version_3.html)
FAQ (Faq.html) Default behaviour of security function has changed
(migration_guides/To_Pine_version_3.html#default-
Error messages
behaviour-of-security-function-has-changed)
(Error_messages.html)
Self-referenced variables are removed
Release notes (Release_notes.html) (migration_guides/To_Pine_version_3.html#self-
referenced-variables-are-removed)
Migration guides Forward-referenced variables are removed
(migration_guides/index.html)
(migration_guides/To_Pine_version_3.html#forward-
Where can I get more information? referenced-variables-are-removed)
(Where_can_I_get_more_information Resolving a problem with a mutable variable in a
.html) security expression
(migration_guides/To_Pine_version_3.html#resolving-
a-problem-with-a-mutable-variable-in-a-security-
expression)
Math operations with booleans are forbidden
(migration_guides/To_Pine_version_3.html#math-
operations-with-booleans-are-forbidden)
Where can I get more information?
(Where_can_I_get_more_information.html)
External resources
(Where_can_I_get_more_information.html#external-
resources)
Download this manual
(Where_can_I_get_more_information.html#download-this-
manual)

Welcome to Pine Script™ v5 (Introduction.html)

© Copyright 2024, TradingView.


Options v: v5

You might also like