# AlertaScript > Official AlertaChart scripting documentation. Documented Pine-compatible spellings run without warnings. The documentation uses the alerta. presentation prefix. Source code supplied to the editor is not automatically rewritten. Review examples and run them explicitly. ## Guides - [AlertaScript](https://www.alertachart.com/alertascript): Turn chart data into indicators, strategies and alerts. - [Getting started](https://www.alertachart.com/alertascript/getting-started): Your path from an empty editor to a useful script. - [Quick start](https://www.alertachart.com/alertascript/getting-started/quick-start): Plot a configurable EMA in five lines. - [Editor tour](https://www.alertachart.com/alertascript/getting-started/editor-tour): Write, run, save and inspect your script. - [Your first indicator](https://www.alertachart.com/alertascript/getting-started/first-indicator): Create an RSI with editable inputs and reference levels. - [Your first strategy](https://www.alertachart.com/alertascript/getting-started/first-strategy): Turn an EMA crossover into a testable trading rule. - [Your first alert](https://www.alertachart.com/alertascript/getting-started/first-alert): Expose a named condition in the alert workflow. - [Language guide](https://www.alertachart.com/alertascript/language): Understand the building blocks behind chart scripts. - [Syntax and types](https://www.alertachart.com/alertascript/language/syntax-and-types): Declare values, pass arguments and keep types explicit. - [Series and history](https://www.alertachart.com/alertascript/language/series-and-history): Read the current bar and earlier values safely. - [Control flow](https://www.alertachart.com/alertascript/language/control-flow): Express conditions and bounded repetition. - [Functions](https://www.alertachart.com/alertascript/language/functions): Extract a calculation without hiding its inputs. - [User-defined types and methods](https://www.alertachart.com/alertascript/language/user-defined-types-and-methods): Group related values and attach meaningful operations. - [Arrays](https://www.alertachart.com/alertascript/language/arrays): Manage an ordered collection with explicit bounds. - [Maps](https://www.alertachart.com/alertascript/language/maps): Look up values by named keys. - [Matrices](https://www.alertachart.com/alertascript/language/matrices): Represent and access rectangular numeric data. - [Strings](https://www.alertachart.com/alertascript/language/strings): Format clear labels and messages. - [Colors](https://www.alertachart.com/alertascript/language/colors): Separate a visual rule from its calculation. - [Time and sessions](https://www.alertachart.com/alertascript/language/time-and-sessions): Interpret bar time in the correct market context. - [Execution model](https://www.alertachart.com/alertascript/language/execution-model): Know what can change before the bar closes. - [Guides](https://www.alertachart.com/alertascript/guides): Connect language features into practical workflows. - [Drawings and visuals](https://www.alertachart.com/alertascript/guides/drawing-and-visuals): Choose between series plots and positioned objects. - [Strategies and backtesting](https://www.alertachart.com/alertascript/guides/strategies-and-backtesting): Interpret simulated orders and exits correctly. - [Multiple symbols and timeframes](https://www.alertachart.com/alertascript/guides/multi-symbol-and-timeframe): Evaluate an expression in another data context. - [Order flow data](https://www.alertachart.com/alertascript/guides/order-flow-data): Use available trade-level information deliberately. - [Alerts](https://www.alertachart.com/alertascript/guides/alerts): Separate the signal, its timing and its message. - [Pine compatibility and migration](https://www.alertachart.com/alertascript/guides/pine-migration): Move a Pine-style script to AlertaScript: what runs as written, what returns na, and three tested examples. - [Quick reference](https://www.alertachart.com/alertascript/reference): Find signatures, constants, variables and examples. - [Frequently asked questions](https://www.alertachart.com/alertascript/faq): Answers to common script authoring questions. - [Limits and availability](https://www.alertachart.com/alertascript/faq/limitations): Know the boundaries that affect a script result. - [Troubleshooting](https://www.alertachart.com/alertascript/faq/troubleshooting): Reduce an error to a small, inspectable case. - [Write with AI](https://www.alertachart.com/alertascript/ai-writing): Ask for a script that can be checked, not just generated. ## API reference ### alerta.ta.barssince https://www.alertachart.com/alertascript/reference/builtins/ta.barssince Signature: ta.barssince(condition) Counts the number of bars since the condition was true. TradingView-compatible spelling: ta.barssince; runs without warnings. ### alerta.ta.cum https://www.alertachart.com/alertascript/reference/builtins/ta.cum Signature: ta.cum(source) Calculates the cumulative sum of source. TradingView-compatible spelling: ta.cum; runs without warnings. ### alerta.ta.sma https://www.alertachart.com/alertascript/reference/builtins/sma Signature: sma(source, length) Calculates the simple moving average over an N-bar period. TradingView-compatible spelling: ta.sma; runs without warnings. ### alerta.ta.ema https://www.alertachart.com/alertascript/reference/builtins/ema Signature: ema(source, length) Calculates the exponential moving average, assigning more weight to recent prices. TradingView-compatible spelling: ta.ema; runs without warnings. ### alerta.ta.wma https://www.alertachart.com/alertascript/reference/builtins/wma Signature: wma(source, length) Calculates the weighted moving average. TradingView-compatible spelling: ta.wma; runs without warnings. ### alerta.ta.vwma https://www.alertachart.com/alertascript/reference/builtins/vwma Signature: vwma(source, length) Returns the volume-weighted moving average of source for length bars. TradingView-compatible spelling: ta.vwma; runs without warnings. ### alerta.ta.rma https://www.alertachart.com/alertascript/reference/builtins/rma Signature: rma(source, length) Wilder's smoothing average (Relative Moving Average), the smoothing RSI and ATR are defined with. It follows Pine's recurrence: the first value is the simple average of the first length values, then alpha * source + (1 - alpha) * previous with alpha = 1 / length. TradingView-compatible spelling: ta.rma; runs without warnings. ### alerta.ta.macd https://www.alertachart.com/alertascript/reference/builtins/macd Signature: macd(source, fast, slow, signal) Returns MACD line, Signal line and Histogram. TradingView-compatible spelling: ta.macd; runs without warnings. ### alerta.ta.rsi https://www.alertachart.com/alertascript/reference/builtins/rsi Signature: rsi(source, length) Calculates the RSI, an oscillator measuring the speed and change of price movements. TradingView-compatible spelling: ta.rsi; runs without warnings. ### alerta.ta.roc https://www.alertachart.com/alertascript/reference/builtins/roc Signature: roc(source, length) Calculates the Rate of Change (percent) over an N-bar period. TradingView-compatible spelling: ta.roc; runs without warnings. ### alerta.ta.mom https://www.alertachart.com/alertascript/reference/builtins/mom Signature: mom(source, length) Calculates the momentum (difference) over an N-bar period. TradingView-compatible spelling: ta.mom; runs without warnings. ### alerta.ta.kst https://www.alertachart.com/alertascript/reference/builtins/kst Signature: kst(source, roc1, roc2, roc3, roc4, sma1, sma2, sma3, sma4) Weighted momentum oscillator built from four smoothed ROC components. TradingView-compatible spelling: ta.kst; runs without warnings. ### alerta.ta.specialK https://www.alertachart.com/alertascript/reference/builtins/ta.specialk Signature: ta.specialK(source, length1, length2) Martin J. Pring's Special K: twelve simple averages of rates of change, from a 10-bar to a 530-bar ROC, weighted 1-2-3-4 within the short, medium and long groups and summed, with a signal line that is a simple average of a simple average of it. Needs about 725 bars of history before its first value. TradingView-compatible spelling: ta.specialK; runs without warnings. ### alerta.ta.tr https://www.alertachart.com/alertascript/reference/builtins/tr Signature: ta.tr(handle_na = false) or tr(high, low, close) Calculates the True Range for each bar. Pine v6 form is `ta.tr(handle_na)` operating on chart H/L/C; a legacy 3-arg form accepting custom series is also supported. TradingView-compatible spelling: ta.tr; runs without warnings. ### alerta.ta.cmo https://www.alertachart.com/alertascript/reference/builtins/cmo Signature: cmo(source, length) Calculates the Chande Momentum Oscillator over an N-bar period. TradingView-compatible spelling: ta.cmo; runs without warnings. ### alerta.ta.stochrsi https://www.alertachart.com/alertascript/reference/builtins/stochrsi Signature: stochrsi(source, length, rsiLength, k, d) Calculates the Stochastic RSI oscillator. TradingView-compatible spelling: ta.stochrsi; runs without warnings. ### alerta.ta.tsi https://www.alertachart.com/alertascript/reference/builtins/tsi Signature: ta.tsi(source, short_length, long_length) or tsi(source, longLength, shortLength) Calculates the True Strength Index. Pine form `ta.tsi(source, short_length, long_length)`: EMA(EMA(change, long), short) / EMA(EMA(|change|, long), short), a ratio in [-1, 1]. The legacy bare form `tsi(source, longLength, shortLength)` (also `alerta.tsi`) takes the long length first and returns the same index times 100. TradingView-compatible spelling: ta.tsi; runs without warnings. ### alerta.ta.pvo https://www.alertachart.com/alertascript/reference/builtins/pvo Signature: pvo(source, fastLength, slowLength, signalLength) Calculates the Percentage Volume Oscillator (volume MACD). TradingView-compatible spelling: ta.pvo; runs without warnings. ### alerta.ta.rvi https://www.alertachart.com/alertascript/reference/builtins/rvi Signature: rvi(open, high, low, close, length) Calculates the Relative Vigor Index and signal line. TradingView-compatible spelling: ta.rvi; runs without warnings. ### alerta.ta.fisher https://www.alertachart.com/alertascript/reference/builtins/fisher Signature: fisher(source, length) Applies the Fisher Transform to a source series. TradingView-compatible spelling: ta.fisher; runs without warnings. ### alerta.ta.cfo https://www.alertachart.com/alertascript/reference/builtins/cfo Signature: cfo(source, length) Calculates the Chande Forecast Oscillator. TradingView-compatible spelling: ta.cfo; runs without warnings. ### alerta.ta.stc https://www.alertachart.com/alertascript/reference/builtins/stc Signature: stc(source, fastLength, slowLength, cycleLength) Calculates the Schaff Trend Cycle oscillator. TradingView-compatible spelling: ta.stc; runs without warnings. ### alerta.ta.adxr https://www.alertachart.com/alertascript/reference/builtins/adxr Signature: adxr(high, low, close, length) Calculates the ADXR by averaging current ADX with ADX from length bars ago. TradingView-compatible spelling: ta.adxr; runs without warnings. ### alerta.ta.atrp https://www.alertachart.com/alertascript/reference/builtins/atrp Signature: atrp(high, low, close, length) Calculates ATR as a percentage of price. TradingView-compatible spelling: ta.atrp; runs without warnings. ### alerta.ta.chaikin https://www.alertachart.com/alertascript/reference/builtins/chaikin Signature: chaikin(high, low, close, volume, fastLength, slowLength) Calculates the Chaikin Oscillator from ADL. TradingView-compatible spelling: ta.chaikin; runs without warnings. ### alerta.ta.cvi https://www.alertachart.com/alertascript/reference/builtins/cvi Signature: cvi(high, low, emaLength, rocLength) Measures volatility as percent change of EMA(high-low) over a lookback. TradingView-compatible spelling: ta.cvi; runs without warnings. ### alerta.ta.adosc https://www.alertachart.com/alertascript/reference/builtins/adosc Signature: adosc(high, low, close, volume, fastLength, slowLength) Calculates the Accumulation/Distribution Oscillator (Chaikin). TradingView-compatible spelling: ta.adosc; runs without warnings. ### alerta.ta.vi https://www.alertachart.com/alertascript/reference/builtins/vi Signature: vi(high, low, close, length) Calculates Vortex Indicator positive/negative lines. TradingView-compatible spelling: ta.vi; runs without warnings. ### alerta.ta.trix https://www.alertachart.com/alertascript/reference/builtins/trix Signature: trix(source, length) Calculates the percent rate of change of a triple-smoothed EMA. TradingView-compatible spelling: ta.trix; runs without warnings. ### alerta.ta.willr https://www.alertachart.com/alertascript/reference/builtins/williamsr Signature: williamsr(high, low, close, length) Measures overbought/oversold levels using the high/low range. TradingView-compatible spelling: ta.willr; runs without warnings. ### alerta.ta.ultosc https://www.alertachart.com/alertascript/reference/builtins/ultosc Signature: ultosc(high, low, close, length1, length2, length3) Calculates the Ultimate Oscillator using three timeframes. TradingView-compatible spelling: ta.ultosc; runs without warnings. ### alerta.ta.natr https://www.alertachart.com/alertascript/reference/builtins/natr Signature: natr(high, low, close, length) Calculates ATR normalized by price (percent). TradingView-compatible spelling: ta.natr; runs without warnings. ### alerta.ta.adx https://www.alertachart.com/alertascript/reference/builtins/adx Signature: adx(high, low, close, length) Measures trend strength using the Average Directional Index. TradingView-compatible spelling: ta.adx; runs without warnings. ### alerta.ta.dmi https://www.alertachart.com/alertascript/reference/builtins/dmi Signature: dmi(diLength, adxSmoothing) or dmi(high, low, close, length) Returns DI+ / DI- and ADX. Pine's form is ta.dmi(diLength, adxSmoothing), which smooths DI and ADX by DIFFERENT lengths and reads the chart's own high/low/close; the 4-argument form is kept for older scripts. TradingView-compatible spelling: ta.dmi; runs without warnings. ### alerta.ta.aroon https://www.alertachart.com/alertascript/reference/builtins/aroon Signature: aroon(high, low, length) Returns Aroon Up and Aroon Down values. TradingView-compatible spelling: ta.aroon; runs without warnings. ### alerta.ta.hma https://www.alertachart.com/alertascript/reference/builtins/hma Signature: hma(source, length) Calculates the Hull Moving Average. TradingView-compatible spelling: ta.hma; runs without warnings. ### alerta.ta.alma https://www.alertachart.com/alertascript/reference/builtins/alma Signature: alma(source, length, offset, sigma, floor) Calculates the Arnaud Legoux Moving Average. TradingView-compatible spelling: ta.alma; runs without warnings. ### alerta.ta.dema https://www.alertachart.com/alertascript/reference/builtins/dema Signature: dema(source, length) Calculates the Double Exponential Moving Average. TradingView-compatible spelling: ta.dema; runs without warnings. ### alerta.ta.tema https://www.alertachart.com/alertascript/reference/builtins/tema Signature: tema(source, length) Calculates the Triple Exponential Moving Average. TradingView-compatible spelling: ta.tema; runs without warnings. ### alerta.ta.trima https://www.alertachart.com/alertascript/reference/builtins/trima Signature: trima(source, length) Calculates the Triangular Moving Average. TradingView-compatible spelling: ta.trima; runs without warnings. ### alerta.ta.kama https://www.alertachart.com/alertascript/reference/builtins/kama Signature: kama(source, length, fast, slow) Calculates the Kaufman Adaptive Moving Average. TradingView-compatible spelling: ta.kama; runs without warnings. ### alerta.ta.linreg https://www.alertachart.com/alertascript/reference/builtins/linreg Signature: linreg(source, length, offset) Calculates the Linear Regression value over an N-bar window. TradingView-compatible spelling: ta.linreg; runs without warnings. ### alerta.ta.t3 https://www.alertachart.com/alertascript/reference/builtins/t3 Signature: t3(source, length, vfactor) Calculates the Tillson T3 moving average. TradingView-compatible spelling: ta.t3; runs without warnings. ### alerta.ta.zlema https://www.alertachart.com/alertascript/reference/builtins/zlema Signature: zlema(source, length) Calculates the Zero Lag Exponential Moving Average. TradingView-compatible spelling: ta.zlema; runs without warnings. ### alerta.ta.smma https://www.alertachart.com/alertascript/reference/builtins/smma Signature: smma(source, length) Calculates the Smoothed Moving Average. TradingView-compatible spelling: ta.smma; runs without warnings. ### alerta.ta.atr https://www.alertachart.com/alertascript/reference/builtins/atr Signature: atr(length) Calculates the Average True Range, a measure of market volatility. TradingView-compatible spelling: ta.atr; runs without warnings. ### alerta.ta.bb https://www.alertachart.com/alertascript/reference/builtins/bbands Signature: bbands(source, length, mult) Bollinger Bands: a simple moving average of source (the middle band) and the bands mult standard deviations above and below it. Returns the tuple [middle, upper, lower], as Pine's ta.bb does; ta.bbands and bbands are the same function. TradingView-compatible spelling: ta.bb; runs without warnings. ### alerta.ta.stdev https://www.alertachart.com/alertascript/reference/builtins/stdev Signature: stdev(source, length, biased = true) Calculates standard deviation of source over length bars. Pine v6 third argument `biased` selects the biased (Bessel-corrected off) or unbiased estimator; defaults to true. TradingView-compatible spelling: ta.stdev; runs without warnings. ### alerta.ta.highest https://www.alertachart.com/alertascript/reference/builtins/highest Signature: highest(source, length) Returns the highest value of source for length bars back. TradingView-compatible spelling: ta.highest; runs without warnings. ### alerta.ta.highestbars https://www.alertachart.com/alertascript/reference/builtins/highestbars Signature: highestbars(source, length) Returns the offset to the highest value of source over the last length bars, as Pine does: 0 on the current bar, negative before it (-3 = three bars ago). With a single argument — highestbars(length) — the source is high. TradingView-compatible spelling: ta.highestbars; runs without warnings. ### alerta.ta.lowest https://www.alertachart.com/alertascript/reference/builtins/lowest Signature: lowest(source, length) Returns the lowest value of source for length bars back. TradingView-compatible spelling: ta.lowest; runs without warnings. ### alerta.ta.lowestbars https://www.alertachart.com/alertascript/reference/builtins/lowestbars Signature: lowestbars(source, length) Returns the offset to the lowest value of source over the last length bars, as Pine does: 0 on the current bar, negative before it (-3 = three bars ago). With a single argument — lowestbars(length) — the source is low. TradingView-compatible spelling: ta.lowestbars; runs without warnings. ### alerta.highestindex https://www.alertachart.com/alertascript/reference/builtins/highestindex Signature: highestindex(source, length) Returns the absolute index of the highest value of source for length bars. ### alerta.lowestindex https://www.alertachart.com/alertascript/reference/builtins/lowestindex Signature: lowestindex(source, length) Returns the absolute index of the lowest value of source for length bars. ### alerta.ta.crossover https://www.alertachart.com/alertascript/reference/builtins/crossover Signature: crossover(a, b) Returns true if `a` crossed above `b`. TradingView-compatible spelling: ta.crossover; runs without warnings. ### alerta.ta.crossunder https://www.alertachart.com/alertascript/reference/builtins/crossunder Signature: crossunder(a, b) Returns true if `a` crossed below `b`. TradingView-compatible spelling: ta.crossunder; runs without warnings. ### alerta.ta.cross https://www.alertachart.com/alertascript/reference/builtins/ta.cross Signature: ta.cross(a, b) Returns true when `a` crosses `b` in either direction. TradingView-compatible spelling: ta.cross; runs without warnings. ### alerta.ta.rising https://www.alertachart.com/alertascript/reference/builtins/ta.rising Signature: ta.rising(source, length) Returns true when source is greater than all previous values in the lookback window. TradingView-compatible spelling: ta.rising; runs without warnings. ### alerta.ta.falling https://www.alertachart.com/alertascript/reference/builtins/ta.falling Signature: ta.falling(source, length) Returns true when source is lower than all previous values in the lookback window. TradingView-compatible spelling: ta.falling; runs without warnings. ### alerta.ta.range https://www.alertachart.com/alertascript/reference/builtins/ta.range Signature: ta.range(source, length) Returns max(source, length) - min(source, length). TradingView-compatible spelling: ta.range; runs without warnings. ### alerta.ta.swma https://www.alertachart.com/alertascript/reference/builtins/ta.swma Signature: ta.swma(source) 4-period symmetric weighted moving average with weights [1, 2, 2, 1] / 6. TradingView-compatible spelling: ta.swma; runs without warnings. ### alerta.ta.dev https://www.alertachart.com/alertascript/reference/builtins/ta.dev Signature: ta.dev(source, length) Returns average absolute deviation from the moving mean over length bars. TradingView-compatible spelling: ta.dev; runs without warnings. ### alerta.ta.variance https://www.alertachart.com/alertascript/reference/builtins/ta.variance Signature: ta.variance(source, length, biased) Returns rolling variance. `biased=true` computes population variance, `false` uses sample variance. TradingView-compatible spelling: ta.variance; runs without warnings. ### alerta.ta.percentrank https://www.alertachart.com/alertascript/reference/builtins/ta.percentrank Signature: ta.percentrank(source, length) Returns the percentile rank (0..100) of the current value inside the rolling window. TradingView-compatible spelling: ta.percentrank; runs without warnings. ### alerta.ta.percentile_nearest_rank https://www.alertachart.com/alertascript/reference/builtins/ta.percentile_nearest_rank Signature: ta.percentile_nearest_rank(source, length, percentage) Returns rolling percentile using nearest-rank method. TradingView-compatible spelling: ta.percentile_nearest_rank; runs without warnings. ### alerta.ta.percentile_linear_interpolation https://www.alertachart.com/alertascript/reference/builtins/ta.percentile_linear_interpolation Signature: ta.percentile_linear_interpolation(source, length, percentage) Returns rolling percentile using linear interpolation between nearest ranks. TradingView-compatible spelling: ta.percentile_linear_interpolation; runs without warnings. ### alerta.ta.kc https://www.alertachart.com/alertascript/reference/builtins/ta.kc Signature: ta.kc(source, length, mult, useTrueRange) Returns Keltner Channel basis, upper and lower bands. TradingView-compatible spelling: ta.kc; runs without warnings. ### alerta.ta.kcw https://www.alertachart.com/alertascript/reference/builtins/ta.kcw Signature: ta.kcw(source, length, mult, useTrueRange) Returns channel width as `(upper - lower) / basis`. TradingView-compatible spelling: ta.kcw; runs without warnings. ### alerta.ta.bbw https://www.alertachart.com/alertascript/reference/builtins/ta.bbw Signature: ta.bbw(source, length, mult) Returns Bollinger width as `(upper - lower) / basis`. TradingView-compatible spelling: ta.bbw; runs without warnings. ### alerta.ta.cog https://www.alertachart.com/alertascript/reference/builtins/ta.cog Signature: ta.cog(source, length) Computes Center of Gravity oscillator over the lookback window. TradingView-compatible spelling: ta.cog; runs without warnings. ### alerta.ta.correlation https://www.alertachart.com/alertascript/reference/builtins/ta.correlation Signature: ta.correlation(sourceA, sourceB, length) Rolling Pearson correlation between two series. TradingView-compatible spelling: ta.correlation; runs without warnings. ### alerta.ta.max https://www.alertachart.com/alertascript/reference/builtins/ta.max Signature: ta.max → series float Pine v6 built-in VARIABLE (no parentheses): the running all-time high — the maximum of `high` from the first bar up to the current bar. TradingView-compatible spelling: ta.max; runs without warnings. ### alerta.ta.min https://www.alertachart.com/alertascript/reference/builtins/ta.min Signature: ta.min → series float Pine v6 built-in VARIABLE (no parentheses): the running all-time low — the minimum of `low` from the first bar up to the current bar. TradingView-compatible spelling: ta.min; runs without warnings. ### alerta.ta.median https://www.alertachart.com/alertascript/reference/builtins/ta.median Signature: ta.median(source, length) Returns rolling median of source values over length bars. TradingView-compatible spelling: ta.median; runs without warnings. ### alerta.ta.mode https://www.alertachart.com/alertascript/reference/builtins/ta.mode Signature: ta.mode(source, length) Returns most frequent value in the rolling window. TradingView-compatible spelling: ta.mode; runs without warnings. ### alerta.alert https://www.alertachart.com/alertascript/reference/builtins/alert Signature: alert(message, freq) Triggers an alert event when executed. freq controls dispatch cadence: once_per_bar (default), once_per_bar_close (held until the bar closes), all (every tick). Message supports {{placeholders}}: ticker, exchange, interval, time, OHLCV, plot_N, plot("Title"), syminfo.*, strategy.order.id/action/contracts/price/comment/alert_message, strategy.market_position(_size), strategy.prev_market_position(_size). TradingView-compatible spelling: alert; runs without warnings. ### alerta.alertcondition https://www.alertachart.com/alertascript/reference/builtins/alertcondition Signature: alertcondition(condition, title, message) Registers a named, selectable alert condition (listed by title in the alert UI) and fires it when the condition is true on the current bar. Message supports the same {{placeholder}} set as alert(). TradingView-compatible spelling: alertcondition; runs without warnings. ### alerta.input.source https://www.alertachart.com/alertascript/reference/builtins/input.source Signature: input.source(defval, title) Creates a source selector input: the series chosen in the script's settings is the series the script reads. TradingView-compatible spelling: input.source; runs without warnings. ### alerta.input.timeframe https://www.alertachart.com/alertascript/reference/builtins/input.timeframe Signature: input.timeframe(defval, title) Creates a timeframe input suitable for request.security. TradingView-compatible spelling: input.timeframe; runs without warnings. ### alerta.input.symbol https://www.alertachart.com/alertascript/reference/builtins/input.symbol Signature: input.symbol(defval, title) Creates a symbol input suitable for request.security. TradingView-compatible spelling: input.symbol; runs without warnings. ### alerta.input.time https://www.alertachart.com/alertascript/reference/builtins/input.time Signature: input.time(defval, title) Creates a timestamp input (epoch milliseconds). TradingView-compatible spelling: input.time; runs without warnings. ### alerta.input.session https://www.alertachart.com/alertascript/reference/builtins/input.session Signature: input.session(defval, title) Creates a session string input (HHMM-HHMM[:days]). TradingView-compatible spelling: input.session; runs without warnings. ### alerta.input.int https://www.alertachart.com/alertascript/reference/builtins/input.int Signature: input.int(defval, title, options) Creates an integer input in the script's settings. Pine's named arguments are accepted: minval, maxval and step set the range the settings allow, options (a list of allowed values) offers only those values, and tooltip, inline and group arrange the input in the settings. The older `{ min, max, step }` object as the third argument is accepted too. TradingView-compatible spelling: input.int; runs without warnings. ### alerta.input.float https://www.alertachart.com/alertascript/reference/builtins/input.float Signature: input.float(defval, title, options) Creates a decimal-number input in the script's settings. Pine's named arguments are accepted: minval, maxval and step set the range the settings allow, options (a list of allowed values) offers only those values, and tooltip, inline and group arrange the input in the settings. The older `{ min, max, step }` object as the third argument is accepted too. TradingView-compatible spelling: input.float; runs without warnings. ### alerta.input.bool https://www.alertachart.com/alertascript/reference/builtins/input.bool Signature: input.bool(defval, title) Creates a boolean (checkbox) input parameter. TradingView-compatible spelling: input.bool; runs without warnings. ### alerta.input.string https://www.alertachart.com/alertascript/reference/builtins/input.string Signature: input.string(defval, title) Creates a string input parameter. TradingView-compatible spelling: input.string; runs without warnings. ### alerta.input.color https://www.alertachart.com/alertascript/reference/builtins/input.color Signature: input.color(defval, title) Creates a color picker input parameter. TradingView-compatible spelling: input.color; runs without warnings. ### alerta.input.price https://www.alertachart.com/alertascript/reference/builtins/input.price Signature: input.price(defval, title, options) Creates a price-like numeric input parameter. TradingView-compatible spelling: input.price; runs without warnings. ### alerta.input.text_area https://www.alertachart.com/alertascript/reference/builtins/input.text_area Signature: input.text_area(defval, title) Creates a multiline text input parameter. TradingView-compatible spelling: input.text_area; runs without warnings. ### alerta.input.enum https://www.alertachart.com/alertascript/reference/builtins/input.enum Signature: input.enum(defval, title, options?) Creates a dropdown input from a user-declared enum. Returns the selected enum MEMBER (not its title string), so it compares directly against EnumName.member. Member titles are what the user sees in the settings dialog. TradingView-compatible spelling: input.enum; runs without warnings. ### alerta.time https://www.alertachart.com/alertascript/reference/builtins/time Signature: time() or time(timeframe, session?, timezone?, bars_back?, timeframe_bars_back?) Returns bar open timestamps (epoch milliseconds). Also usable as a bare built-in variable (no parens). The Pine v6 overload `time(timeframe, session?, timezone?, bars_back?, timeframe_bars_back?)` is accepted; when a session is supplied the value is the bar time inside the session window (in the given timezone) and `na` outside. TradingView-compatible spelling: time; runs without warnings. ### alerta.time_close https://www.alertachart.com/alertascript/reference/builtins/time_close Signature: time_close() or time_close(timeframe, session?, timezone?, bars_back?, timeframe_bars_back?) Returns the bar's close time (epoch milliseconds): open + timeframe, calendar months for monthly bars, and the session close for a stock's daily bar. Also usable as a bare built-in variable. Takes the same optional arguments as `time`: with a timeframe, `time_close("D")` is the close of the higher-timeframe bar the current bar belongs to; with a session, the value is the close time inside the session window and `na` outside. TradingView-compatible spelling: time_close; runs without warnings. ### alerta.timestamp https://www.alertachart.com/alertascript/reference/builtins/timestamp Signature: timestamp(year, month, day, hour, minute, second) | timestamp(timezone, year, month, day, …) | timestamp(dateString) Builds a timestamp (milliseconds since the Unix epoch). Three forms: from date/time components, read on the chart symbol's exchange clock (`syminfo.timezone` — UTC on crypto charts, New York time on a US stock); with an IANA timezone as the first argument, which reads those components in that zone instead; or from a single DATE STRING — `timestamp("2024-01-01")`, `timestamp("2024-01-01 09:30")`, `timestamp("2026-08-01T11:00:00-0500")`. A date string without its own offset is read as UTC. TradingView-compatible spelling: timestamp; runs without warnings. ### alerta.hour https://www.alertachart.com/alertascript/reference/builtins/hour Signature: hour(source?, timezone?) Returns hour component from timestamp series. With a timezone arg, the hour is computed in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: hour; runs without warnings. ### alerta.minute https://www.alertachart.com/alertascript/reference/builtins/minute Signature: minute(source?, timezone?) Returns minute component from timestamp series. With a timezone arg, the minute is computed in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: minute; runs without warnings. ### alerta.second https://www.alertachart.com/alertascript/reference/builtins/second Signature: second(source?, timezone?) Returns second component from timestamp series. With a timezone arg, the second is computed in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: second; runs without warnings. ### alerta.dayofmonth https://www.alertachart.com/alertascript/reference/builtins/dayofmonth Signature: dayofmonth(source?, timezone?) Returns day-of-month from timestamp series. With a timezone arg, computed in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: dayofmonth; runs without warnings. ### alerta.dayofweek https://www.alertachart.com/alertascript/reference/builtins/dayofweek Signature: dayofweek(source?, timezone?) Returns the day of week from a timestamp (1=Sunday..7=Saturday). With a timezone arg, the day-of-week is computed in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: dayofweek; runs without warnings. ### alerta.weekofyear https://www.alertachart.com/alertascript/reference/builtins/weekofyear Signature: weekofyear(source?, timezone?) Returns the ISO week number (weeks start on Monday) of a timestamp. With a timezone arg, the date is read in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: weekofyear; runs without warnings. ### alerta.month https://www.alertachart.com/alertascript/reference/builtins/month Signature: month(source?, timezone?) Returns month (1..12) from timestamp series. With a timezone arg, computed in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: month; runs without warnings. ### alerta.year https://www.alertachart.com/alertascript/reference/builtins/year Signature: year(source?, timezone?) Returns year from timestamp series. With a timezone arg, computed in that timezone (Pine v6). Without one, the chart symbol's exchange clock applies (`syminfo.timezone`): UTC on crypto charts, New York time on a US stock — daylight saving included. TradingView-compatible spelling: year; runs without warnings. ### alerta.timeframe.in_seconds https://www.alertachart.com/alertascript/reference/builtins/timeframe.in_seconds Signature: timeframe.in_seconds(timeframe) Returns timeframe duration in seconds. TradingView-compatible spelling: timeframe.in_seconds; runs without warnings. ### alerta.timeframe.from_seconds https://www.alertachart.com/alertascript/reference/builtins/timeframe.from_seconds Signature: timeframe.from_seconds(seconds) Converts seconds value to canonical timeframe string. TradingView-compatible spelling: timeframe.from_seconds; runs without warnings. ### alerta.barstate.isfirst https://www.alertachart.com/alertascript/reference/builtins/barstate.isfirst Signature: barstate.isfirst True only on first bar of current dataset. TradingView-compatible spelling: barstate.isfirst; runs without warnings. ### alerta.barstate.islast https://www.alertachart.com/alertascript/reference/builtins/barstate.islast Signature: barstate.islast True only on last bar of current dataset. TradingView-compatible spelling: barstate.islast; runs without warnings. ### alerta.barstate.ishistory https://www.alertachart.com/alertascript/reference/builtins/barstate.ishistory Signature: barstate.ishistory True for historical bars in current execution model. TradingView-compatible spelling: barstate.ishistory; runs without warnings. ### alerta.barstate.isrealtime https://www.alertachart.com/alertascript/reference/builtins/barstate.isrealtime Signature: barstate.isrealtime True on the latest bar during live delta execution (`update_last` and `append_last`). TradingView-compatible spelling: barstate.isrealtime; runs without warnings. ### alerta.barstate.isnew https://www.alertachart.com/alertascript/reference/builtins/barstate.isnew Signature: barstate.isnew True only when a new candle is appended (`append_last`) on the latest bar. TradingView-compatible spelling: barstate.isnew; runs without warnings. ### alerta.barstate.isconfirmed https://www.alertachart.com/alertascript/reference/builtins/barstate.isconfirmed Signature: barstate.isconfirmed True when bar is confirmed/closed in current execution model. TradingView-compatible spelling: barstate.isconfirmed; runs without warnings. ### alerta.syminfo.tickerid https://www.alertachart.com/alertascript/reference/builtins/syminfo.tickerid Signature: syminfo.tickerid Exchange-qualified symbol id (e.g. BINANCE:BTCUSDT). Inside request.security it is the requested symbol's; syminfo.main_tickerid stays the chart's. Pine v1–v3 scripts write it as `tickerid`. TradingView-compatible spelling: syminfo.tickerid; runs without warnings. ### alerta.syminfo.ticker https://www.alertachart.com/alertascript/reference/builtins/syminfo.ticker Signature: syminfo.ticker Ticker part of current symbol (e.g. BTCUSDT). Pine v1–v3 scripts write it as `ticker`. TradingView-compatible spelling: syminfo.ticker; runs without warnings. ### alerta.syminfo.prefix https://www.alertachart.com/alertascript/reference/builtins/syminfo.prefix Signature: syminfo.prefix Exchange prefix of current symbol (e.g. BINANCE). TradingView-compatible spelling: syminfo.prefix; runs without warnings. ### alerta.syminfo.mintick https://www.alertachart.com/alertascript/reference/builtins/syminfo.mintick Signature: syminfo.mintick Minimum price increment for the current symbol — the precision the chart's own price axis uses (a magnitude estimate from the last price when the script runs outside the chart). format.mintick and math.round_to_mintick use it. TradingView-compatible spelling: syminfo.mintick; runs without warnings. ### alerta.timeframe.period https://www.alertachart.com/alertascript/reference/builtins/timeframe.period Signature: timeframe.period Canonical chart timeframe identifier (e.g. 60, D, W, M). Inside request.security it is the requested timeframe; timeframe.main_period stays the chart's. Pine v1–v3 scripts write it as `period`. TradingView-compatible spelling: timeframe.period; runs without warnings. ### alerta.timeframe.isintraday https://www.alertachart.com/alertascript/reference/builtins/timeframe.isintraday Signature: timeframe.isintraday True when timeframe is minute/hour based. Pine v1–v3 scripts write it (and isdaily, isweekly, ismonthly, isdwm) without the timeframe. prefix. TradingView-compatible spelling: timeframe.isintraday; runs without warnings. ### alerta.timeframe.isdaily https://www.alertachart.com/alertascript/reference/builtins/timeframe.isdaily Signature: timeframe.isdaily True when timeframe period is D. TradingView-compatible spelling: timeframe.isdaily; runs without warnings. ### alerta.timeframe.isweekly https://www.alertachart.com/alertascript/reference/builtins/timeframe.isweekly Signature: timeframe.isweekly True when timeframe period is W. TradingView-compatible spelling: timeframe.isweekly; runs without warnings. ### alerta.timeframe.ismonthly https://www.alertachart.com/alertascript/reference/builtins/timeframe.ismonthly Signature: timeframe.ismonthly True when timeframe period is M. TradingView-compatible spelling: timeframe.ismonthly; runs without warnings. ### alerta.ta.change https://www.alertachart.com/alertascript/reference/builtins/change Signature: change(source, length) Difference between current value and previous value (length bars ago). TradingView-compatible spelling: ta.change; runs without warnings. ### alerta.sum https://www.alertachart.com/alertascript/reference/builtins/sum Signature: sum(source, length) Math namespace alias for sum. TradingView-compatible spelling: math.sum; runs without warnings. ### alerta.ta.valuewhen https://www.alertachart.com/alertascript/reference/builtins/valuewhen Signature: valuewhen(condition, source, occurrence) Returns the value of `source` when `condition` was last true. TradingView-compatible spelling: ta.valuewhen; runs without warnings. ### alerta.ta.pivothigh https://www.alertachart.com/alertascript/reference/builtins/pivothigh Signature: pivothigh(source, leftLen, rightLen) Returns price if it's a pivot high, else null. Confirmed rightLen bars ago. TradingView-compatible spelling: ta.pivothigh; runs without warnings. ### alerta.ta.pivotlow https://www.alertachart.com/alertascript/reference/builtins/pivotlow Signature: pivotlow(source, leftLen, rightLen) Returns price if it's a pivot low, else null. Confirmed rightLen bars ago. TradingView-compatible spelling: ta.pivotlow; runs without warnings. ### alerta.ta.sar https://www.alertachart.com/alertascript/reference/builtins/sar Signature: sar(start, inc, max) Parabolic Stop and Reverse indicator. TradingView-compatible spelling: ta.sar; runs without warnings. ### alerta.ta.supertrend https://www.alertachart.com/alertascript/reference/builtins/supertrend Signature: supertrend(factor, atrLength, high, low, close) Returns SuperTrend line and trend direction (+1/-1). TradingView-compatible spelling: ta.supertrend; runs without warnings. ### alerta.ta.vwap https://www.alertachart.com/alertascript/reference/builtins/vwap Signature: ta.vwap(source, anchor?, stdev_mult?) → series float | [vwap, upper, lower] Pine v6: volume-weighted average price, restarted whenever `anchor` is true — by default at the first bar of every trading day on the exchange clock (so on a daily chart it is the source itself). Two overloads: • `ta.vwap(source, anchor)` → series float • `ta.vwap(source, anchor, stdev_mult)` → tuple [vwap, upper, lower] with ±N·stdev bands. The bare `ta.vwap` variable is the session VWAP of hlc3. TradingView-compatible spelling: ta.vwap; runs without warnings. ### alerta.ta.stoch https://www.alertachart.com/alertascript/reference/builtins/stoch Signature: stoch(close, high, low, length, k_smooth, d_smooth) Calculates the Stochastic Oscillator. Pine's `ta.stoch(source, high, low, length)` returns ONE series — the raw %K, 100 × (source − lowest low) / (highest high − lowest low) — which scripts smooth themselves, e.g. `k = ta.sma(ta.stoch(close, high, low, 14), 3)`. AlertaScript's own `[k, d] = stoch(close, high, low, 14)` returns the smoothed pair (k_smooth / d_smooth, default 3). TradingView-compatible spelling: ta.stoch; runs without warnings. ### alerta.ta.cci https://www.alertachart.com/alertascript/reference/builtins/cci Signature: cci(source, length) Calculates the CCI indicator. TradingView-compatible spelling: ta.cci; runs without warnings. ### alerta.ta.obv https://www.alertachart.com/alertascript/reference/builtins/obv Signature: obv(close, volume) Calculates OBV. TradingView-compatible spelling: ta.obv; runs without warnings. ### alerta.ta.mfi https://www.alertachart.com/alertascript/reference/builtins/mfi Signature: mfi(high, low, close, volume, length) Calculates MFI indicator. Accepts mfi(high, low, close, volume, length) or ta.mfi(source, length). TradingView-compatible spelling: ta.mfi; runs without warnings. ### alerta.ta.kdj https://www.alertachart.com/alertascript/reference/builtins/kdj Signature: kdj(close, high, low, length, m1, m2) Calculates the KDJ indicator. TradingView-compatible spelling: ta.kdj; runs without warnings. ### alerta.ta.dc https://www.alertachart.com/alertascript/reference/builtins/ta.dc Signature: ta.dc(length) Calculates the Donchian Channel — the highest high and lowest low over a given period. Returns an object with upper, lower, and basis (midline) series. TradingView-compatible spelling: ta.dc; runs without warnings. ### alerta.ta.wvad https://www.alertachart.com/alertascript/reference/builtins/ta.wvad Signature: ta.wvad() Calculates Williams Vane Accumulation/Distribution — a volume-weighted directional pressure indicator using (close - open) / (high - low) * volume. TradingView-compatible spelling: ta.wvad; runs without warnings. ### alerta.ta.pivot_point_levels https://www.alertachart.com/alertascript/reference/builtins/ta.pivot_point_levels Signature: ta.pivot_point_levels(type, anchor, developing?) → array Pine v6: computes pivot levels (P, R1-R5, S1-S5) using one of six methods, anchored to a user-defined period. TradingView-compatible spelling: ta.pivot_point_levels; runs without warnings. ### alerta.ta.rci https://www.alertachart.com/alertascript/reference/builtins/ta.rci Signature: ta.rci(source, length) → series float Pine v6: Spearman rank correlation between `source` and the time index over `length` bars. Scaled to [-100, 100]. 100 = monotonically rising, -100 = monotonically falling. TradingView-compatible spelling: ta.rci; runs without warnings. ### alerta.ta.wpr https://www.alertachart.com/alertascript/reference/builtins/ta.wpr Signature: ta.wpr(length) → series float Pine v6 official name for Williams %R. Oscillator showing current close relative to the high/low range over `length` bars. TradingView-compatible spelling: ta.wpr; runs without warnings. ### alerta.timeframe.change https://www.alertachart.com/alertascript/reference/builtins/timeframe.change Signature: timeframe.change(timeframe) → series bool Pine v6: returns true on the first bar of every new period of the specified timeframe. Use it to anchor higher-timeframe-driven pivots, VWAP and aggregations. TradingView-compatible spelling: timeframe.change; runs without warnings. ### alerta.ta.pvt https://www.alertachart.com/alertascript/reference/builtins/ta.pvt Signature: ta.pvt → series float Pine built-in VARIABLE (no parentheses): cumulative sum of the close %-change weighted by volume — cum(change(close)/close[1] * volume). Rises when price gains on volume, falls when price drops on volume. TradingView-compatible spelling: ta.pvt; runs without warnings. ### alerta.ta.accdist https://www.alertachart.com/alertascript/reference/builtins/ta.accdist Signature: ta.accdist → series float Pine built-in VARIABLE (no parentheses): cumulative Accumulation/Distribution line — cum(((close-low)-(high-close))/(high-low) * volume). Measures buying vs. selling pressure via the close position inside the bar range. TradingView-compatible spelling: ta.accdist; runs without warnings. ### alerta.ta.iii https://www.alertachart.com/alertascript/reference/builtins/ta.iii Signature: ta.iii → series float Pine built-in VARIABLE (no parentheses): (2*close - high - low) / ((high - low) * volume). Gauges where the close sits in the bar range, normalized by volume. TradingView-compatible spelling: ta.iii; runs without warnings. ### alerta.ta.nvi https://www.alertachart.com/alertascript/reference/builtins/ta.nvi Signature: ta.nvi → series float Pine built-in VARIABLE (no parentheses): starts at 1.0 and compounds the close %-change ONLY on bars where volume fell versus the prior bar. Tracks what "smart money" does on quiet days. TradingView-compatible spelling: ta.nvi; runs without warnings. ### alerta.ta.pvi https://www.alertachart.com/alertascript/reference/builtins/ta.pvi Signature: ta.pvi → series float Pine built-in VARIABLE (no parentheses): starts at 1.0 and compounds the close %-change ONLY on bars where volume rose versus the prior bar. Mirror of ta.nvi for high-activity days. TradingView-compatible spelling: ta.pvi; runs without warnings. ### alerta.ta.wad https://www.alertachart.com/alertascript/reference/builtins/ta.wad Signature: ta.wad → series float Pine built-in VARIABLE (no parentheses): cumulative sum of close - min(low, close[1]) on up-closes and close - max(high, close[1]) on down-closes (0 when unchanged). Larry Williams’ accumulation/distribution measure. TradingView-compatible spelling: ta.wad; runs without warnings. ### alerta.strategy.entry https://www.alertachart.com/alertascript/reference/builtins/strategy.entry Signature: strategy.entry(id, direction, qty, limit, stop, oca_name, oca_type, comment, alert_message) Enters a market position (long or short) for strategy backtesting. Must run inside a strategy script header. TradingView-compatible spelling: strategy.entry; runs without warnings. ### alerta.strategy.exit https://www.alertachart.com/alertascript/reference/builtins/strategy.exit Signature: strategy.exit(id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, comment_profit, comment_loss, comment_trailing, alert_message) Exits a specific entry by ID with take-profit / stop-loss / trailing legs. `profit`/`loss` are TICK offsets from the entry price; `limit`/`stop` are absolute prices. `from_entry` scopes the exit (and its qty/qty_percent) to trades opened by that entry id. Per-leg comments label the trade by whichever leg fired. TradingView-compatible spelling: strategy.exit; runs without warnings. ### alerta.strategy.close https://www.alertachart.com/alertascript/reference/builtins/strategy.close Signature: strategy.close(id, comment, qty, qty_percent, alert_message, immediately) Closes what the entry with this id opened, at market price, at the next bar's open (`immediately=true`: at the signal bar's close). With the default close_entries_rule (FIFO) that quantity is taken from the oldest open trades first, so the list of trades can show an earlier entry closed by this order; with close_entries_rule = "ANY" the entry's own trades are closed. When the entry has no open trade the call does nothing — it is not kept for a later position. Must run inside a strategy script header. TradingView-compatible spelling: strategy.close; runs without warnings. ### alerta.request.security https://www.alertachart.com/alertascript/reference/builtins/request.security Signature: request.security(symbol, timeframe, expression, gaps, lookahead) Requests data from another symbol or timeframe and aligns it to the chart's bars. The expression is calculated on the requested bars: a higher-timeframe EMA is the EMA of the higher-timeframe bars, not an average of the chart's values. The symbol and the timeframe do not have to be literals — an input, a variable, a function result or a condition may supply them, so one script can request several symbols or timeframes, also from a loop. A symbol AlertaChart has no data for returns na with a warning naming it; the rest of the script keeps running, and the chart's own bars are never substituted for it. TradingView-compatible spelling: request.security; runs without warnings. ### alerta.request.financial https://www.alertachart.com/alertascript/reference/builtins/request.financial Signature: request.financial(symbol, financial_id, period, gaps?, ignore_invalid_symbol?, currency?) Requests a fundamental metric (revenue, EPS, capex, …) for a symbol, period by period. There is no historical fundamentals feed behind this: the call is accepted and returns `na`, with a warning, exactly as TradingView does for a symbol it has no data on. Guard the result with `na(...)`. On a stock chart the company's current profile is available as `syminfo.*` — `syminfo.sector`, `syminfo.industry`, `syminfo.country`, `syminfo.shares_outstanding_total`. TradingView-compatible spelling: request.financial; runs without warnings. ### alerta.request.earnings https://www.alertachart.com/alertascript/reference/builtins/request.earnings Signature: request.earnings(symbol, field, gaps?, lookahead?, ignore_invalid_symbol?, currency?) Requests reported earnings for a symbol. The second argument selects which figure: `earnings.actual`, `earnings.estimate` or `earnings.standardized`. As with request.financial there is no fundamentals feed, so the call returns `na` with a warning instead of failing. TradingView-compatible spelling: request.earnings; runs without warnings. ### alerta.request.dividends https://www.alertachart.com/alertascript/reference/builtins/request.dividends Signature: request.dividends(symbol, field?, gaps?, lookahead?, ignore_invalid_symbol?, currency?) Requests dividend payments for a symbol (`dividends.gross` / `dividends.net`). Returns `na` with a warning — AlertaScript has no fundamentals feed. TradingView-compatible spelling: request.dividends; runs without warnings. ### alerta.request.splits https://www.alertachart.com/alertascript/reference/builtins/request.splits Signature: request.splits(symbol, field, gaps?, lookahead?, ignore_invalid_symbol?) Requests split events for a symbol (`splits.numerator` / `splits.denominator`). Returns `na` with a warning — AlertaScript has no fundamentals feed. TradingView-compatible spelling: request.splits; runs without warnings. ### alerta.request.footprint https://www.alertachart.com/alertascript/reference/builtins/request.footprint Signature: request.footprint(ticks_per_row, va_percent, imbalance_percent) → footprint The volume footprint of every bar: its buy and sell volume by price row, Point of Control, value area and diagonal imbalances, read through `footprint.*()` and `volume_row.*()`. AlertaChart builds it from the symbol's own order flow — the taker buy / sell volume AlertaChart records for every minute (Binance spot and perpetuals; Bybit, OKX and Coinbase for BTC, ETH, XRP and SOL), spread over each minute's traded range, and the exact trade prices of the exchange's live trade stream for the bars since the chart opened. Inside `request.security` with another symbol — written out, from an input or a variable — that symbol's order flow. na (with one warning) on symbols without order flow: stocks, CME futures, forex. TradingView-compatible spelling: request.footprint; runs without warnings. ### alerta.request.security_lower_tf https://www.alertachart.com/alertascript/reference/builtins/request.security_lower_tf Signature: request.security_lower_tf(symbol, timeframe, expression) → array (or a tuple of arrays) Requests EVERY lower-timeframe value that falls inside each chart bar. Unlike `request.security`, which projects one value per bar, this returns an ARRAY per bar — read it with `array.size` / `array.get` / `for … in`. The requested timeframe must not be higher than the chart timeframe (the chart's own gives one element per bar). When no intrabar series is available the arrays come back empty (size 0) and a warning is raised, so guard with `if arr.size() > 0`. TradingView-compatible spelling: request.security_lower_tf; runs without warnings. ### alerta.strategy.order https://www.alertachart.com/alertascript/reference/builtins/strategy.order Signature: strategy.order(id, direction, qty, limit, stop, comment) Places a market, limit, or stop order regardless of the current position. Does not automatically reverse positions like strategy.entry. TradingView-compatible spelling: strategy.order; runs without warnings. ### alerta.strategy.equity https://www.alertachart.com/alertascript/reference/builtins/strategy.equity Signature: strategy.equity Returns the current equity (initial capital + realized profit + open profit) for the strategy at the current bar. TradingView-compatible spelling: strategy.equity; runs without warnings. ### alerta.strategy.netprofit_percent https://www.alertachart.com/alertascript/reference/builtins/strategy.netprofit_percent Signature: strategy.netprofit_percent Realized net profit expressed as a percentage of the initial capital. Companion percent variants also available: strategy.openprofit_percent, strategy.grossprofit_percent, strategy.grossloss_percent, strategy.max_drawdown_percent, strategy.max_runup_percent. TradingView-compatible spelling: strategy.netprofit_percent; runs without warnings. ### alerta.strategy.avg_trade https://www.alertachart.com/alertascript/reference/builtins/strategy.avg_trade Signature: strategy.avg_trade Average profit/loss per closed trade. Companions: strategy.avg_trade_percent (per-trade % of entry notional), strategy.avg_winning_trade(_percent), strategy.avg_losing_trade(_percent). TradingView-compatible spelling: strategy.avg_trade; runs without warnings. ### alerta.strategy.margin_liquidation_price https://www.alertachart.com/alertascript/reference/builtins/strategy.margin_liquidation_price Signature: strategy.margin_liquidation_price Price at which a margin call would liquidate the position. AlertaScript does not simulate leverage/margin, so this returns na — matching Pine's value when margin requirements are 100%. TradingView-compatible spelling: strategy.margin_liquidation_price; runs without warnings. ### alerta.strategy.position_size https://www.alertachart.com/alertascript/reference/builtins/strategy.position_size Signature: strategy.position_size Returns the size of the current open position. Positive for long positions, negative for short positions, and 0 if neutral. TradingView-compatible spelling: strategy.position_size; runs without warnings. ### alerta.strategy.openprofit https://www.alertachart.com/alertascript/reference/builtins/strategy.openprofit Signature: strategy.openprofit Returns the unrealized profit/loss of the currently open positions. TradingView-compatible spelling: strategy.openprofit; runs without warnings. ### alerta.strategy.risk.max_drawdown https://www.alertachart.com/alertascript/reference/builtins/strategy.risk.max_drawdown Signature: strategy.risk.max_drawdown(value, type) Sets the maximum drawdown limit for the strategy. If reached, the strategy stops opening new positions. TradingView-compatible spelling: strategy.risk.max_drawdown; runs without warnings. ### alerta.strategy.risk.max_position_size https://www.alertachart.com/alertascript/reference/builtins/strategy.risk.max_position_size Signature: strategy.risk.max_position_size(size) Caps the quantity of any entry order to the specified size. TradingView-compatible spelling: strategy.risk.max_position_size; runs without warnings. ### alerta.strategy.risk.allow_entry_in https://www.alertachart.com/alertascript/reference/builtins/strategy.risk.allow_entry_in Signature: strategy.risk.allow_entry_in(direction) Restricts strategy entries to a specific direction. TradingView-compatible spelling: strategy.risk.allow_entry_in; runs without warnings. ### alerta.strategy.opentrades https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades Signature: strategy.opentrades Returns the number of currently open trades in the strategy. TradingView-compatible spelling: strategy.opentrades; runs without warnings. ### alerta.strategy.closedtrades https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades Signature: strategy.closedtrades Returns the total number of closed trades in the strategy performance history. TradingView-compatible spelling: strategy.closedtrades; runs without warnings. ### alerta.strategy.opentrades.entry_price https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.entry_price Signature: strategy.opentrades.entry_price(trade_index) Returns the entry price for the specified open trade. TradingView-compatible spelling: strategy.opentrades.entry_price; runs without warnings. ### alerta.strategy.closedtrades.profit https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.profit Signature: strategy.closedtrades.profit(trade_index) Returns the profit or loss for the specified closed trade. TradingView-compatible spelling: strategy.closedtrades.profit; runs without warnings. ### alerta.strategy.cancel https://www.alertachart.com/alertascript/reference/builtins/strategy.cancel Signature: strategy.cancel(id) Cancels pending orders and active exits with the given id. TradingView-compatible spelling: strategy.cancel; runs without warnings. ### alerta.strategy.cancel_all https://www.alertachart.com/alertascript/reference/builtins/strategy.cancel_all Signature: strategy.cancel_all() Cancels all pending entries and active exit orders. TradingView-compatible spelling: strategy.cancel_all; runs without warnings. ### alerta.strategy.close_all https://www.alertachart.com/alertascript/reference/builtins/strategy.close_all Signature: strategy.close_all(comment, alert_message, immediately) Closes all open positions at market. `immediately=true` fills at the signal bar's close instead of the next bar's open. TradingView-compatible spelling: strategy.close_all; runs without warnings. ### alerta.strategy.risk.max_cons_loss_days https://www.alertachart.com/alertascript/reference/builtins/strategy.risk.max_cons_loss_days Signature: strategy.risk.max_cons_loss_days(count) Stops new entries after the configured number of consecutive losing trades. TradingView-compatible spelling: strategy.risk.max_cons_loss_days; runs without warnings. ### alerta.strategy.risk.max_intraday_filled_orders https://www.alertachart.com/alertascript/reference/builtins/strategy.risk.max_intraday_filled_orders Signature: strategy.risk.max_intraday_filled_orders(count) Limits how many fills can occur within the current bar/day approximation. TradingView-compatible spelling: strategy.risk.max_intraday_filled_orders; runs without warnings. ### alerta.strategy.risk.max_intraday_loss https://www.alertachart.com/alertascript/reference/builtins/strategy.risk.max_intraday_loss Signature: strategy.risk.max_intraday_loss(value, type) Stops new entries when current bar/day loss limit is exceeded. TradingView-compatible spelling: strategy.risk.max_intraday_loss; runs without warnings. ### alerta.strategy.opentrades.profit_percent https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.profit_percent Signature: strategy.opentrades.profit_percent(trade_index) Returns mark-to-market profit percent for an open trade. TradingView-compatible spelling: strategy.opentrades.profit_percent; runs without warnings. ### alerta.strategy.closedtrades.profit_percent https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.profit_percent Signature: strategy.closedtrades.profit_percent(trade_index) Returns realized profit percent for a closed trade. TradingView-compatible spelling: strategy.closedtrades.profit_percent; runs without warnings. ### alerta.strategy.opentrades.entry_bar_index https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.entry_bar_index Signature: strategy.opentrades.entry_bar_index(trade_index) Returns the entry bar index of an open trade. TradingView-compatible spelling: strategy.opentrades.entry_bar_index; runs without warnings. ### alerta.strategy.closedtrades.entry_bar_index https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.entry_bar_index Signature: strategy.closedtrades.entry_bar_index(trade_index) Returns entry bar index for a closed trade. TradingView-compatible spelling: strategy.closedtrades.entry_bar_index; runs without warnings. ### alerta.strategy.closedtrades.exit_bar_index https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.exit_bar_index Signature: strategy.closedtrades.exit_bar_index(trade_index) Returns exit bar index for a closed trade. TradingView-compatible spelling: strategy.closedtrades.exit_bar_index; runs without warnings. ### alerta.strategy.opentrades.max_runup https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.max_runup Signature: strategy.opentrades.max_runup(trade_index) Returns max favorable excursion for an open trade. TradingView-compatible spelling: strategy.opentrades.max_runup; runs without warnings. ### alerta.strategy.opentrades.max_drawdown https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.max_drawdown Signature: strategy.opentrades.max_drawdown(trade_index) Returns max adverse excursion for an open trade. TradingView-compatible spelling: strategy.opentrades.max_drawdown; runs without warnings. ### alerta.strategy.closedtrades.max_runup https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.max_runup Signature: strategy.closedtrades.max_runup(trade_index) Returns max favorable excursion for a closed trade. TradingView-compatible spelling: strategy.closedtrades.max_runup; runs without warnings. ### alerta.strategy.closedtrades.max_drawdown https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.max_drawdown Signature: strategy.closedtrades.max_drawdown(trade_index) Returns max adverse excursion for a closed trade. TradingView-compatible spelling: strategy.closedtrades.max_drawdown; runs without warnings. ### alerta.strategy.opentrades.entry_id https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.entry_id Signature: strategy.opentrades.entry_id(trade_index) Returns entry id of an open trade. TradingView-compatible spelling: strategy.opentrades.entry_id; runs without warnings. ### alerta.strategy.closedtrades.entry_id https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.entry_id Signature: strategy.closedtrades.entry_id(trade_index) Returns entry id of a closed trade. TradingView-compatible spelling: strategy.closedtrades.entry_id; runs without warnings. ### alerta.strategy.closedtrades.exit_id https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.exit_id Signature: strategy.closedtrades.exit_id(trade_index) Returns the id of the order that closed the trade: the strategy.exit id, the id passed to strategy.close, the reversing entry's id, or "close_all". TradingView-compatible spelling: strategy.closedtrades.exit_id; runs without warnings. ### alerta.strategy.opentrades.entry_comment https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.entry_comment Signature: strategy.opentrades.entry_comment(trade_index) Returns entry comment of an open trade. TradingView-compatible spelling: strategy.opentrades.entry_comment; runs without warnings. ### alerta.strategy.opentrades.entry_time https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.entry_time Signature: strategy.opentrades.entry_time(trade_index) Returns entry time of an open trade. TradingView-compatible spelling: strategy.opentrades.entry_time; runs without warnings. ### alerta.strategy.opentrades.size https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.size Signature: strategy.opentrades.size(trade_index) Returns quantity of an open trade. TradingView-compatible spelling: strategy.opentrades.size; runs without warnings. ### alerta.strategy.opentrades.commission https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.commission Signature: strategy.opentrades.commission(trade_index) Returns accumulated commission of an open trade. TradingView-compatible spelling: strategy.opentrades.commission; runs without warnings. ### alerta.strategy.opentrades.profit https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.profit Signature: strategy.opentrades.profit(trade_index) Returns current unrealized profit of an open trade. TradingView-compatible spelling: strategy.opentrades.profit; runs without warnings. ### alerta.strategy.opentrades.max_runup_percent https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.max_runup_percent Signature: strategy.opentrades.max_runup_percent(trade_index) Returns max runup percent for an open trade. TradingView-compatible spelling: strategy.opentrades.max_runup_percent; runs without warnings. ### alerta.strategy.opentrades.max_drawdown_percent https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.max_drawdown_percent Signature: strategy.opentrades.max_drawdown_percent(trade_index) Returns max drawdown percent for an open trade. TradingView-compatible spelling: strategy.opentrades.max_drawdown_percent; runs without warnings. ### alerta.strategy.opentrades.entry_bar https://www.alertachart.com/alertascript/reference/builtins/strategy.opentrades.entry_bar Signature: strategy.opentrades.entry_bar(trade_index) Alias of entry bar index for open trades. TradingView-compatible spelling: strategy.opentrades.entry_bar_index; runs without warnings. ### alerta.strategy.closedtrades.entry_price https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.entry_price Signature: strategy.closedtrades.entry_price(trade_index) Returns entry price of a closed trade. TradingView-compatible spelling: strategy.closedtrades.entry_price; runs without warnings. ### alerta.strategy.closedtrades.entry_comment https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.entry_comment Signature: strategy.closedtrades.entry_comment(trade_index) Returns entry comment of a closed trade. TradingView-compatible spelling: strategy.closedtrades.entry_comment; runs without warnings. ### alerta.strategy.closedtrades.entry_time https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.entry_time Signature: strategy.closedtrades.entry_time(trade_index) Returns entry time of a closed trade. TradingView-compatible spelling: strategy.closedtrades.entry_time; runs without warnings. ### alerta.strategy.closedtrades.exit_price https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.exit_price Signature: strategy.closedtrades.exit_price(trade_index) Returns exit price of a closed trade. TradingView-compatible spelling: strategy.closedtrades.exit_price; runs without warnings. ### alerta.strategy.closedtrades.exit_comment https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.exit_comment Signature: strategy.closedtrades.exit_comment(trade_index) Returns exit comment of a closed trade. TradingView-compatible spelling: strategy.closedtrades.exit_comment; runs without warnings. ### alerta.strategy.closedtrades.exit_time https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.exit_time Signature: strategy.closedtrades.exit_time(trade_index) Returns exit time of a closed trade. TradingView-compatible spelling: strategy.closedtrades.exit_time; runs without warnings. ### alerta.strategy.closedtrades.size https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.size Signature: strategy.closedtrades.size(trade_index) Returns quantity of a closed trade. TradingView-compatible spelling: strategy.closedtrades.size; runs without warnings. ### alerta.strategy.closedtrades.commission https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.commission Signature: strategy.closedtrades.commission(trade_index) Returns paid commission of a closed trade. TradingView-compatible spelling: strategy.closedtrades.commission; runs without warnings. ### alerta.strategy.closedtrades.max_runup_percent https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.max_runup_percent Signature: strategy.closedtrades.max_runup_percent(trade_index) Returns max runup percent for a closed trade. TradingView-compatible spelling: strategy.closedtrades.max_runup_percent; runs without warnings. ### alerta.strategy.closedtrades.max_drawdown_percent https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.max_drawdown_percent Signature: strategy.closedtrades.max_drawdown_percent(trade_index) Returns max drawdown percent for a closed trade. TradingView-compatible spelling: strategy.closedtrades.max_drawdown_percent; runs without warnings. ### alerta.strategy.closedtrades.entry_bar https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.entry_bar Signature: strategy.closedtrades.entry_bar(trade_index) Alias of entry bar index for closed trades. TradingView-compatible spelling: strategy.closedtrades.entry_bar_index; runs without warnings. ### alerta.strategy.closedtrades.exit_bar https://www.alertachart.com/alertascript/reference/builtins/strategy.closedtrades.exit_bar Signature: strategy.closedtrades.exit_bar(trade_index) Alias of exit bar index for closed trades. TradingView-compatible spelling: strategy.closedtrades.exit_bar_index; runs without warnings. ### alerta.strategy.initial_capital https://www.alertachart.com/alertascript/reference/builtins/strategy.initial_capital Signature: strategy.initial_capital Returns the starting capital defined in the strategy() declaration. TradingView-compatible spelling: strategy.initial_capital; runs without warnings. ### alerta.strategy.grossprofit https://www.alertachart.com/alertascript/reference/builtins/strategy.grossprofit Signature: strategy.grossprofit Returns the total profit from all winning closed trades. TradingView-compatible spelling: strategy.grossprofit; runs without warnings. ### alerta.strategy.grossloss https://www.alertachart.com/alertascript/reference/builtins/strategy.grossloss Signature: strategy.grossloss Returns the total loss (as a positive number) from all losing closed trades. TradingView-compatible spelling: strategy.grossloss; runs without warnings. ### alerta.strategy.wintrades https://www.alertachart.com/alertascript/reference/builtins/strategy.wintrades Signature: strategy.wintrades Returns the number of closed trades that ended with a profit. TradingView-compatible spelling: strategy.wintrades; runs without warnings. ### alerta.strategy.losstrades https://www.alertachart.com/alertascript/reference/builtins/strategy.losstrades Signature: strategy.losstrades Returns the number of closed trades that ended with a loss. TradingView-compatible spelling: strategy.losstrades; runs without warnings. ### alerta.strategy.eventrades https://www.alertachart.com/alertascript/reference/builtins/strategy.eventrades Signature: strategy.eventrades Returns the number of closed trades that ended at breakeven (no profit, no loss). TradingView-compatible spelling: strategy.eventrades; runs without warnings. ### alerta.strategy.max_drawdown https://www.alertachart.com/alertascript/reference/builtins/strategy.max_drawdown Signature: strategy.max_drawdown Returns the maximum equity drawdown of the backtest, intrabar as in the Strategy Tester: the highest closed-trade equity so far minus the equity at a bar's adverse extreme (the low of a long, the high of a short). TradingView-compatible spelling: strategy.max_drawdown; runs without warnings. ### alerta.strategy.max_runup https://www.alertachart.com/alertascript/reference/builtins/strategy.max_runup Signature: strategy.max_runup Returns the maximum equity run-up of the backtest, intrabar: the equity at a bar's favourable extreme minus the lowest closed-trade equity so far. TradingView-compatible spelling: strategy.max_runup; runs without warnings. ### alerta.strategy.account_currency https://www.alertachart.com/alertascript/reference/builtins/strategy.account_currency Signature: strategy.account_currency Returns the account currency of strategy equity and P&L: the strategy() currency, or the symbol's own currency when it is currency.NONE (the default) — e.g. "USDT" on BTCUSDT. TradingView-compatible spelling: strategy.account_currency; runs without warnings. ### alerta.strategy.default_entry_qty https://www.alertachart.com/alertascript/reference/builtins/strategy.default_entry_qty Signature: strategy.default_entry_qty(fill_price) Returns the default order quantity that strategy settings imply at a given fill price. TradingView-compatible spelling: strategy.default_entry_qty; runs without warnings. ### alerta.plot https://www.alertachart.com/alertascript/reference/builtins/plot Signature: plot(series, { title, color, linewidth, style, pane, offset, display }) Plots a series on the chart. TradingView-compatible spelling: plot; runs without warnings. ### alerta.hline https://www.alertachart.com/alertascript/reference/builtins/hline Signature: hline(price, { title, color, linestyle, linewidth }) Plots a horizontal line at a fixed price level. TradingView-compatible spelling: hline; runs without warnings. ### alerta.plotshape https://www.alertachart.com/alertascript/reference/builtins/plotshape Signature: plotshape(series, { shape, location, color, text, size, transp }) Plots visual shapes on the chart based on a condition. TradingView-compatible spelling: plotshape; runs without warnings. ### alerta.plotchar https://www.alertachart.com/alertascript/reference/builtins/plotchar Signature: plotchar(series, { char, location, color, text }) Plots a specific character on the chart based on a condition. TradingView-compatible spelling: plotchar; runs without warnings. ### alerta.plotarrow https://www.alertachart.com/alertascript/reference/builtins/plotarrow Signature: plotarrow(series, { colorup, colordown, minheight, maxheight, offset, pane }) | plotarrow(series, title, colorup, colordown, …) Plots up/down arrows based on signed series values. Pine's positional order after the series is `title, colorup, colordown, offset, minheight, maxheight, editable, show_last, display, force_overlay` — `title` comes FIRST, as it does across the whole plot family. TradingView-compatible spelling: plotarrow; runs without warnings. ### alerta.plotcandle https://www.alertachart.com/alertascript/reference/builtins/plotcandle Signature: plotcandle(open, high, low, close, { color, wickcolor, bordercolor, offset, pane }) | plotcandle(open, high, low, close, title, color, wickcolor, …) Plots custom candlesticks from OHLC series. Pine's positional order after close is `title, color, wickcolor, editable, show_last, bordercolor, display, format, precision, force_overlay` — `title` comes first and `bordercolor` sits AFTER show_last, not next to wickcolor. TradingView-compatible spelling: plotcandle; runs without warnings. ### alerta.plotbar https://www.alertachart.com/alertascript/reference/builtins/plotbar Signature: plotbar(open, high, low, close, { color, offset, pane }) | plotbar(open, high, low, close, title, color, …) Plots OHLC bars (ticks on open/close). Pine's positional order after close is `title, color, editable, show_last, display, format, precision, force_overlay`. TradingView-compatible spelling: plotbar; runs without warnings. ### alerta.bgcolor https://www.alertachart.com/alertascript/reference/builtins/bgcolor Signature: bgcolor(color, options) Changes the background color of the chart based on a condition. TradingView-compatible spelling: bgcolor; runs without warnings. ### alerta.barcolor https://www.alertachart.com/alertascript/reference/builtins/barcolor Signature: barcolor(color, { offset, editable }) Overrides candle/bar color on matching bars. TradingView-compatible spelling: barcolor; runs without warnings. ### alerta.fill https://www.alertachart.com/alertascript/reference/builtins/fill Signature: fill(plot1_id, plot2_id, y1?, y2?, color1?, color2?, { color, title, fillgaps, top_color, bottom_color }?) Fills the area between two plots (or two hlines). Each plot may be given by the handle plot() returns (p1 = plot(…)), by a plot() call written inline — fill(plot(a), plot(b), color = …) — or by its title. Pine v6's gradient form — fill(p1, p2, top_value, bottom_value, top_color, bottom_color) — works positionally and by name. TradingView-compatible spelling: fill; runs without warnings. ### alerta.linefill https://www.alertachart.com/alertascript/reference/builtins/linefill Signature: linefill(line1_id, line2_id, options) Fills the area between two line handles. TradingView-compatible spelling: linefill.new; runs without warnings. ### alerta.drawLabel https://www.alertachart.com/alertascript/reference/builtins/drawlabel Signature: drawLabel(id, cond, x, y, text, options) Draws a persistent label element on the chart at specific coordinates. TradingView-compatible spelling: label.new; runs without warnings. ### alerta.drawBox https://www.alertachart.com/alertascript/reference/builtins/drawbox Signature: drawBox(id, cond, x1, y1, x2, y2, options) Draws a persistent rectangle/zone on the chart. Ideal for FVG/OB. TradingView-compatible spelling: box.new; runs without warnings. ### alerta.drawLine https://www.alertachart.com/alertascript/reference/builtins/drawline Signature: drawLine(id, cond, x1, y1, x2, y2, options) Draws a persistent trendline or simple line between two points. TradingView-compatible spelling: line.new; runs without warnings. ### alerta.drawTable https://www.alertachart.com/alertascript/reference/builtins/drawtable Signature: drawTable(id, row, col, text, options) Draws a persistent table cell for creating HUDs and dashboards. TradingView-compatible spelling: table.cell; runs without warnings. ### alerta.linefill.new https://www.alertachart.com/alertascript/reference/builtins/linefill.new Signature: linefill.new(line1, line2, color) Creates a linefill handle between two line handles. TradingView-compatible spelling: linefill.new; runs without warnings. ### alerta.linefill.delete https://www.alertachart.com/alertascript/reference/builtins/linefill.delete Signature: linefill.delete(id) Deletes a linefill handle. TradingView-compatible spelling: linefill.delete; runs without warnings. ### alerta.linefill.get_line1 https://www.alertachart.com/alertascript/reference/builtins/linefill.get_line1 Signature: linefill.get_line1(id) Returns the first line handle used by the linefill. TradingView-compatible spelling: linefill.get_line1; runs without warnings. ### alerta.linefill.get_line2 https://www.alertachart.com/alertascript/reference/builtins/linefill.get_line2 Signature: linefill.get_line2(id) Returns the second line handle used by the linefill. TradingView-compatible spelling: linefill.get_line2; runs without warnings. ### alerta.linefill.set_color https://www.alertachart.com/alertascript/reference/builtins/linefill.set_color Signature: linefill.set_color(id, color) Updates linefill color. TradingView-compatible spelling: linefill.set_color; runs without warnings. ### alerta.line.new https://www.alertachart.com/alertascript/reference/builtins/line.new Signature: line.new(x1, y1, x2, y2, options) | line.new(x1, y1, x2, y2, color=, style=, width=, extend=) | line.new(x1, y1, x2, y2, xloc, extend, color, style, width) Creates a line object and returns its handle. Accepts the Alerta-canonical `options={...}` object form, the Pine v5/v6 direct-named-args dialect (`line.new(x1, y1, x2, y2, color=color.green, style=line.style_dashed, width=2, extend=extend.right)`), and Pine's fully POSITIONAL form, whose optional order is `xloc, extend, color, style, width, force_overlay`. All three forms produce identical output. TradingView-compatible spelling: line.new; runs without warnings. ### alerta.line.copy https://www.alertachart.com/alertascript/reference/builtins/line.copy Signature: line.copy(id) Creates a duplicate of an existing line and returns the new handle. TradingView-compatible spelling: line.copy; runs without warnings. ### alerta.line.set_xy1 https://www.alertachart.com/alertascript/reference/builtins/line.set_xy1 Signature: line.set_xy1(id, x, y) Updates line start point (x1, y1) together. TradingView-compatible spelling: line.set_xy1; runs without warnings. ### alerta.line.set_xy2 https://www.alertachart.com/alertascript/reference/builtins/line.set_xy2 Signature: line.set_xy2(id, x, y) Updates line end point (x2, y2) together. TradingView-compatible spelling: line.set_xy2; runs without warnings. ### alerta.line.set_first_point https://www.alertachart.com/alertascript/reference/builtins/line.set_first_point Signature: line.set_first_point(id, point) Updates the line start point from a `chart.point` object. TradingView-compatible spelling: line.set_first_point; runs without warnings. ### alerta.line.set_second_point https://www.alertachart.com/alertascript/reference/builtins/line.set_second_point Signature: line.set_second_point(id, point) Updates the line end point from a `chart.point` object. TradingView-compatible spelling: line.set_second_point; runs without warnings. ### alerta.line.set_xloc https://www.alertachart.com/alertascript/reference/builtins/line.set_xloc Signature: line.set_xloc(id, x1, x2, xloc) Sets both x-coordinates of the line and the x-location they are read in (bar index or bar time) at once. TradingView-compatible spelling: line.set_xloc; runs without warnings. ### alerta.line.set_x1 https://www.alertachart.com/alertascript/reference/builtins/line.set_x1 Signature: line.set_x1(id, x) Updates line start X coordinate. TradingView-compatible spelling: line.set_x1; runs without warnings. ### alerta.line.set_y1 https://www.alertachart.com/alertascript/reference/builtins/line.set_y1 Signature: line.set_y1(id, y) Updates line start Y coordinate. TradingView-compatible spelling: line.set_y1; runs without warnings. ### alerta.line.set_x2 https://www.alertachart.com/alertascript/reference/builtins/line.set_x2 Signature: line.set_x2(id, x) Updates line end X coordinate. TradingView-compatible spelling: line.set_x2; runs without warnings. ### alerta.line.set_y2 https://www.alertachart.com/alertascript/reference/builtins/line.set_y2 Signature: line.set_y2(id, y) Updates line end Y coordinate. TradingView-compatible spelling: line.set_y2; runs without warnings. ### alerta.line.set_color https://www.alertachart.com/alertascript/reference/builtins/line.set_color Signature: line.set_color(id, color) Updates line color. TradingView-compatible spelling: line.set_color; runs without warnings. ### alerta.line.set_width https://www.alertachart.com/alertascript/reference/builtins/line.set_width Signature: line.set_width(id, width) Updates line width. TradingView-compatible spelling: line.set_width; runs without warnings. ### alerta.line.set_extend https://www.alertachart.com/alertascript/reference/builtins/line.set_extend Signature: line.set_extend(id, extend) Updates line extend mode. TradingView-compatible spelling: line.set_extend; runs without warnings. ### alerta.line.set_style https://www.alertachart.com/alertascript/reference/builtins/line.set_style Signature: line.set_style(id, style) Updates line style (solid, dashed, dotted, etc.). TradingView-compatible spelling: line.set_style; runs without warnings. ### alerta.line.set_zindex https://www.alertachart.com/alertascript/reference/builtins/line.set_zindex Signature: line.set_zindex(line_id, zindex) Updates line z-index ordering. TradingView-compatible spelling: line.set_zindex; runs without warnings. ### alerta.line.delete https://www.alertachart.com/alertascript/reference/builtins/line.delete Signature: line.delete(id) Deletes a line object. TradingView-compatible spelling: line.delete; runs without warnings. ### alerta.line.get_x1 https://www.alertachart.com/alertascript/reference/builtins/line.get_x1 Signature: line.get_x1(id) Returns line start X coordinate. TradingView-compatible spelling: line.get_x1; runs without warnings. ### alerta.line.get_y1 https://www.alertachart.com/alertascript/reference/builtins/line.get_y1 Signature: line.get_y1(id) Returns line start Y coordinate. TradingView-compatible spelling: line.get_y1; runs without warnings. ### alerta.line.get_x2 https://www.alertachart.com/alertascript/reference/builtins/line.get_x2 Signature: line.get_x2(id) Returns line end X coordinate. TradingView-compatible spelling: line.get_x2; runs without warnings. ### alerta.line.get_y2 https://www.alertachart.com/alertascript/reference/builtins/line.get_y2 Signature: line.get_y2(id) Returns line end Y coordinate. TradingView-compatible spelling: line.get_y2; runs without warnings. ### alerta.line.get_price https://www.alertachart.com/alertascript/reference/builtins/line.get_price Signature: line.get_price(id, x) Returns interpolated price of a line at a target bar index. TradingView-compatible spelling: line.get_price; runs without warnings. ### alerta.box.new https://www.alertachart.com/alertascript/reference/builtins/box.new Signature: box.new(left, top, right, bottom, options) | box.new(left, top, right, bottom, bgcolor=, border_color=, border_width=) | box.new(left, top, right, bottom, border_color, border_width, border_style, extend, xloc, bgcolor, text, …) Creates a box object and returns its handle. Accepts the Alerta-canonical `options={...}` object form, the Pine v5/v6 direct-named-args dialect (`box.new(left, top, right, bottom, bgcolor=, border_color=, border_width=, extend=)`), and Pine's fully POSITIONAL form, whose optional order is `border_color, border_width, border_style, extend, xloc, bgcolor, text, text_size, text_color, text_halign, text_valign, text_wrap, text_font_family, force_overlay`. Note that `bgcolor` is the SIXTH optional, not the third. Snake-case aliases (`bg_color`, `border_color`, `border_style`) auto-map to canonical camelCase. All three forms produce identical output. TradingView-compatible spelling: box.new; runs without warnings. ### alerta.box.copy https://www.alertachart.com/alertascript/reference/builtins/box.copy Signature: box.copy(id) Creates a duplicate of an existing box and returns the new handle. TradingView-compatible spelling: box.copy; runs without warnings. ### alerta.box.get_left https://www.alertachart.com/alertascript/reference/builtins/box.get_left Signature: box.get_left(id) Returns box left coordinate. TradingView-compatible spelling: box.get_left; runs without warnings. ### alerta.box.get_right https://www.alertachart.com/alertascript/reference/builtins/box.get_right Signature: box.get_right(id) Returns box right coordinate. TradingView-compatible spelling: box.get_right; runs without warnings. ### alerta.box.get_top https://www.alertachart.com/alertascript/reference/builtins/box.get_top Signature: box.get_top(id) Returns box top price. TradingView-compatible spelling: box.get_top; runs without warnings. ### alerta.box.get_bottom https://www.alertachart.com/alertascript/reference/builtins/box.get_bottom Signature: box.get_bottom(id) Returns box bottom price. TradingView-compatible spelling: box.get_bottom; runs without warnings. ### alerta.box.set_left https://www.alertachart.com/alertascript/reference/builtins/box.set_left Signature: box.set_left(id, left) Updates box left coordinate. TradingView-compatible spelling: box.set_left; runs without warnings. ### alerta.box.set_top https://www.alertachart.com/alertascript/reference/builtins/box.set_top Signature: box.set_top(id, top) Updates box top price. TradingView-compatible spelling: box.set_top; runs without warnings. ### alerta.box.set_right https://www.alertachart.com/alertascript/reference/builtins/box.set_right Signature: box.set_right(id, right) Updates box right coordinate. TradingView-compatible spelling: box.set_right; runs without warnings. ### alerta.box.set_bottom https://www.alertachart.com/alertascript/reference/builtins/box.set_bottom Signature: box.set_bottom(id, bottom) Updates box bottom price. TradingView-compatible spelling: box.set_bottom; runs without warnings. ### alerta.box.set_border_color https://www.alertachart.com/alertascript/reference/builtins/box.set_border_color Signature: box.set_border_color(id, color) Updates box border color. TradingView-compatible spelling: box.set_border_color; runs without warnings. ### alerta.box.set_border_style https://www.alertachart.com/alertascript/reference/builtins/box.set_border_style Signature: box.set_border_style(id, style) Updates box border style token. TradingView-compatible spelling: box.set_border_style; runs without warnings. ### alerta.box.set_border_width https://www.alertachart.com/alertascript/reference/builtins/box.set_border_width Signature: box.set_border_width(id, width) Updates box border width. TradingView-compatible spelling: box.set_border_width; runs without warnings. ### alerta.box.set_bgcolor https://www.alertachart.com/alertascript/reference/builtins/box.set_bgcolor Signature: box.set_bgcolor(id, color) Updates box background color. TradingView-compatible spelling: box.set_bgcolor; runs without warnings. ### alerta.box.set_extend https://www.alertachart.com/alertascript/reference/builtins/box.set_extend Signature: box.set_extend(id, extend) Updates box extend mode. TradingView-compatible spelling: box.set_extend; runs without warnings. ### alerta.box.set_xloc https://www.alertachart.com/alertascript/reference/builtins/box.set_xloc Signature: box.set_xloc(id, left, right, xloc) Updates box left/right coordinates and X-location mode together. TradingView-compatible spelling: box.set_xloc; runs without warnings. ### alerta.box.set_text https://www.alertachart.com/alertascript/reference/builtins/box.set_text Signature: box.set_text(id, text) Updates text shown inside the box. TradingView-compatible spelling: box.set_text; runs without warnings. ### alerta.box.set_text_color https://www.alertachart.com/alertascript/reference/builtins/box.set_text_color Signature: box.set_text_color(id, text_color) Updates box text color. TradingView-compatible spelling: box.set_text_color; runs without warnings. ### alerta.box.set_text_halign https://www.alertachart.com/alertascript/reference/builtins/box.set_text_halign Signature: box.set_text_halign(id, text_halign) Updates horizontal alignment of box text. TradingView-compatible spelling: box.set_text_halign; runs without warnings. ### alerta.box.set_text_valign https://www.alertachart.com/alertascript/reference/builtins/box.set_text_valign Signature: box.set_text_valign(id, text_valign) Updates vertical alignment of box text. TradingView-compatible spelling: box.set_text_valign; runs without warnings. ### alerta.box.set_text_size https://www.alertachart.com/alertascript/reference/builtins/box.set_text_size Signature: box.set_text_size(id, text_size) Updates size of box text. TradingView-compatible spelling: box.set_text_size; runs without warnings. ### alerta.box.set_zindex https://www.alertachart.com/alertascript/reference/builtins/box.set_zindex Signature: box.set_zindex(box_id, zindex) Updates box z-index ordering. TradingView-compatible spelling: box.set_zindex; runs without warnings. ### alerta.box.delete https://www.alertachart.com/alertascript/reference/builtins/box.delete Signature: box.delete(id) Deletes a box object. TradingView-compatible spelling: box.delete; runs without warnings. ### alerta.label.new https://www.alertachart.com/alertascript/reference/builtins/label.new Signature: label.new(x, y, text, options) | label.new(x, y, text, color=, textcolor=, style=, size=) | label.new(x, y, text, xloc, yloc, color, style, textcolor, size, textalign, tooltip) Creates a label object and returns its handle. Accepts the Alerta-canonical `options={...}` object form, the Pine v5/v6 direct-named-args dialect (`label.new(x, y, text, color=, textcolor=, style=, size=, tooltip=)`), and Pine's fully POSITIONAL form, whose optional order is `xloc, yloc, color, style, textcolor, size, textalign, tooltip, text_font_family, force_overlay` — the order a wrapper function passes its parameters through. Snake-case `text_color` / `text_font_family` auto-map to `textColor` / `textFontFamily`. All three forms produce identical output. TradingView-compatible spelling: label.new; runs without warnings. ### alerta.label.copy https://www.alertachart.com/alertascript/reference/builtins/label.copy Signature: label.copy(id) Creates a duplicate of an existing label and returns the new handle. TradingView-compatible spelling: label.copy; runs without warnings. ### alerta.label.get_x https://www.alertachart.com/alertascript/reference/builtins/label.get_x Signature: label.get_x(id) Returns label X coordinate. TradingView-compatible spelling: label.get_x; runs without warnings. ### alerta.label.get_y https://www.alertachart.com/alertascript/reference/builtins/label.get_y Signature: label.get_y(id) Returns label Y coordinate. TradingView-compatible spelling: label.get_y; runs without warnings. ### alerta.label.get_text https://www.alertachart.com/alertascript/reference/builtins/label.get_text Signature: label.get_text(id) Returns label text. TradingView-compatible spelling: label.get_text; runs without warnings. ### alerta.label.set_xy https://www.alertachart.com/alertascript/reference/builtins/label.set_xy Signature: label.set_xy(id, x, y) Pine v6: set both x and y in a single call. TradingView-compatible spelling: label.set_xy; runs without warnings. ### alerta.label.set_xloc https://www.alertachart.com/alertascript/reference/builtins/label.set_xloc Signature: label.set_xloc(id, x, xloc) Pine v6: set the label's x-coordinate and switch xloc (bar_index | bar_time) at once. TradingView-compatible spelling: label.set_xloc; runs without warnings. ### alerta.label.set_textalign https://www.alertachart.com/alertascript/reference/builtins/label.set_textalign Signature: label.set_textalign(id, textalign) Updates label text alignment. TradingView-compatible spelling: label.set_textalign; runs without warnings. ### alerta.label.set_tooltip https://www.alertachart.com/alertascript/reference/builtins/label.set_tooltip Signature: label.set_tooltip(id, tooltip) Updates label tooltip content. TradingView-compatible spelling: label.set_tooltip; runs without warnings. ### alerta.polyline.new https://www.alertachart.com/alertascript/reference/builtins/polyline.new Signature: polyline.new(points, curved, closed, xloc, line_color, fill_color, line_style, line_width, force_overlay) Creates a polyline through an array of chart.point values. curved=true draws smooth segments, closed=true connects the last point back to the first (fill_color fills the enclosed area). TradingView-compatible spelling: polyline.new; runs without warnings. ### alerta.polyline.push https://www.alertachart.com/alertascript/reference/builtins/polyline.push Signature: polyline.push(polyline_id, x, y) Appends a point to an existing polyline. TradingView-compatible spelling: polyline.push; runs without warnings. ### alerta.polyline.delete https://www.alertachart.com/alertascript/reference/builtins/polyline.delete Signature: polyline.delete(id) Deletes a polyline object. TradingView-compatible spelling: polyline.delete; runs without warnings. ### alerta.label.set_x https://www.alertachart.com/alertascript/reference/builtins/label.set_x Signature: label.set_x(id, x) Updates label X coordinate. TradingView-compatible spelling: label.set_x; runs without warnings. ### alerta.label.set_y https://www.alertachart.com/alertascript/reference/builtins/label.set_y Signature: label.set_y(id, y) Updates label Y coordinate. TradingView-compatible spelling: label.set_y; runs without warnings. ### alerta.label.set_text https://www.alertachart.com/alertascript/reference/builtins/label.set_text Signature: label.set_text(id, text) Updates label text. TradingView-compatible spelling: label.set_text; runs without warnings. ### alerta.label.set_zindex https://www.alertachart.com/alertascript/reference/builtins/label.set_zindex Signature: label.set_zindex(label_id, zindex) Updates label z-index ordering. TradingView-compatible spelling: label.set_zindex; runs without warnings. ### alerta.label.set_color https://www.alertachart.com/alertascript/reference/builtins/label.set_color Signature: label.set_color(id, color) Updates label background color. TradingView-compatible spelling: label.set_color; runs without warnings. ### alerta.label.set_textcolor https://www.alertachart.com/alertascript/reference/builtins/label.set_textcolor Signature: label.set_textcolor(id, textcolor) Updates label text color. TradingView-compatible spelling: label.set_textcolor; runs without warnings. ### alerta.label.set_size https://www.alertachart.com/alertascript/reference/builtins/label.set_size Signature: label.set_size(id, size) Updates label size. TradingView-compatible spelling: label.set_size; runs without warnings. ### alerta.label.set_style https://www.alertachart.com/alertascript/reference/builtins/label.set_style Signature: label.set_style(id, style) Updates label style token. TradingView-compatible spelling: label.set_style; runs without warnings. ### alerta.label.set_location https://www.alertachart.com/alertascript/reference/builtins/label.set_location Signature: label.set_location(label_id, location) Updates label location mode. TradingView-compatible spelling: label.set_location; runs without warnings. ### alerta.label.delete https://www.alertachart.com/alertascript/reference/builtins/label.delete Signature: label.delete(id) Deletes a label object. TradingView-compatible spelling: label.delete; runs without warnings. ### alerta.chart.point.new https://www.alertachart.com/alertascript/reference/builtins/chart.point.new Signature: chart.point.new(time, index, price) → chart.point Constructs a Pine v6 `chart.point` from explicit time, index, and price. Used as a coordinate argument to line.new/box.new/label.new/polyline.new. `chart.point` is also usable as a TYPE ANNOTATION, including the array shorthand: `var chart.point[] pts = array.new(0)` and `f(chart.point[] pts) =>`. TradingView-compatible spelling: chart.point.new; runs without warnings. ### alerta.chart.point.from_index https://www.alertachart.com/alertascript/reference/builtins/chart.point.from_index Signature: chart.point.from_index(index, price) → chart.point Pine v6: creates a chart.point at a given bar index; time is auto-derived from the bar at that index. TradingView-compatible spelling: chart.point.from_index; runs without warnings. ### alerta.chart.point.from_time https://www.alertachart.com/alertascript/reference/builtins/chart.point.from_time Signature: chart.point.from_time(time, price) → chart.point Pine v6: creates a chart.point at a given timestamp; bar index is resolved at draw time. TradingView-compatible spelling: chart.point.from_time; runs without warnings. ### alerta.chart.point.now https://www.alertachart.com/alertascript/reference/builtins/chart.point.now Signature: chart.point.now(price) → chart.point Pine v6: chart.point at the current bar with the given price (close when none is given). TradingView-compatible spelling: chart.point.now; runs without warnings. ### alerta.chart.point.copy https://www.alertachart.com/alertascript/reference/builtins/chart.point.copy Signature: chart.point.copy(point) → chart.point Pine v6: returns a shallow copy of a chart.point. TradingView-compatible spelling: chart.point.copy; runs without warnings. ### alerta.polyline.set_curved https://www.alertachart.com/alertascript/reference/builtins/polyline.set_curved Signature: polyline.set_curved(id, curved) Pine v6: enables/disables curve smoothing on a polyline. TradingView-compatible spelling: polyline.set_curved; runs without warnings. ### alerta.polyline.set_closed https://www.alertachart.com/alertascript/reference/builtins/polyline.set_closed Signature: polyline.set_closed(id, closed) Pine v6: when true, the polyline closes back to its first point. TradingView-compatible spelling: polyline.set_closed; runs without warnings. ### alerta.polyline.set_xloc https://www.alertachart.com/alertascript/reference/builtins/polyline.set_xloc Signature: polyline.set_xloc(id, xloc) Pine v6: switches x-axis between bar_index and bar_time. TradingView-compatible spelling: polyline.set_xloc; runs without warnings. ### alerta.polyline.set_line_color https://www.alertachart.com/alertascript/reference/builtins/polyline.set_line_color Signature: polyline.set_line_color(id, line_color) Pine v6: sets the polyline stroke color. TradingView-compatible spelling: polyline.set_line_color; runs without warnings. ### alerta.polyline.set_fill_color https://www.alertachart.com/alertascript/reference/builtins/polyline.set_fill_color Signature: polyline.set_fill_color(id, fill_color) Pine v6: sets the polyline interior fill color (applies when closed=true). TradingView-compatible spelling: polyline.set_fill_color; runs without warnings. ### alerta.polyline.set_line_style https://www.alertachart.com/alertascript/reference/builtins/polyline.set_line_style Signature: polyline.set_line_style(id, line_style) Pine v6: solid | dashed | dotted. TradingView-compatible spelling: polyline.set_line_style; runs without warnings. ### alerta.polyline.set_line_width https://www.alertachart.com/alertascript/reference/builtins/polyline.set_line_width Signature: polyline.set_line_width(id, line_width) Pine v6: polyline stroke width in pixels. TradingView-compatible spelling: polyline.set_line_width; runs without warnings. ### alerta.polyline.set_points https://www.alertachart.com/alertascript/reference/builtins/polyline.set_points Signature: polyline.set_points(id, points) Pine v6: replaces the polyline's point array with a new array. TradingView-compatible spelling: polyline.set_points; runs without warnings. ### alerta.polyline.delete_all https://www.alertachart.com/alertascript/reference/builtins/polyline.delete_all Signature: polyline.delete_all() Pine v6: deletes every polyline created by the script in one call. TradingView-compatible spelling: polyline.delete_all; runs without warnings. ### alerta.polyline.all https://www.alertachart.com/alertascript/reference/builtins/polyline.all Signature: polyline.all → array Pine v6: read-only array containing every active polyline handle. TradingView-compatible spelling: polyline.all; runs without warnings. ### alerta.line.all https://www.alertachart.com/alertascript/reference/builtins/line.all Signature: line.all → array An array of every line the script has drawn and not deleted, oldest first. It is a new array on every read, so deleting lines while walking it — `for l in line.all` then `line.delete(l)`, or `array.get(line.all, i)` in a counted loop — deletes them all. TradingView-compatible spelling: line.all; runs without warnings. ### alerta.line.delete_all https://www.alertachart.com/alertascript/reference/builtins/line.delete_all Signature: line.delete_all() Pine v6: deletes every line created by the script. TradingView-compatible spelling: line.delete_all; runs without warnings. ### alerta.label.all https://www.alertachart.com/alertascript/reference/builtins/label.all Signature: label.all → array