Navigation: Realtest Script Language > Syntax Element Categories > Multi-Bar Functions

Calculate any expression across multiple bars of any data series going back in time from the current bar. To start at an earlier bar, use the function()[offset] syntax. Any parameter of a function, as well as the offset (if provided) can be a literal number, a single value, or a formula.

Correl - correlation of two series

CountTrue - count of all bars for which expression was true

DateBars - count of bars since (or until) a specific date

EMA or XAvg - exponential moving average

HMA or HAvg - Hull moving average

Highest or HHV - highest value

KAMA - Kaufman adaptive moving averate

Kurtosis - sample kurtosis

LinReg - linear regression

Lowest or LLV - lowest value

MA or Avg - simple moving average

Median - median of values

Peak - value of nth most recent peak followed by an n% drop (does not look ahead)

PeakBars - count of bars since nth such Peak

PercentRank - percent rank among values

PercentRankN - value with nth percent rank

Product - product of values

Rank - numeric rank among values

RankN - value with nth numeric rank

ROC or PctChg - %gain/loss

RsiF - RSI as a function

SarF - SAR as a function

Sequence - check for a sequence of conditions within a specific number of bars

SinceHigh - bars since highest value

SinceLow - bars since lowest value

SinceTrue - bars since expression was true (0 if now, -1 if never)

Skewness - sample skewness

Slope - slope of linear regression

Spearman - Spearman's Rank Correlation

StdDev - standard deviation

Sum - sum of values

SumSince - sum of values since condition was true

SumSQ - sum of squared values

Trough - value of nth most recent trough followed by an n% rise (does not look ahead)

TroughBars - count of bars since nth such Trough

TrueInRow - count of bars in a row for which expression was true

UntilTrue - bars until expression will be true (0 if now, -1 if never)

WhenTrue - value when expression was true (or will be true if count < 0)

WMA or WAvg - weighted moving average

YInt - y-intercept of linear regression