Pine Script API Coverage

PineChart implements 511 out of 768 Pine Script v5/v6 API functions (~66%).

Legend:

  • βœ… Implemented (511)
  • πŸ”΅ Planned (59)
  • πŸ”΄ Not Yet Implemented (196)
  • 🟑 Partial (2)

1. Array

Creation & Initialization

Function Status Description
array.copy() βœ… Create copy of array
array.from() βœ… Create array from arguments
array.new_bool() βœ… Create boolean array
array.new_box() πŸ”΅ Create box array
array.new_color() πŸ”΅ Create color array
array.new_float() βœ… Create float array
array.new_int() βœ… Create int array
array.new_label() πŸ”΅ Create label array
array.new_line() πŸ”΅ Create line array
array.new_linefill() πŸ”΅ Create linefill array
array.new_string() πŸ”΅ Create string array
array.new_table() πŸ”΅ Create table array
array.new<type>() πŸ”΅ Create typed array (generic)

Element Access

Function Status Description
array.first() βœ… Get first element
array.get() βœ… Get value at index
array.last() βœ… Get last element
array.set() βœ… Set value at index

Modification

Function Status Description
array.clear() βœ… Remove all elements
array.fill() βœ… Fill array with value
array.insert() βœ… Insert element at index
array.pop() βœ… Remove last element
array.push() βœ… Append element to end
array.remove() βœ… Remove element at index
array.reverse() βœ… Reverse order
array.shift() βœ… Remove first element
array.unshift() βœ… Prepend element

Size & Shape

Function Status Description
array.concat() βœ… Concatenate arrays
array.size() βœ… Get array size
array.slice() βœ… Extract subarray

Search & Query

Function Status Description
array.binary_search() βœ… Binary search
array.binary_search_leftmost() βœ… Binary search (leftmost)
array.binary_search_rightmost() βœ… Binary search (rightmost)
array.includes() βœ… Check if value exists
array.indexof() βœ… Find first index of value
array.lastindexof() βœ… Find last index of value

Statistical

Function Status Description
array.avg() βœ… Average of elements
array.covariance() βœ… Covariance
array.max() βœ… Maximum value
array.median() βœ… Median value
array.min() βœ… Minimum value
array.mode() βœ… Mode value
array.range() βœ… Range of values
array.stdev() βœ… Standard deviation
array.sum() βœ… Sum of elements
array.variance() βœ… Variance

Percentiles

Function Status Description
array.percentile_linear_interpolation() βœ… Percentile (Linear)
array.percentile_nearest_rank() βœ… Percentile (Nearest Rank)
array.percentrank() βœ… Percentile rank

Transformation

Function Status Description
array.abs() βœ… Absolute values
array.join() βœ… Join to string
array.sort() βœ… Sort array
array.sort_indices() βœ… Get sorted indices
array.standardize() βœ… Standardize elements

Logical

Function Status Description
array.every() βœ… Check if all elements match
array.some() βœ… Check if any element matches

2. Built-in Variables & Functions

Variables

Function Status Description
bar_index βœ… Current bar index
close βœ… Close price
high βœ… High price
hl2 βœ… Average of high and low
hlc3 βœ… Average of high, low, and close
hlcc4 βœ… Average of high, low, close, close
last_bar_index βœ… Index of last bar
last_bar_time βœ… Time of last bar
low βœ… Low price
na βœ… Not a number literal
ohlc4 βœ… Average of OHLC
open βœ… Open price
timenow βœ… Current time
volume βœ… Volume
ask πŸ”΅ Ask price
bid πŸ”΅ Bid price
time βœ… Bar time
time_close βœ… Bar close time

Constants

Function Status
true βœ…
false βœ…

Functions

Function Status Description
indicator() βœ… Indicator declaration
input() βœ… Input parameter (returns defval)
na() βœ… Check if value is NaN
nz() βœ… Replace NaN with zero
strategy() βœ… Strategy declaration
hline() βœ… Horizontal line
box() βœ… Box object
label() βœ… Label object
line() βœ… Line object
color() βœ… Color type cast
fixnan() βœ… Fix NaN values
int() βœ… Integer conversion
float() βœ… Float conversion
bool() βœ… Boolean conversion
string() βœ… String conversion
year() βœ… Year from time
month() βœ… Month from time
dayofmonth() βœ… Day of month from time
dayofweek() βœ… Day of week from time
hour() βœ… Hour from time
minute() βœ… Minute from time
second() βœ… Second from time
weekofyear() βœ… Week of year from time
time() βœ… Bar time function
time_close() βœ… Bar close time function
timestamp() βœ… Create datetime from components

Date/Time Variables

Variable Status Description
year βœ… Current bar’s year
month βœ… Current bar’s month
dayofmonth βœ… Current bar’s day
dayofweek βœ… Current bar’s day of week (1=Sun..7=Sat)
hour βœ… Current bar’s hour
minute βœ… Current bar’s minute
second βœ… Current bar’s second
weekofyear βœ… Current bar’s week of year

Dayofweek Constants

Constant Status Value
dayofweek.sunday βœ… 1
dayofweek.monday βœ… 2
dayofweek.tuesday βœ… 3
dayofweek.wednesday βœ… 4
dayofweek.thursday βœ… 5
dayofweek.friday βœ… 6
dayofweek.saturday βœ… 7

3. Barstate

Function Status Description
barstate.isconfirmed βœ… Bar is confirmed
barstate.isfirst βœ… First bar of dataset
barstate.ishistory βœ… Bar is historical
barstate.islast βœ… Last bar of dataset
barstate.islastconfirmedhistory βœ… Last confirmed historical bar
barstate.isnew βœ… New bar
barstate.isrealtime βœ… Bar is real-time

4. Box

Management

Function Status Description
box.new() βœ… Create new box
box.delete() βœ… Delete box
box.all βœ… All boxes collection
box.copy() βœ… Copy box

Getters

Function Status Description
box.get_bottom() βœ… Get bottom coordinate
box.get_left() βœ… Get left coordinate
box.get_right() βœ… Get right coordinate
box.get_top() βœ… Get top coordinate

Setters

Function Status Description
box.set_bgcolor() βœ… Set background color
box.set_border_color() βœ… Set border color
box.set_border_style() βœ… Set border style
box.set_border_width() βœ… Set border width
box.set_bottom() βœ… Set bottom coordinate
box.set_left() βœ… Set left coordinate
box.set_lefttop() βœ… Set left-top point
box.set_right() βœ… Set right coordinate
box.set_rightbottom() βœ… Set right-bottom point
box.set_top() βœ… Set top coordinate
box.set_text() βœ… Set text
box.set_text_color() βœ… Set text color
box.set_extend() βœ… Set extend mode

5. Color

Predefined Colors

Color Status
color.black βœ…
color.blue βœ…
color.gray βœ…
color.green βœ…
color.lime βœ…
color.red βœ…
color.white βœ…
color.aqua βœ…
color.navy βœ…
color.orange βœ…
color.purple βœ…
color.yellow βœ…
color.maroon βœ…
color.fuchsia βœ…
color.olive βœ…
color.silver βœ…
color.teal βœ…

Color Functions

Function Status Description
color.new() βœ… Create color with transparency
color.rgb() βœ… Create from RGB components
color.r() βœ… Get red component (0-255)
color.g() βœ… Get green component (0-255)
color.b() βœ… Get blue component (0-255)
color.t() βœ… Get transparency (0-100)
color.from_gradient() βœ… Interpolate between two colors

6. Control Flow

Conditionals

Feature Status
if statement βœ…
if...else βœ…
if...else if chain βœ…
Nested if/else βœ…
if as expression βœ…
switch statement βœ…
switch as expression βœ…
Ternary ? : βœ…

Loops

Feature Status Notes
for i = start to end βœ… Β 
for i = start to end by step βœ… Β 
for item in collection 🟑 Parsed, runtime not ready
while loop βœ… Β 
break βœ… Β 
continue βœ… Β 

Variable Declaration

Feature Status
var βœ…
varip βœ…

7. Input

All input types are implemented and return their default value (defval). No UI integration yet.

Function Status
input() βœ…
input.bool() βœ…
input.color() βœ…
input.enum() βœ…
input.float() βœ…
input.int() βœ…
input.price() βœ…
input.session() βœ…
input.source() βœ…
input.string() βœ…
input.symbol() βœ…
input.text_area() βœ…
input.time() βœ…
input.timeframe() βœ…

8. Label

Management

Function Status
label.new() βœ…
label.delete() βœ…
label.all πŸ”΅
label.copy() πŸ”΅

Getters

Function Status
label.get_text() βœ…
label.get_x() βœ…
label.get_y() βœ…

Setters

Function Status
label.set_color() βœ…
label.set_size() βœ…
label.set_style() βœ…
label.set_text() βœ…
label.set_textcolor() βœ…
label.set_x() βœ…
label.set_xy() βœ…
label.set_y() βœ…
label.set_point() πŸ”΅
label.set_textalign() πŸ”΅
label.set_tooltip() πŸ”΅
label.set_xloc() πŸ”΅
label.set_yloc() πŸ”΅

Styles

Style Status
label.style_arrowdown βœ…
label.style_arrowup βœ…
label.style_circle βœ…
label.style_cross βœ…
label.style_diamond βœ…
label.style_label_center βœ…
label.style_label_down βœ…
label.style_label_left βœ…
label.style_label_right βœ…
label.style_label_up βœ…
label.style_none βœ…
label.style_square βœ…
label.style_triangledown βœ…
label.style_triangleup βœ…

9. Line

Management

Function Status
line.new() βœ…
line.delete() βœ…
line.all πŸ”΅
line.copy() πŸ”΅

Getters

Function Status
line.get_x1() βœ…
line.get_x2() βœ…
line.get_y1() βœ…
line.get_y2() βœ…
line.get_price() πŸ”΅

Setters

Function Status
line.set_color() βœ…
line.set_extend() βœ…
line.set_style() βœ…
line.set_width() βœ…
line.set_x1() βœ…
line.set_x2() βœ…
line.set_xy1() βœ…
line.set_xy2() βœ…
line.set_y1() βœ…
line.set_y2() βœ…
line.set_xloc() πŸ”΅

Styles

Style Status
line.style_arrow_both βœ…
line.style_arrow_left βœ…
line.style_arrow_right βœ…
line.style_dashed βœ…
line.style_dotted βœ…
line.style_solid βœ…

10. Linefill

All linefill functions are not yet implemented (πŸ”΄).

linefill.new(), linefill.delete(), linefill.set_color(), linefill.get_line1(), linefill.get_line2(), linefill.all


11. Log

All log functions are not yet implemented (πŸ”΄).

log.error(), log.info(), log.warning()


12. Map

All map functions are not yet implemented (πŸ”΄).

map.new<type,type>(), map.get(), map.put(), map.contains(), map.keys(), map.values(), map.size(), map.clear(), map.copy(), map.put_all(), map.remove()


13. Math

Constants

Constant Status
math.e βœ…
math.phi βœ…
math.pi βœ…
math.rphi βœ…

Basic Operations

Function Status
math.abs() βœ…
math.ceil() βœ…
math.floor() βœ…
math.round() βœ…
math.sign() βœ…
math.round_to_mintick() βœ…

Exponential & Logarithmic

Function Status
math.exp() βœ…
math.log() βœ…
math.log10() βœ…
math.pow() βœ…
math.sqrt() βœ…

Statistical

Function Status
math.max() βœ…
math.min() βœ…
math.avg() βœ…
math.sum() βœ…

Trigonometric

Function Status
math.cos() βœ…
math.sin() βœ…
math.tan() βœ…
math.acos() βœ…
math.asin() βœ…
math.atan() βœ…

Utilities

Function Status
math.random() βœ…
math.todegrees() βœ…
math.toradians() βœ…

14. Matrix

All matrix functions (40+) are not yet implemented (πŸ”΄). This includes creation, element access, modification, statistical, operations, linear algebra, properties, and sorting.


15. Plots

Function Status Description
plot() βœ… Plot a series
hline() βœ… Horizontal line
plotchar() βœ… Plot character markers
plotshape() βœ… Plot shape markers
plotarrow() πŸ”΄ Plot arrow markers
plotbar() πŸ”΄ Plot bar chart
plotcandle() πŸ”΄ Plot candlestick chart
barcolor() βœ… Set bar color
bgcolor() βœ… Set background color

16. Request

Function Status Description
request.security() βœ… Multi-timeframe/cross-symbol data (simple OHLCV fields)
request.security_lower_tf() πŸ”΅ Lower timeframe data
request.currency_rate() πŸ”΄ Currency rate
request.splits() πŸ”΄ Splits data

17. String

Query

Function Status
str.contains() βœ…
str.endswith() βœ…
str.length() βœ…
str.match() 🟑 (substring only, no regex)
str.pos() βœ…
str.startswith() βœ…

Formatting

Function Status
str.format() βœ…
str.format_time() βœ…

Transformation

Function Status
str.lower() βœ…
str.repeat() βœ…
str.replace() βœ…
str.replace_all() βœ…
str.trim() βœ…
str.upper() βœ…

Parsing & Conversion

Function Status
str.split() πŸ”΅
str.substring() βœ…
str.tonumber() βœ…
str.tostring() βœ…

18. Strategy

Declaration

Function Status
strategy() βœ…

Order Functions

Function Status Description
strategy.entry() βœ… Submit entry order
strategy.close() βœ… Close by entry ID
strategy.close_all() βœ… Close all positions
strategy.exit() βœ… Set SL/TP exit
strategy.order() βœ… Submit generic order
strategy.cancel() βœ… Cancel pending order
strategy.cancel_all() βœ… Cancel all pending

Properties

Property Status
strategy.position_size βœ…
strategy.position_avg_price βœ…
strategy.equity βœ…
strategy.openprofit βœ…
strategy.netprofit βœ…
strategy.initial_capital βœ…
strategy.closedtrades βœ…
strategy.opentrades βœ…
strategy.wintrades βœ…
strategy.losstrades βœ…
strategy.grossprofit πŸ”΅
strategy.grossloss πŸ”΅
strategy.max_drawdown πŸ”΅

Constants

Constant Status
strategy.long βœ…
strategy.short βœ…

Trade History Functions

All strategy.closedtrades.* and strategy.opentrades.* functions (14 total) are planned (πŸ”΅).


19. Table

Cell Operations

Function Status
table.cell() βœ…
table.cell_set_bgcolor() βœ…
table.cell_set_height() βœ…
table.cell_set_text() βœ…
table.cell_set_text_color() βœ…
table.cell_set_text_halign() βœ…
table.cell_set_text_size() βœ…
table.cell_set_text_valign() βœ…
table.cell_set_tooltip() βœ…
table.cell_set_width() βœ…
table.merge_cells() πŸ”΅

Management

Function Status
table.new() βœ…
table.clear() βœ…
table.delete() βœ…

Settings

Function Status
table.set_bgcolor() βœ…
table.set_border_color() βœ…
table.set_border_width() βœ…
table.set_frame_color() βœ…
table.set_frame_width() βœ…
table.set_position() βœ…

20. Technical Analysis

Moving Averages

Function Status Description
ta.vwap βœ… Volume Weighted Average Price (variable)
ta.alma() βœ… Arnaud Legoux MA
ta.ema() βœ… Exponential Moving Average
ta.hma() βœ… Hull Moving Average
ta.linreg() βœ… Linear Regression
ta.rma() βœ… Rolling Moving Average
ta.sma() βœ… Simple Moving Average
ta.swma() βœ… Symmetrically Weighted MA
ta.vwap() βœ… Volume Weighted Average Price
ta.vwma() βœ… Volume Weighted MA
ta.wma() βœ… Weighted Moving Average

Oscillators & Momentum

Function Status Description
ta.cci() βœ… Commodity Channel Index
ta.change() βœ… Price Change
ta.cmo() βœ… Chande Momentum Oscillator
ta.cog() βœ… Center of Gravity
ta.macd() βœ… MACD
ta.mfi() βœ… Money Flow Index
ta.mom() βœ… Momentum
ta.roc() βœ… Rate of Change
ta.rsi() βœ… Relative Strength Index
ta.stoch() βœ… Stochastic
ta.tsi() βœ… True Strength Index
ta.wpr() βœ… Williams %R

Volatility & Range

Function Status Description
ta.tr βœ… True Range (variable)
ta.atr() βœ… Average True Range
ta.bb() βœ… Bollinger Bands
ta.bbw() βœ… Bollinger Bands Width
ta.dev() βœ… Mean Absolute Deviation
ta.kc() βœ… Keltner Channels
ta.kcw() βœ… Keltner Channels Width
ta.range() βœ… Range
ta.stdev() βœ… Standard Deviation
ta.tr() βœ… True Range (function)
ta.variance() βœ… Variance

Volume Indicators

Function Status Description
ta.accdist βœ… Accumulation/Distribution (variable)
ta.iii βœ… Intraday Intensity Index (variable)
ta.nvi βœ… Negative Volume Index (variable)
ta.obv βœ… On-Balance Volume (variable)
ta.pvi βœ… Positive Volume Index (variable)
ta.pvt βœ… Price-Volume Trend (variable)
ta.wad βœ… Williams Accumulation/Distribution (variable)
ta.wvad βœ… Williams Variable Accumulation/Distribution (variable)

Trend Analysis

Function Status Description
ta.cross() βœ… Cross (either direction)
ta.crossover() βœ… Crossover
ta.crossunder() βœ… Crossunder
ta.dmi() βœ… Directional Movement Index
ta.falling() βœ… Falling Detection
ta.rising() βœ… Rising Detection
ta.sar() βœ… Parabolic SAR
ta.supertrend() βœ… SuperTrend

Statistical

Function Status Description
ta.correlation() βœ… Correlation Coefficient
ta.highest() βœ… Highest Value
ta.highestbars() βœ… Bars Since Highest
ta.lowest() βœ… Lowest Value
ta.lowestbars() βœ… Bars Since Lowest
ta.max() βœ… Maximum Value
ta.median() βœ… Median Value
ta.min() βœ… Minimum Value
ta.mode() βœ… Mode Value
ta.percentile_linear_interpolation() βœ… Percentile (Linear)
ta.percentile_nearest_rank() βœ… Percentile (Nearest Rank)
ta.percentrank() βœ… Percentile Rank

Utility

Function Status Description
ta.barssince() βœ… Bars Since Condition
ta.cum() βœ… Cumulative Sum
ta.rci() βœ… Rank Correlation Index
ta.valuewhen() βœ… Value When Condition Met

Support & Resistance

Function Status Description
ta.pivothigh() βœ… Pivot High
ta.pivotlow() βœ… Pivot Low
ta.pivot_point_levels() βœ… Pivot Point Levels

21. Timeframe

Type Checks

Property Status
timeframe.isdaily βœ…
timeframe.isdwm βœ…
timeframe.isintraday βœ…
timeframe.isminutes βœ…
timeframe.ismonthly βœ…
timeframe.isseconds βœ…
timeframe.isticks βœ…
timeframe.isweekly βœ…

Properties

Property Status
timeframe.main_period πŸ”΄
timeframe.multiplier βœ…
timeframe.period βœ…

Functions

Function Status
timeframe.change() βœ…
timeframe.from_seconds() πŸ”΄
timeframe.in_seconds() βœ…

22. Syminfo

Property Status
syminfo.tickerid βœ…
syminfo.ticker βœ…
syminfo.mintick βœ…
syminfo.pointvalue βœ…
syminfo.currency βœ…
syminfo.basecurrency βœ…
syminfo.description βœ…
syminfo.type βœ…
syminfo.timezone βœ…
syminfo.session βœ…
syminfo.volumetype βœ…

23. User-Defined Types

Feature Status
type declaration βœ…
TypeName.new() βœ…
Field access obj.field βœ…
Field assignment := βœ…
var persistence βœ…
na handling βœ…
obj.copy() βœ…
Method calls βœ…
array<UDT> fields πŸ”΅

24. User-Defined Functions

Feature Status
Single-line f(x) => expr βœ…
Multi-line block body βœ…
Default parameters βœ…
Named arguments βœ…
Nested function calls βœ…
var/varip in functions βœ…
Recursion guard (max 50) βœ…
method keyword βœ…
export keyword βœ… (skipped, no library support)

25. Operators

Operator Status
+ - * / % βœ…
== != > < >= <= βœ…
and or not βœ…
= := += -= *= /= βœ…
[] (series access) βœ…

26. Constants & Types

Barmerge

Constant Status
barmerge.gaps_off βœ…
barmerge.gaps_on βœ…
barmerge.lookahead_off βœ…
barmerge.lookahead_on βœ…

Extend

Constant Status
extend.both βœ…
extend.left βœ…
extend.none βœ…
extend.right βœ…

Position

Constant Status
position.bottom_center βœ…
position.bottom_left βœ…
position.bottom_right βœ…
position.middle_center βœ…
position.middle_left βœ…
position.middle_right βœ…
position.top_center βœ…
position.top_left βœ…
position.top_right βœ…

Size

Constant Status
size.auto βœ…
size.huge βœ…
size.large βœ…
size.normal βœ…
size.small βœ…
size.tiny βœ…

Hline Styles

Constant Status
hline.style_dashed βœ…
hline.style_dotted βœ…
hline.style_solid βœ…

Text Alignment

Constant Status
text.align_center βœ…
text.align_left βœ…
text.align_right βœ…

Categories Not Yet Started

The following categories are entirely not yet implemented (πŸ”΄):

  • Chart β€” chart.* (properties, type detection, visible range, chart points)
  • Session β€” session.* (flags, constants)
  • Polyline β€” polyline.*
  • Log β€” log.*
  • Map β€” map.*
  • Matrix β€” matrix.*
  • Runtime β€” runtime.error()
  • Display constants β€” display.*
  • Format constants β€” format.*
  • Location constants β€” location.*
  • Scale constants β€” scale.*
  • Shape constants β€” shape.*

© 2026 PineChart. All rights reserved.

This site uses Just the Docs, a documentation theme for Jekyll.