Documentation

Documentation

4. Language Reference

Created
Jun 16, 2026
Updated
Jun 16, 2026

This page lists what is supported in Pine Script v6 as it runs in Fractal Chart. Coverage is ~96% of the official Pine v6 reference manual — see Limitations for the gaps.

Language features

FeatureSupported
//@version=5 and //@version=6
Variables, var, varip✅ — var persists across bars; varip is not rolled back on realtime bars
All operators (+, -, *, /, %, ? :, and/or/not, [] history, comparisons)
if / else if / else (as statement and expression)
for, for...in, while, switch
break, continue
User-defined functions
User-defined types (type) with .new()
method (extending built-in and user types)
enum and input.enum
Tuples and destructuring ([a, b] = f())
History x[n] on any variable or built-in series
na, na(), nz(), fixnan()
array<T>, matrix<T>, map<K,V> collections

Built-in namespaces

ta.* — technical analysis

All major functions are supported: sma, ema, rma, wma, hma, vwma, alma, vwap (session-anchored), rsi, macd, bb, kc, atr, tr, stoch, cci, dmi, supertrend, sar, linreg, crossover, crossunder, cross, highest, lowest, barssince, valuewhen, pivothigh, pivotlow, pivot_point_levels, and all volume oscillators (obv, accdist, pvt, etc.).

Full list: sma ema rma wma vwma swma hma alma vwap · rsi tsi ao mom roc cci cmo cog wpr mfi macd stoch rci · bb bbw kc kcw supertrend dmi sar linreg · tr atr stdev dev variance · highest lowest highestbars lowestbars crossover crossunder cross max min · cum sum barssince valuewhen rising falling change · correlation median mode percentrank percentile_nearest_rank percentile_linear_interpolation · obv accdist pvt iii wvad wad nvi pvi · pivothigh pivotlow pivot_point_levels

math.*

max min abs round round_to_mintick pow sqrt sign avg log log10 exp floor ceil sum sin cos tan asin acos atan atan2 todegrees toradians random gcd factorial · constants pi e phi rphi

str.*

tostring length contains format split replace replace_all substring upper lower startswith endswith pos trim repeat match tonumber format_time

Number format patterns in str.format and str.tostring are supported ("#.##", "0.00", "integer", "percent", "currency").

color.*

color.new color.rgb color.r color.g color.b color.t color.from_gradient · all named constants including the v6 palette (red, green, blue, orange, purple, yellow, white, black, gray, silver, lime, maroon, navy, olive, teal, aqua, fuchsia)

array.*

Full support: constructors, push/pop/shift/unshift/get/set/insert/remove/clear/fill/reverse/sort, first/last/size/slice/copy/concat/join/includes/indexof/binary_search, statistical functions (sum/avg/min/max/median/mode/stdev/variance/covariance/standardize/percentrank/percentile_*), and every/some.

matrix.*

Full support including add_row/add_col, transpose, inv, det, trace, mult, kron, reshape, submatrix, eigenvalues, eigenvectors, pinv, and all is_* predicates.

map.*

Full support: new, put, get, contains, remove, keys, values, size, clear, copy, put_all.

input.*

All input types — see the inputs table in Writing Indicators.

request.*

FunctionSupport
request.security(sym, tf, expr)✅ — same-symbol HTF resampling and cross-symbol
request.security_lower_tf(sym, tf, expr)✅ — returns arrays of intrabar values
request.dividends/earnings/splits/financial/economic/…❌ — no fundamental data feed; returns na

strategy.*

Full broker simulation — see Writing Strategies. Includes entries, exits, stop/limit/trailing orders, pyramiding, per-trade introspection (strategy.closedtrades.*), and performance variables.

syminfo.*, timeframe.*, barstate.*, chart.*

All core fields are supported: syminfo.tickerid, syminfo.mintick, syminfo.currency, timeframe.period, timeframe.in_seconds, barstate.isfirst/islast/isconfirmed/ishistory, chart.is_standard, and more.

alert, alertcondition, log.*

alert(msg, freq), alertcondition(cond, title, msg), log.info/warning/error — all supported and wired into Fractal's alert system.

Visual constants

All style constants are available: plot.style_*, shape.*, location.*, hline.style_*, position.*, size.*, text.align_*, xloc.*, yloc.*, extend.*, line.style_*, label.style_*, display.*, scale.*, barmerge.*, order.*, strategy.direction.*, strategy.commission.*, and all color.* named constants.

Next steps

Next: Limitations