Navigation
index
next
|
previous
|
Pine Script User Manual 4 documentation
»
Pine Script v4 User Manual
Table Of Contents
Introduction
Quickstart guide
Language fundamentals
Essential features
Alerts
Arrays
Bar states. Built-in variables barstate.*
Colors
Context switching and the security function
Drawings
Extended and regular sessions
Indicator repainting
Non-standard chart types data
Session and time information
Strategies
Tables
Annotations overview
Debugging
Publishing scripts
Public Library
Release notes
Appendix
Where can I get more information?
User Manual
Essential features
Essential features
¶
Alerts
Introduction
Background
Which type of alert is best?
Script alerts
‘alert()’ function events
Order fill events
‘alertcondition()’ events
Using one condition
Using compound conditions
Placeholders
Avoiding repainting with alerts
Arrays
Introduction
Declaring arrays
Using the ‘var’ keyword
Reading and writing array values
Scope
History referencing
Inserting and removing array elements
Inserting
Removing
Using an array as a stack
Using an array as a queue
Calculations on arrays
Manipulating arrays
Concatenation
Copying
Joining
Sorting
Reversing
Slicing
Searching arrays
Error handling
Index xx is out of bounds. Array size is yy
Cannot call array methods when id of array is ‘na’
Array is too large. Maximum size is 100000
Cannot create an array with a negative size
Cannot use
shift()
if array is empty.
Cannot use
pop()
if array is empty.
Index ‘from’ should be less than index ‘to’
Slice is out of bounds of the parent array
Bar states. Built-in variables barstate.*
Colors
Introduction
Transparency
Z-index
Constant colors
Conditional coloring
Calculated colors
color.new()
color.rgb()
color.from_gradient()
Mixing transparencies
Tips
Designing usable colors schemes
Plot crisp lines
Customize gradients
Color selection through script settings
Context switching and the security function
Barmerge gaps and lookahead
Understanding lookahead
Requesting data of a lower timeframe
Drawings
Creating drawings
Calculation of drawings on bar updates
Coordinates
Modifying drawings
Label styles
Line and box styles
Deleting drawings
Examples of classic indicators
Pivot Points Standard
Pivot Points High/Low
Linear Regression
Zig Zag
Limits
Total number of drawings
Bars count in future with xloc.bar_index
Additional securities
max_bars_back of time
Extended and regular sessions
Indicator repainting
Non-standard chart types data
heikinashi function
renko function
linebreak function
kagi function
pointfigure function
Session and time information
The “time” function and variable
Built-in variables for working with time
Strategies
A simple strategy example
Applying a strategy to a chart
Backtesting and forwardtesting
Broker emulator
Order placement commands
Closing market position
OCA groups
Risk management
Currency
Leverage
Tables
Introduction
Creating tables
Placing a single value in a fixed position
Coloring the chart’s background
Creating a display panel
Displaying a heatmap
Tips
Navigation
index
next
|
previous
|
Pine Script User Manual 4 documentation
»
Options
v: v4
Languages
en
Versions
v3
v4
v5