Home › Documentation › Data & indicators
Block 1

Technical indicators

An indicator turns the price series into a number that summarizes how the market is behaving. AniQuant computes the indicator for every bar and generates entry conditions automatically.

SMA

Simple Moving Average

SMA(Source, N)

Arithmetic mean of the last N closes. It smooths out short-term noise. The longer the period, the slower and smoother it gets.

// 20-bar SMA on the close
SMA(Close, 20) = sum of the last 20 closes / 20
Parameters: Source (O/H/L/C) · Period (≥ 1)

RSI

Relative Strength Index

RSI(Source, N)

Momentum oscillator between 0 and 100. It measures how fast price is moving. Classic reading: overbought > 70, oversold < 30.

// RSI 14 in oversold territory
RSI(Close, 14) < 30
Parameters: Source · Period (≥ 2, classic: 14)

Full catalog

29 indicators

All of them are available in the Mass Test and in the export to EasyLanguage / MQL5 / ProRealTime / AmiBroker. The chart offers a curated visual subset (Moving averages, Trend, Bollinger, Donchian, Keltner, RSI, MACD, Volume).

Moving averages and trend
  • SMA · simple moving average
  • EMA · exponential moving average
Oscillators
  • RSI · 0–100
  • ADX · trend strength
  • MACD · Line / Signal / Hist
  • WilliamsR · 0…−100
  • ROC · momentum %
Volatility and bands
  • ATR · average true range
  • BB · Bollinger (Upper/Mid/Lower)
  • KC · Keltner = EMA ± 2·ATR
Extremes and channels
  • Lowest · lowest of N bars
  • Highest · highest of N bars
  • DC · Donchian (Upper/Mid/Lower)
Price series
  • OPEN / HIGH / LOW / CLOSE
  • with a bar [n] offset
Calendar filters
  • DayOfWeek · 0=Sun … 6=Sat
  • HourOfDay · 0 … 23
  • WeekOfMonth · 1=first … 5=fifth
  • DayOfMonth · day of month 1 … 31
  • Month · month 1 … 12
  • MinuteOfDay · minute of day 0 … 1439
  • DayOfYear · day of year 1 … 366
Momentum and counting
  • ConsecutiveBarsUp · N closes up in a row
  • ConsecutiveBarsDown · N closes down in a row
  • 0/1 filters; the N parameter (1…x) can be swept
📏

ValueChart: price measured in «typical bars»

By Mark Helweg and David Stendahl (Dynamic Trading Indicators, 2002). It answers how many typical bars is the price from its recent average? The centre is the average of the midpoints (H+L)/2 of the last N bars; the unit is one fifth of the average bar range. There are four: ValueClose, ValueHigh, ValueLow and ValueOpen, depending on the price being measured. Classic period: 5.

It is normalised: a +6 means the same on the ES in 2000 as today, or on gold. Between −4 and +4 is noise; above +8 or below −8 is an extreme, and the price usually returns towards the centre. On the 5-minute ES, the close is outside ±8 on about 4 % of the bars. It works in the Laboratory, in Genesis (thresholds −8 to +8), on the GPU and on all six platforms.

// Extreme drop: possible bounce
ValueLow(5) < -8
// Less stretched than the previous bar
ValueClose(5) > ValueClose(5)[1]
⚓

Anchored average: the average price paid since the last extreme

AnchoredLow(N) finds, among the previous N sessions, the one with the lowest low and averages the typical price (H+L+C)/3 of every bar from the start of that session to the current one. AnchoredHigh(N) does the same from the session with the highest high. It is a price level, like SuperTrend: use it against the close or with crosses. It answers is price above or below what, on average, those who bought since the turn paid?

Sessions come from the data itself (the gaps), just like the session close; on daily data, each bar is a session. It does not use volume: in our October 2026 study, the anchored VWAP added nothing over the simple average from the same anchor. It works in the Laboratory, in Genesis (N from 10 to 40), on the GPU and on all six platforms. In TradeStation, MetaTrader 5, AmiBroker and TradingView a session starts after a gap of more than one hour; in NinjaTrader and ProRealTime, with the platform's own session.

// Loses the average price paid since the low
Close crosses below AnchoredLow(20)
// Recovers the average price paid since the high
Close crosses above AnchoredHigh(20)
📐

Pivots and previous period levels

Seven price levels taken from the period already finished, never from the one in progress. PrevHigh(t), PrevLow(t), PrevOpen(t) and PrevClose(t) are the high, low, open and close of the previous period: t = 1 the day, 2 the week (Monday to Sunday), 3 the month and 4 the session. The classic pivots come from the previous session (on daily data, the previous bar): PivotP = (H + L + C) / 3, and PivotS(k) and PivotR(k) the supports and resistances S1 to S3 and R1 to R3.

They are used with the close or with crosses, and above all as the level of a Stop or Limit order. As the parameter is small (1 to 3, or 1 to 4), the Lab and Genesis sweep them like a period. They are exported to all six platforms.

// Closes above yesterday's high
Close crosses above PrevHigh(1)
// Buys at the pivot S2
EntryOrder: limit at PivotS(2) valid 1 bars
🧭

Trend and regime: Kalman, Variance Ratio and CUSUM

KalmanTrend(N) is a Kalman filter with two states, level and slope: on each bar it predicts the price with the slope and corrects it with the error. It follows the trend with less lag than an average of the same smoothness, and it is a price level, like SuperTrend. KalmanSlopeT(N) is its slope divided by its uncertainty: above 2, a clear uptrend; below −2, a downtrend; near 0, no trend. It reads the same on any market and timeframe.

VarianceRatio(Q), by Lo and MacKinlay, tells you what kind of market you are in. It compares the variance of Q-bar changes with Q times that of one-bar changes, over a window of 25·Q bars. Near 1, a random walk; above, changes add up (trend); below, they cancel out (mean reversion). Index futures usually sit slightly below 1.

CUSUM_Up(K) and CUSUM_Dn(K) are 1-or-0 events, López de Prado’s CUSUM filter. They accumulate the rises (or the falls) without counting the pullbacks that cancel them, and equal 1 on the bar where the total reaches K deviations of the previous 20 changes; then they start again. They mark the start of moves without relying on any average. With K = 3, on daily NQ one fires every 8 bars. All four work in the Lab, in Genesis, on the GPU and on the six platforms.

// Significant uptrend
KalmanSlopeT(20) > 2
// Mean-reverting market: buy the dips
VarianceRatio(4) < 0.8
// Back above the Kalman line
Close crosses above KalmanTrend(20)
// An up move starts
CUSUM_Up(3) = 1
🌙

Connors RSI, opening range and overnight return

ConnorsRSI(N), by Connors and Alvarez, is a 0-to-100 oscillator for short-term mean reversion. It is the average of three things: the N-bar RSI of the close, the 2-bar RSI of the streak (consecutive up bars count +1, +2, +3…; down bars, −1, −2…) and the percentile rank of today’s change among the previous 100. Below 10-15 it marks an exaggerated drop; above 85-90, an exaggerated rise.

OpeningRangeHigh(N) and OpeningRangeLow(N) are the high and the low of the first N minutes of the regular session of each day, Crabel’s opening range. While it forms they are the range so far, and then they stay fixed until the next day. They are price levels: against the close, with crosses or as the level of a Stop order. They only make sense intraday and with bars of 30 minutes or less.

NightReturn(N) is how much the price moved outside the regular session: from one day’s regular close to the next day’s open, in %, summed over the last N days. Today’s counts from the open. DayReturn(N) is how much it moved during it, from the open to the close, summed over the last N finished days. On 5-minute NQ, since 2000 the night adds up to +121% and the regular session to +34%. On daily bars, the night is from Close[1] to Open and the day from Open to Close.

Where does the regular session come from? From the instrument’s regular session in the Quote Manager (for @ES and @NQ, CME’s: 08:30 to 15:15 Chicago time). AniQuant moves it to your data’s time by looking at when each session starts in them, so there is no time zone to type: with 23-hour data in Spanish time it gives 15:30 to 22:15. If the instrument has no regular session, or the data are regular-session only, the data’s own session is used. When exporting, the time is written in the file’s time; if your chart uses another one, adjust it.

// Exaggerated short-term drop
ConnorsRSI(3) < 15
// Breaks the first 30 minutes’ range
Close crosses above OpeningRangeHigh(30)
// The night pulls harder than the day
NightReturn(10) > DayReturn(10)
// Stop at the opening range high
EntryOrder: stop at OpeningRangeHigh(30) valid 1 bars
📐

Classic momentum and OHLC volatility: TSI, KST, Coppock, CMO, Yang-Zhang and Garman-Klass

TSI(N) (William Blau) is the change of the close smoothed twice (exponential averages of N and 13) divided by its absolute value smoothed the same way: it goes from −100 to 100 and above 0 there is buying pressure. KST (Martin Pring) adds up four price speeds (smoothed 10, 15, 20 and 30-bar ROCs, with more weight on the slow ones) and KST_Signal is its 9-bar average: the cross of the two is the classic signal. Coppock(N) (1962) is a weighted average of ROC14 + ROC11 designed for bottoms: the classic buy is turning up below 0. CMO(N) (Tushar Chande) compares the sum of up moves with that of down moves over the last N bars, from −100 to 100. It is the original, with simple sums; TA-Lib’s smooths like the RSI and gives other numbers.

YangZhang(N) and GarmanKlass(N) measure per-bar volatility, in %, using open, high, low and close, not just the close: with the same bars they are much more accurate than the standard deviation of the changes. Yang-Zhang also takes the opening gap into account; Garman-Klass does not see it. They use logarithms, so with negative prices (the back-adjusted @CL of 2020) they are 0 in that window. All seven work in the Lab, in Genesis, on the GPU and on the six platforms.

// Buying pressure in charge
TSI(25) crosses above 0
// Classic KST buy
KST crosses above KST_Signal
// CMO oversold
CMO(14) < -50
// Volatility contracts
YangZhang(20) < YangZhang(20)[20]
📏

Trend lines and channels

TrendLineUp(n) is the uptrend line drawn the way a chartist would. A swing low is a low with n higher bars on each side. Each time one is confirmed, the lowest swing low up to 500 bars back is searched for, such that no bar pierces the line from it to the new swing (with a margin of a tenth of the average range of the last 20 bars). So the line anchors at the major low, as in textbook charts. Each swing low that touches it again (within 0.35 times that range) adds a touch, and 3 touches confirm it. There is only one watched line: another one replaces it only if it is clearly closer to price. TrendLineDn(n) is the same with the highs.

It has a value from the bar after the third touch, which is known n bars after the swing, so it does not look ahead. It dies on the bar whose close crosses it: that bar still carries it, so the cross can be seen, and from the next bar on it equals the bar’s low (or high) until another line is confirmed, so there are no signals without a line. On the Chart (and in AQ Mentor) each line is drawn from its anchor: dotted up to the third touch, solid while it holds, with a dot on each touch and an arrow at the breakout; the indicator settings can also show the candidates that died with two touches. On 90-minute NQ, with n = 3 a line is confirmed every 65 bars, lives 11 bars on average and 7 out of 10 end up broken; with n = 8, one every 200 bars.

TrendChannelUp(n) is the parallel to the uptrend line through the highest high between its last two touches, the peak of the latest leg, as in Edwards and Magee’s channel: the ceiling of the channel. It adjusts with each new touch. TrendChannelDn(n) is the floor of the falling channel. LinRegLine(N) is the regression line of the close over N bars at the current bar (it matches TA-Lib’s LINEARREG), and LinRegUpper(N) / LinRegLower(N) are Raff’s channel, at ±2 deviations of the residuals. All are price levels: against the close, with crosses, as the level of a Stop or Limit order or as a stop that follows the line. They work in the Lab, in Genesis, on the GPU and on the six platforms. To buy the breakout with a Stop order at the line, add the condition that there is a line above the bar (TrendLineDn(3) > HIGH[0]): with no line, the indicator equals the bar’s high.

Swings as indicators. SwingHigh(n) and SwingLow(n) are the level of the last confirmed swing high and swing low (Bill Williams’ fractals), with the same rule as the lines: they change exactly n bars after the extreme, neither earlier nor later. Use them to buy the breakout of the last high with a Stop order or to exit when the last low is lost. MarketStructure(n) is +1 if the last two highs and the last two lows rise, −1 if both fall and 0 if mixed. On daily NQ, with n = 3, the market spends 39% of the time at +1, 24% at −1 and the rest mixed.

// Breaks the downtrend line: buy
Close crosses above TrendLineDn(3)
// Buy the breakout at the exact level
TrendLineDn(3) > HIGH[0]
EntryOrder: stop at TrendLineDn(3) valid 1 bars
// Loses the uptrend line: exit
Close crosses below TrendLineUp(3)
// Pullback to the regression channel floor
Close crosses above LinRegLower(50)
// Bullish structure: buy the breakout of the last high
MarketStructure(3) = 1
EntryOrder: stop at SwingHigh(3) valid 1 bars
// Exit when the last low is lost
Close crosses below SwingLow(3)
↗️

RSI and MACD divergences

A bullish divergence is a price making a lower low while the oscillator does not follow: the fall loses strength. The bearish one is the same with the highs. There are two families, with the RSI(14) or the MACD(12, 26) line, and all equal 1 on the bar they fire and 0 otherwise (like candlestick patterns). None of them looks ahead.

Window — BullDivRSI(n), BearDivRSI(n), BullDivMACD(n) and BearDivMACD(n): today’s low breaks the lowest of the previous n bars and the oscillator stays above its low of those bars. It fires on the same bar, so it is immediate, but it fires often (on daily NQ, the bullish RSI one once every 16 bars). Textbook — BullSwingDivRSI(n), BearSwingDivRSI(n), BullSwingDivMACD(n) and BearSwingDivMACD(n): it compares the last two swing lows (highs), with the same rule as SwingLow: the new one lower than the previous and the oscillator at it higher. It is the one a trader would draw, more selective (once every 110 bars), but it arrives n bars late, when the swing is confirmed.

Beware of the drift: on daily NQ, 10 bars after any divergence, bullish or bearish, the close is higher on average, because the Nasdaq rises. Bearish ones do not anticipate drops by themselves; combine them with a breakout, a trend filter or market structure.

// The plan’s combination: recent divergence and breakout
Count(BullDivRSI(10) = 1, 5) >= 1
and Close > Highest(High, 3)[1]
// Textbook divergence with an exhausted bearish structure
BullSwingDivRSI(3) = 1
and MarketStructure(3) = -1
// One or the other: two entry blocks (AQL’s OR)
entry: BullDivMACD(10) = 1
entry: BullSwingDivRSI(3) = 1
// Exit on a bearish divergence between swings
exit: BearSwingDivMACD(3) = 1
🏛️

Support, resistance and chart patterns

Everything comes from the swings (n bars on each side, confirmed n bars later) and a margin of half the average range of the last 20 bars, so it works the same on any market and timeframe and does not look ahead. ResistanceLevel(n) and SupportLevel(n) are horizontal zones with at least 3 touches: among the last 20 swing highs and lows, those within the margin form a zone whose level is the mean of the touches. A broken support counts as resistance. The nearest zone above (or below) the previous close is chosen, so the breakout shows on the bar itself: Close > ResistanceLevel(3).

The patterns are events that equal 1 on the breakout bar: DoubleBottom / DoubleTop (two similar lows or highs and a break of the neckline, the extreme between them), HeadShoulders / InvHeadShoulders (three swings with a higher or lower head and similar shoulders), AscTriangle / DescTriangle (a flat side and the other converging; fires when the flat side breaks) and SymTriangleUp / SymTriangleDn (both sides converging; fires when the upper or lower line breaks).

Beware: by themselves they are not an edge. On daily and 90-minute NQ, 10 bars after each pattern the price goes the right way about half the time. Use them as a building block: with a trend filter, market structure or a well-placed exit, and always validated with the reserve and walk-forward.

// Breaks the horizontal resistance
Close > ResistanceLevel(3)
// Bounce off support
Low < SupportLevel(3)
and Close > SupportLevel(3)
// Double bottom after a bearish structure
DoubleBottom(3) = 1
and MarketStructure(3)[1] = -1
// Stop just below support
exit: Close < SupportLevel(3)
📅

Calendar filters (threshold-only)

DayOfWeek, HourOfDay, WeekOfMonth, DayOfMonth, Month, MinuteOfDay and DayOfYear are categorical filters: they are only compared against a specific value and are never paired with other indicators (comparing a day of the week with a moving average would be nonsense). The threshold is mandatory.

// Trade Fridays only
DayOfWeek = 5
// Morning session (9am to 1pm)
HourOfDay >= 9 & HourOfDay <= 13
// First week of the month only
WeekOfMonth = 1
// Month end (25th onwards)
DayOfMonth >= 25
// Last quarter only
Month >= 10
// 09:30-10:30 window
MinuteOfDay >= 570 & MinuteOfDay <= 630
📊

Percentile transforms

RSI_Pct, ATR_Pct, ROC_Pct and Vol_Pct do not measure an indicator's value, but which percentile (0 to 100) today's value sits in relative to its own last N bars. For example: ATR_Pct = 90 means «today's volatility is among the highest of the last N bars»; = 10 would mean «among the lowest».

Why are they powerful? Because they normalize themselves: the same rule («enter when volatility is low») works the same way in any market and any era, without depending on the asset's absolute scale. The only parameter is N (the percentile window); the underlying indicator uses its standard value (RSI 14, ATR 14, ROC 10).

// Enter in calm markets (low volatility)
ATR_Pct < 20
// Volume climax
Vol_Pct > 80
// RSI low against its own history
RSI_Pct < 15
// Momentum at recent highs
ROC_Pct > 85

They can be combined with any other indicator. On export, they are translated into EasyLanguage (TradeStation) by reproducing the calculation by hand; in ProRealTime and MT5 they show up as «not supported» (they are better for discovering than for deploying).

Price source

Every indicator can be computed on any of the four prices. Select several: AniQuant creates a separate instance for each source × period combination.

OPEN
Opening price
HIGH
High of the bar
LOW
Low of the bar
CLOSE
Closing price (the usual one)
Try it yourself

AniQuant can be tried free for 14 days, with every module and no card. If you have the book, 30.

← Previous
Working data: symbol, timeframe, period and out-of-sample
Next →
Indicator management
More in Data & indicators