AlgoHive
Reference

Indicators

Complete reference of all available technical indicators and functions.

AlgoHive includes 100+ technical indicators and functions. This reference is organized by category.

Trend Indicators

Moving averages and trend-following indicators.

FunctionDescriptionParameters
SMA(source, period)Simple Moving Averagesource: close, period: 20
EMA(source, period)Exponential Moving Average (faster reaction)source: close, period: 20
WMA(source, period)Weighted Moving Averagesource: close, period: 20
DEMA(source, period)Double EMA (reduced lag)source: close, period: 20
TEMA(source, period)Triple EMA (reduced lag)source: close, period: 20
HMA(source, period)Hull Moving Average (smooth, low lag)source: close, period: 20
KAMA(source, period)Kaufman Adaptive MA (adapts to volatility)source: close, period: 30
T3(source, period, vFactor)Extra-smoothed MAsource: close, period: 5, vFactor: 0.7
TRIMA(source, period)Triangular MA (double-smoothed SMA)source: close, period: 30
SAR(high, low, accel, max)Parabolic SAR (stop-and-reverse)high, low, accel: 0.02, max: 0.2
MIDPRICE(high, low, period)Midpoint of high/low rangeperiod: 14
MIDPOINT(source, period)Midpoint of source valuessource: close, period: 14

Struct-Returning Trend Indicators

FunctionReturnsDescription
MAMA(source, fast, slow){mama, fama}MESA Adaptive MA

Example:

trend: EMA(btc.close, 20)
fast: EMA(btc.close, 9)
slow: EMA(btc.close, 21)
bullish: fast > slow

Momentum Indicators

Measure the speed and strength of price movements.

FunctionDescriptionParameters
RSI(source, period)Relative Strength Index (0-100)source: close, period: 14
CCI(high, low, close, period)Commodity Channel Indexperiod: 20
WILLR(high, low, close, period)Williams %R (-100 to 0)period: 14
CMO(source, period)Chande Momentum Oscillatorsource: close, period: 14
ROC(source, period)Rate of Changesource: close, period: 10
MOM(source, period)Momentum (price difference)source: close, period: 10
ADX(high, low, close, period)Average Directional Index (trend strength)period: 14
PLUS_DI(high, low, close, period)+DI (bullish strength)period: 14
MINUS_DI(high, low, close, period)-DI (bearish strength)period: 14
ULTOSC(h, l, c, p1, p2, p3)Ultimate Oscillatorperiods: 7, 14, 28
BOP(open, high, low, close)Balance of Power
TRIX(source, period)Triple-smoothed EMA rate of changesource: close, period: 30

Struct-Returning Momentum Indicators

FunctionReturnsDescription
MACD(source, fast, slow, signal){line, signal, histogram}Moving Average Convergence/Divergence
STOCH(high, low, close, k, kSmooth, dSmooth){k, d}Stochastic Oscillator
STOCHF(high, low, close, k, d){fastk, fastd}Fast Stochastic
STOCHRSI(source, rsi, k, d){fastk, fastd}Stochastic RSI
AROON(high, low, period){aroonup, aroondown}Aroon Up/Down

Example:

macd: MACD(btc.close, 12, 26, 9)
macd_cross: cross_above(macd.line, macd.signal)
histogram_positive: macd.histogram > 0

Volatility Indicators

Measure price volatility and typical ranges.

FunctionDescriptionParameters
TR()True Range (uses OHLC)
ATR(high, low, close, period)Average True Rangeperiod: 14
NATR(high, low, close, period)Normalized ATR (percentage)period: 14
TRANGE(high, low, close)True Range (explicit inputs)

Struct-Returning Volatility Indicators

FunctionReturnsDescription
BOLLINGER(source, period, stddev){upper, middle, lower}Bollinger Bands
KELTNER(period, mult){upper, middle, lower}Keltner Channel
DONCHIAN(period){upper, middle, lower}Donchian Channel

Example:

bb: BOLLINGER(btc.close, 20, 2)
squeeze: (bb.upper - bb.lower) / bb.middle < 0.05
at_lower: btc.close < bb.lower

Volume Indicators

Analyze trading volume.

FunctionDescriptionParameters
OBV()On-Balance Volume
VWAP()Volume Weighted Average Price
MFI(period)Money Flow Index (0-100)period: 14
AD(high, low, close, volume)Chaikin A/D Line
ADOSC(h, l, c, v, fast, slow)Chaikin A/D Oscillatorfast: 3, slow: 10

Example:

money_flow: MFI(14)
mfi_oversold: money_flow < 20
volume_spike: btc.volume > SMA(btc.volume, 20) * 2

Comparison Functions

Return boolean (true/false) values for conditions.

FunctionDescriptionParameters
CROSS_ABOVE(a, b)True when a crosses above ba, b: any values
CROSS_BELOW(a, b)True when a crosses below ba, b: any values
RISING(source, length)True when source is higher than length bars agolength: 1
FALLING(source, length)True when source is lower than length bars agolength: 1

Example:

golden_cross: cross_above(EMA(btc.close, 50), EMA(btc.close, 200))
rising_rsi: rising(RSI(btc.close, 14), 3)

Math Functions

Mathematical operations on data.

FunctionDescriptionParameters
HIGHEST(source, length)Highest value over periodsource, length: 14
LOWEST(source, length)Lowest value over periodsource, length: 14
SUM(source, length)Sum over periodsource, length: 14
STDEV(source, length)Standard deviationsource, length: 14
CHANGE(source, length)Difference from length bars agosource, length: 1
PCT_CHANGE(source, length)Percent changesource, length: 1
ABS(value)Absolute valuevalue
MAX(a, b)Maximum of two valuesa, b
MIN(a, b)Minimum of two valuesa, b
SQRT(value)Square rootvalue
IF(cond, then, else)Conditional valuecondition, then, else

Example:

range_high: HIGHEST(btc.high, 20)
range_low: LOWEST(btc.low, 20)
range_pct: (range_high - range_low) / range_low

Time Functions

Access bar timestamp information.

FunctionReturnsDescription
HOUR_UTC()numberUTC hour (0-23)
HOUR_ET()numberUS Eastern hour (0-23)
DAY_OF_WEEK()numberISO weekday (1=Mon, 7=Sun)
DAY()numberDay of month (1-31)
MONTH()numberMonth (1-12)
IS_MONDAY()booleanTrue on Monday
IS_FRIDAY()booleanTrue on Friday
IS_WEEKEND()booleanTrue on Sat/Sun
IS_DATE(date)booleanTrue on specific date (YYYY-MM-DD)
DATE_DIFF(date1, date2)numberDays between dates

Example:

asian_session: HOUR_UTC() >= 0 AND HOUR_UTC() < 8
no_weekend: NOT IS_WEEKEND()

Position Functions

Access information about open positions. Only available in manage rule expressions.

FunctionReturnsDescription
ENTRY_BAR()numberBar index at entry
ENTRY_PRICE()numberEntry price
ENTRY_TIME()numberEntry timestamp (ms)
POSITION_PNL()numberUnrealized P&L ($)
POSITION_PNL_PCT()numberUnrealized P&L (%)
POSITION_PNL_R()numberUnrealized P&L (R-multiples)

Example (in manage rule):

in_profit: POSITION_PNL_PCT() > 0.02
breakeven_stop: ENTRY_PRICE()

Statistical Functions

Linear regression and statistical analysis.

FunctionDescription
LINEARREG(source, period)Linear regression value
LINEARREG_SLOPE(source, period)Slope of regression
LINEARREG_ANGLE(source, period)Angle in degrees
TSF(source, period)Time Series Forecast
CORREL(source1, source2, period)Correlation (-1 to 1)
BETA(source1, source2, period)Beta coefficient

Price Transform

Common price calculations.

FunctionDescription
AVGPRICE(o, h, l, c)(O+H+L+C) / 4
MEDPRICE(h, l)(H+L) / 2
TYPPRICE(h, l, c)(H+L+C) / 3
WCLPRICE(h, l, c)(H+L+2C) / 4

Candlestick Patterns

Detect candlestick patterns. Return +100 (bullish), -100 (bearish), or 0 (no pattern).

FunctionPattern
CDLDOJI()Doji (indecision)
CDLHAMMER()Hammer (bullish reversal)
CDLENGULFING()Engulfing (reversal)
CDLMORNINGSTAR()Morning Star (bullish)
CDLEVENINGSTAR()Evening Star (bearish)
CDL3WHITESOLDIERS()Three White Soldiers (bullish)
CDL3BLACKCROWS()Three Black Crows (bearish)

Example:

hammer_signal: CDLHAMMER() > 0
bearish_pattern: CDLENGULFING() < 0

See the full list of 60+ candlestick patterns in the function registry.

On this page