Reference
Data requests
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.
| Name / Signature | Description | Returns |
|---|---|---|
| alerta.request.securityrequest.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. | series any |
| alerta.request.financialrequest.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`. | series float — na without a fundamentals feed |
| alerta.request.earningsrequest.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. | series float — na without a fundamentals feed |
| alerta.request.dividendsrequest.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. | series float — na without a fundamentals feed |
| alerta.request.splitsrequest.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. | series float — na without a fundamentals feed |
| alerta.request.footprintrequest.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, forex. | series footprint — na where the bar has no order flow |
| alerta.request.security_lower_tfrequest.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`. | array<any> — one array per bar; a tuple expression returns one array per member |
| alerta.ticker.newticker.new(prefix, ticker, session?, adjustment?, backadjustment?, settlement_as_close?) → string | Pine v6: builds a ticker ID string from prefix + symbol (+ optional session and adjustment). With modifiers it is TradingView's `={"session":"regular","symbol":"NASDAQ:NVDA"}` form. Pass the result to `request.security()`: the request reads the plain symbol, and `session.regular` keeps a stock's intraday bars to its regular hours. | string |
| alerta.ticker.modifyticker.modify(tickerid, session?, adjustment?, backadjustment?, settlement_as_close?) → string | Pine v6: clones a ticker ID with a different session or adjustment (the ID's own modifiers kept where no new one is given). | string |
| alerta.ticker.heikinashiticker.heikinashi(symbol) → string | Pine v6: returns a Heikin-Ashi ticker ID for the given symbol. request.security builds the Heikin-Ashi bars from that symbol's own bars at the requested timeframe. | string |
| alerta.ticker.renkoticker.renko(symbol, style?, arg?) → string | Pine v6: returns a Renko ticker ID. AlertaChart does not build Renko bars: request.security on this ticker returns na with a warning. | string |
| alerta.ticker.linebreakticker.linebreak(symbol, lines?) → string | Pine v6: returns a Line-Break ticker ID. AlertaChart does not build Line Break bars: request.security on this ticker returns na with a warning. | string |
| alerta.ticker.kagiticker.kagi(symbol, reversal?) → string | Pine v6: returns a Kagi ticker ID. AlertaChart does not build Kagi bars: request.security on this ticker returns na with a warning. | string |
| alerta.ticker.pointfigureticker.pointfigure(symbol, source?, style?, boxSize?, reversal?) → string | Pine v6: returns a Point-and-Figure ticker ID. AlertaChart does not build Point & Figure bars: request.security on this ticker returns na with a warning. | string |
| alerta.ticker.inheritticker.inherit(from_tickerid, symbol) → string | Pine v6: builds a ticker that inherits the alternative-feed type of `from_tickerid` (HA/Renko/Kagi/PF) but uses a different symbol. From a plain chart the result is simply `symbol`, so `request.security(ticker.inherit(syminfo.tickerid, other), …)` fetches `other`. | string |
| alerta.ticker.standardticker.standard(symbol?) → string | Pine v6: returns the standard ticker ID for the given symbol — no chart type (Heikin-Ashi, Renko, …) and no session or adjustment modifiers. | string |
| alerta.ticker.pricescaleticker.pricescale() → int | Pine v6: returns the price scale (1/mintick) of the symbol. | int |
| alerta.ticker.mintickticker.mintick() → float | Pine v6: returns the minimum price increment for the symbol. | float |
| alerta.adjustment.noneadjustment.none → string | Pine v5/v6: No price adjustment. | string |
| alerta.adjustment.splitsadjustment.splits → string | Pine v5/v6: Adjust historical prices for stock splits. | string |
| alerta.adjustment.dividendsadjustment.dividends → string | Pine v5/v6: Adjust historical prices for dividends. | string |
| alerta.backadjustment.inheritbackadjustment.inherit → string | Pine v6: Inherit back-adjustment from source ticker (default). | string |
| alerta.backadjustment.onbackadjustment.on → string | Pine v6: Apply back-adjustment to continuous futures contract history. | string |
| alerta.backadjustment.offbackadjustment.off → string | Pine v6: Disable back-adjustment. | string |
| alerta.settlement_as_close.inheritsettlement_as_close.inherit → string | Pine v6: Inherit settlement-as-close setting (default). | string |
| alerta.settlement_as_close.onsettlement_as_close.on → string | Pine v6: Use settlement price as close on 1D+ timeframes. | string |
| alerta.settlement_as_close.offsettlement_as_close.off → string | Pine v6: Use actual session close. | string |
| footprintfootprint | Pine v6 type returned by `request.footprint()`: one bar's volume footprint — its buy and sell volume by price row, POC, value area and imbalances. Read it with the `footprint.*()` functions or as methods (`fp.poc()`). On AlertaChart it is built from the chart symbol's own order flow; na where there is none. | type |
| volume_rowvolume_row | Pine v6 type for one price row of a `footprint`: its price bounds, buy and sell volume and diagonal imbalances. Returned by `footprint.rows()`, `footprint.poc()`, `footprint.vah()`, `footprint.val()` and `footprint.get_row_by_price()`. | type |
| alerta.footprint.buy_volumefootprint.buy_volume(id) → series float | The bar's total buy (taker, ask-side) volume. Exactly the sum of its order-flow buckets' buy volume, whatever the row size. | series float |
| alerta.footprint.sell_volumefootprint.sell_volume(id) → series float | The bar's total sell (taker, bid-side) volume. | series float |
| alerta.footprint.total_volumefootprint.total_volume(id) → series float | Buy plus sell volume of the bar. | series float |
| alerta.footprint.deltafootprint.delta(id) → series float | Buy minus sell volume of the bar — its volume delta. The same at any ticks_per_row. | series float |
| alerta.footprint.pocfootprint.poc(id) → volume_row | The row with the most volume (Point of Control). On a tie, the row nearest the bar's volume-weighted price. | volume_row — na when the bar has no volume |
| alerta.footprint.vahfootprint.vah(id) → volume_row | The top row of the value area. The value area grows from the POC one row at a time — whichever neighbouring row holds more volume, the upper one on a tie — until it holds va_percent of the bar's volume. | volume_row |
| alerta.footprint.valfootprint.val(id) → volume_row | The bottom row of the value area (see footprint.vah). | volume_row |
| alerta.footprint.rowsfootprint.rows(id) → array<volume_row> | Every row of the bar, lowest price first: from the lowest traded row to the highest, rows between them included. Each row spans ticks_per_row × syminfo.mintick on a fixed price grid; a trade at price p is in the row whose up_price is p rounded up to that grid. | array<volume_row> |
| alerta.footprint.get_row_by_pricefootprint.get_row_by_price(id, price) → volume_row | The row holding a price (down_price < price ≤ up_price), or na outside the bar's rows. | volume_row — na outside the bar's rows |
| alerta.volume_row.up_pricevolume_row.up_price(id) → series float | The row's upper price bound. | series float |
| alerta.volume_row.down_pricevolume_row.down_price(id) → series float | The row's lower price bound (up_price − ticks_per_row × syminfo.mintick). | series float |
| alerta.volume_row.buy_volumevolume_row.buy_volume(id) → series float | The row's buy (taker, ask-side) volume. | series float |
| alerta.volume_row.sell_volumevolume_row.sell_volume(id) → series float | The row's sell (taker, bid-side) volume. | series float |
| alerta.volume_row.total_volumevolume_row.total_volume(id) → series float | The row's buy plus sell volume. | series float |
| alerta.volume_row.deltavolume_row.delta(id) → series float | The row's buy minus sell volume. | series float |
| alerta.volume_row.has_buy_imbalancevolume_row.has_buy_imbalance(id) → series bool | Whether the row's buy volume is at least imbalance_percent / 100 times the sell volume of the row BELOW it (the diagonal comparison of a footprint chart). A zero on either side is no imbalance, so the bottom row never has one. | series bool |
| alerta.volume_row.has_sell_imbalancevolume_row.has_sell_imbalance(id) → series bool | Whether the row's sell volume is at least imbalance_percent / 100 times the buy volume of the row ABOVE it. A zero on either side is no imbalance, so the top row never has one. | series bool |
| alerta.request.currency_raterequest.currency_rate(from, to, ignore_invalid_currency) → series float | Pine v6: the daily rate that converts `from` into `to`, from AlertaChart's own feeds — two fiat currencies read the forex pair (a pair carried only the other way round, e.g. USD→EUR from EURUSD, is inverted), a coin against the dollar reads its USDT pair (and the inverse for USD→coin). Identical currencies (and USD/USDT/USDC) are exactly 1.0; any other combination returns na with a warning. | series float |
| alerta.request.economicrequest.economic(country_code, field, gaps?, ignore_invalid_symbol?) → series float | Pine v6: an economic series of a country — the ECONOMICS:<country><field> symbol — read at the chart's timeframe. AlertaChart carries the US headline series: GDP (USGDP), IRYY inflation rate (USIRYY), INTR interest rate (USINTR), UR unemployment rate (USUR), BOT balance of trade (USBOT) and DEBT government debt (USDEBT), monthly. Any other country or field returns na with a warning. | series float |
| alerta.barmerge.gaps_offbarmerge.gaps_off → const bool | Gap or lookahead option for a request.security() call. Use barmerge.gaps_off as a value, without parentheses. | const bool |
| alerta.barmerge.gaps_onbarmerge.gaps_on → const bool | Gap or lookahead option for a request.security() call. Use barmerge.gaps_on as a value, without parentheses. | const bool |
| alerta.barmerge.lookahead_offbarmerge.lookahead_off → const bool | Gap or lookahead option for a request.security() call. Use barmerge.lookahead_off as a value, without parentheses. | const bool |
| alerta.barmerge.lookahead_onbarmerge.lookahead_on → const bool | Gap or lookahead option for a request.security() call. Use barmerge.lookahead_on as a value, without parentheses. | const bool |
| alerta.currency.AEDcurrency.AED → const string | Currency identifier accepted by strategy and data-request settings. Use currency.AED as a value, without parentheses. | const string |
| alerta.currency.ARScurrency.ARS → const string | Currency identifier accepted by strategy and data-request settings. Use currency.ARS as a value, without parentheses. | const string |
| alerta.currency.AUDcurrency.AUD → const string | Currency identifier accepted by strategy and data-request settings. Use currency.AUD as a value, without parentheses. | const string |
| alerta.currency.BRLcurrency.BRL → const string | Currency identifier accepted by strategy and data-request settings. Use currency.BRL as a value, without parentheses. | const string |
| alerta.currency.BTCcurrency.BTC → const string | Currency identifier accepted by strategy and data-request settings. Use currency.BTC as a value, without parentheses. | const string |
| alerta.currency.CADcurrency.CAD → const string | Currency identifier accepted by strategy and data-request settings. Use currency.CAD as a value, without parentheses. | const string |
| alerta.currency.CHFcurrency.CHF → const string | Currency identifier accepted by strategy and data-request settings. Use currency.CHF as a value, without parentheses. | const string |
| alerta.currency.CNYcurrency.CNY → const string | Currency identifier accepted by strategy and data-request settings. Use currency.CNY as a value, without parentheses. | const string |
| alerta.currency.DKKcurrency.DKK → const string | Currency identifier accepted by strategy and data-request settings. Use currency.DKK as a value, without parentheses. | const string |
| alerta.currency.ETHcurrency.ETH → const string | Currency identifier accepted by strategy and data-request settings. Use currency.ETH as a value, without parentheses. | const string |
| alerta.currency.EURcurrency.EUR → const string | Currency identifier accepted by strategy and data-request settings. Use currency.EUR as a value, without parentheses. | const string |
| alerta.currency.GBPcurrency.GBP → const string | Currency identifier accepted by strategy and data-request settings. Use currency.GBP as a value, without parentheses. | const string |
| alerta.currency.HKDcurrency.HKD → const string | Currency identifier accepted by strategy and data-request settings. Use currency.HKD as a value, without parentheses. | const string |
| alerta.currency.IDRcurrency.IDR → const string | Currency identifier accepted by strategy and data-request settings. Use currency.IDR as a value, without parentheses. | const string |
| alerta.currency.ILScurrency.ILS → const string | Currency identifier accepted by strategy and data-request settings. Use currency.ILS as a value, without parentheses. | const string |
| alerta.currency.INRcurrency.INR → const string | Currency identifier accepted by strategy and data-request settings. Use currency.INR as a value, without parentheses. | const string |
| alerta.currency.JPYcurrency.JPY → const string | Currency identifier accepted by strategy and data-request settings. Use currency.JPY as a value, without parentheses. | const string |
| alerta.currency.KRWcurrency.KRW → const string | Currency identifier accepted by strategy and data-request settings. Use currency.KRW as a value, without parentheses. | const string |
| alerta.currency.MXNcurrency.MXN → const string | Currency identifier accepted by strategy and data-request settings. Use currency.MXN as a value, without parentheses. | const string |
| alerta.currency.MYRcurrency.MYR → const string | Currency identifier accepted by strategy and data-request settings. Use currency.MYR as a value, without parentheses. | const string |
| alerta.currency.NOKcurrency.NOK → const string | Currency identifier accepted by strategy and data-request settings. Use currency.NOK as a value, without parentheses. | const string |
| alerta.currency.NONEcurrency.NONE → const string | Currency identifier accepted by strategy and data-request settings. Use currency.NONE as a value, without parentheses. | const string |
| alerta.currency.NZDcurrency.NZD → const string | Currency identifier accepted by strategy and data-request settings. Use currency.NZD as a value, without parentheses. | const string |
| alerta.currency.PHPcurrency.PHP → const string | Currency identifier accepted by strategy and data-request settings. Use currency.PHP as a value, without parentheses. | const string |
| alerta.currency.PLNcurrency.PLN → const string | Currency identifier accepted by strategy and data-request settings. Use currency.PLN as a value, without parentheses. | const string |
| alerta.currency.RUBcurrency.RUB → const string | Currency identifier accepted by strategy and data-request settings. Use currency.RUB as a value, without parentheses. | const string |
| alerta.currency.SARcurrency.SAR → const string | Currency identifier accepted by strategy and data-request settings. Use currency.SAR as a value, without parentheses. | const string |
| alerta.currency.SEKcurrency.SEK → const string | Currency identifier accepted by strategy and data-request settings. Use currency.SEK as a value, without parentheses. | const string |
| alerta.currency.SGDcurrency.SGD → const string | Currency identifier accepted by strategy and data-request settings. Use currency.SGD as a value, without parentheses. | const string |
| alerta.currency.THBcurrency.THB → const string | Currency identifier accepted by strategy and data-request settings. Use currency.THB as a value, without parentheses. | const string |
| alerta.currency.TRYcurrency.TRY → const string | Currency identifier accepted by strategy and data-request settings. Use currency.TRY as a value, without parentheses. | const string |
| alerta.currency.TWDcurrency.TWD → const string | Currency identifier accepted by strategy and data-request settings. Use currency.TWD as a value, without parentheses. | const string |
| alerta.currency.USDcurrency.USD → const string | Currency identifier accepted by strategy and data-request settings. Use currency.USD as a value, without parentheses. | const string |
| alerta.currency.USDCcurrency.USDC → const string | Currency identifier accepted by strategy and data-request settings. Use currency.USDC as a value, without parentheses. | const string |
| alerta.currency.USDTcurrency.USDT → const string | Currency identifier accepted by strategy and data-request settings. Use currency.USDT as a value, without parentheses. | const string |
| alerta.currency.VNDcurrency.VND → const string | Currency identifier accepted by strategy and data-request settings. Use currency.VND as a value, without parentheses. | const string |
| alerta.currency.ZARcurrency.ZAR → const string | Currency identifier accepted by strategy and data-request settings. Use currency.ZAR as a value, without parentheses. | const string |