Docs / Rule language
Rule language
Indicators
Standard technical indicators, computed on the symbol's daily bars. Indicators that read the whole bar (ATR, ADX, stochastics, CCI, Williams %R, OBV) take only periods; the rest take a series first.
| Indicator | Form | Defaults |
|---|---|---|
| RSI | rsi(C, 14) | period required |
| ATR | atr(14), atr_pct(14) | period required |
| MACD | macd(C), macdsignal(C), macdhist(C) | 12, 26, 9 |
| Bollinger | bbupper(C, 20, 2), bbmid(C, 20), bblower(C, 20, 2) | 2 deviations |
| ADX / DI | adx(14), diplus(14), diminus(14) | period required |
| Stochastic | stochk(14), stochd(14) | %D 3, slowing 3 |
| CCI, Williams %R | cci(20), willr(14) | period required |
| OBV | obv() | none |
Units: RSI, ADX, DI and stochastics run 0 to 100; Williams %R −100 to 0; atr_pct and roc are percents (3 means 3%); atr, MACD and the bands are in price.
Indicator functions
rsi(x, n)Relative strength index, 0 to 100 (Wilder). rsi(C, 14) is the usual one.
rsi(C, 14) > 50Momentum on the up side.atr(n)Average true range over n bars, in price.
H - L > 2 * atr(14)Today's range is more than twice the average.atr_pct(n)ATR as a percent of the close: 3 means 3%. Comparable across symbols.
atr_pct(14) > 3A typical day moves more than 3%.macd(x [, fast, slow, signal])MACD line: ema(fast) − ema(slow). Defaults 12, 26, 9.
macd(C) > 0The 12-day EMA is above the 26-day.macdsignal(x [, fast, slow, signal])The MACD signal line: an EMA of the MACD line.
macd(C) > macdsignal(C)MACD above its signal line.macdhist(x [, fast, slow, signal])MACD histogram: line minus signal.
macdhist(C) > ref(macdhist(C), -1)The histogram is rising.bbupper(x, n [, up, dn])Upper Bollinger band: sma + up × std. Default 2.
C > bbupper(C, 20, 2)A close above the upper band.bbmid(x, n)Middle band: the simple average.
C > bbmid(C, 20)Above the middle band (the 20-day average).bblower(x, n [, up, dn])Lower Bollinger band: sma − dn × std (dn defaults to up).
C < bblower(C, 20, 2)A close under the lower band.adx(n)Trend strength, 0 to 100, with no direction. Above 25 is usually called trending.
adx(14) > 25A trending market, up or down.diplus(n)+DI: the upward directional movement ADX is built from.
diplus(14) > diminus(14)Up moves have been stronger than down moves.diminus(n)−DI: the downward directional movement.
diminus(14) > 25Strong downward movement.stochk(n [, d, slow])Stochastic %K, 0 to 100: where the close sits in the n-bar range, smoothed over slow (default 3).
stochk(14) < 20Near the bottom of its 14-day range.stochd(n [, d, slow])Stochastic %D: the d-bar average of %K (default 3).
stochk(14) > stochd(14)%K above %D.cci(n)Commodity channel index: typical price against its average, in units of mean deviation.
cci(20) > 100Strong upward deviation.willr(n)Williams %R, −100 to 0: 0 is the top of the n-bar range.
willr(14) > -20In the top fifth of the 14-day range.obv()On-balance volume: adds the day's volume on an up close, subtracts it on a down close.
obv() > sma(obv(), 20)Volume flow above its 20-day average.Information, not investment advice. Beliefs and probabilities on this page are real responses for the session shown and change with every session.