Skip to content
AlertaChartAlertaScript / docs
AlertaScript / Core

Reference

Core

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

Name / SignatureDescriptionReturns
alerta.ta.highesthighest(source, length)Returns the highest value of source for length bars back.series float
alerta.ta.highestbarshighestbars(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.series int
alerta.ta.lowestlowest(source, length)Returns the lowest value of source for length bars back.series float
alerta.ta.lowestbarslowestbars(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.series int
alerta.highestindexhighestindex(source, length)Returns the absolute index of the highest value of source for length bars.series int
alerta.lowestindexlowestindex(source, length)Returns the absolute index of the lowest value of source for length bars.series int
alerta.ta.crossovercrossover(a, b)Returns true if `a` crossed above `b`.series bool
alerta.ta.crossundercrossunder(a, b)Returns true if `a` crossed below `b`.series bool
alerta.ta.crossta.cross(a, b)Returns true when `a` crosses `b` in either direction.series bool
alerta.ta.changechange(source, length)Difference between current value and previous value (length bars ago).series float
alerta.ta.valuewhenvaluewhen(condition, source, occurrence)Returns the value of `source` when `condition` was last true.series any
hlcc4hlcc4 → series floatPine v6: shortcut for `(high + low + close + close) / 4`. Close is counted twice, giving more weight to the close price.series float
askask → series floatPine v6: lowest price an active seller will accept for the instrument. Only available on the "1T" timeframe. On AlertaChart it is always `na`, tick charts included: scripts do not receive the order book's best prices.series float
bidbid → series floatPine v6: highest price an active buyer is willing to pay. Only available on the "1T" timeframe. On AlertaChart it is always `na`, tick charts included: scripts do not receive the order book's best prices.series float
openopen → series floatOpening price of each chart bar.series float
highhigh → series floatHighest traded price in each chart bar.series float
lowlow → series floatLowest traded price in each chart bar.series float
closeclose → series floatClosing price of each historical bar, or the latest price of the current bar.series float
volumevolume → series floatVolume supplied by the chart data provider for each bar; units and availability depend on the instrument.series float
hl2hl2 → series floatAverage of the high and low of each bar: (high + low) / 2.series float
hlc3hlc3 → series floatAverage of the high, low and close of each bar: (high + low + close) / 3.series float
ohlc4ohlc4 → series floatAverage of each bar’s open, high, low and close.series float
history-operatorexpression[offset]expression[n] reads the value expression had n bars ago: close[1] is the previous bar's close, high[10] the high ten bars back. Where there is no such bar — the first bars of the chart — the result is na. The offset may be any non-negative int, also one that changes from bar to bar.the value offset bars back, or na
AlertaScript

No results found.

Search by name, alias, or keyword.