HeyTraders Documentation

Signal DSL Operators

This reference is generated from the executable EXPRESSION_OPERATOR_REGISTRY. The runtime registry is authoritative for operator availability; this document is its searchable canonical Docs projection.

Use execution dsl-grammar for the complete strategy-authoring grammar and docs search with topic strategies/operators for complete operator documentation.

Documented executable operators: 252.

Indicator

Signature: ad(high, low, close, volume)

Returns: numeric

Accumulation/Distribution.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
volumeSeriesyes—

adr

Signature: adr(high, low, length=14)

Returns: numeric

Average Day Range — SMA of (high - low).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno14

adx

Signature: adx(high, low, close, di_length=14, adx_smoothing=14)

Returns: numeric

Average Directional Index — FE-compatible implementation (returns ADX line only).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
di_lengthintno14
adx_smoothingintno14

adxr

Signature: adxr(high, low, close, window=14)

Returns: numeric

Average Directional Movement Rating.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
windowintno14

alma

Signature: alma(data, length=9, offset=0.85, sigma=6.0)

Returns: numeric

Arnaud Legoux Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno9
offsetfloatno0.85
sigmafloatno6.0

apo

Signature: apo(data, fast=12, slow=26)

Returns: numeric

Absolute Price Oscillator.

ParameterTypeRequiredDefault
dataSeriesyes—
fastintno12
slowintno26

aroon

Signature: aroon(high, low, length=14)

Returns: tuple

Aroon — returns (up, down).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno14

aroon_down

Signature: aroon_down(high, low, length=14)

Returns: numeric

Aroon Down (0-100).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno14

aroon_oscillator

Signature: aroon_oscillator(high, low, length=14)

Returns: numeric

Aroon Oscillator (Aroon Up - Aroon Down).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno14

aroon_up

Signature: aroon_up(high, low, length=14)

Returns: numeric

Aroon Up (0-100).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno14

atr

Signature: atr(high, low, close, window=14)

Returns: numeric

Average True Range — Wilder RMA of true range with FE-compatible seeding.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
windowintno14

avgprice

Signature: avgprice(open, high, low, close)

Returns: numeric

Average Price.

ParameterTypeRequiredDefault
openSeriesyes—
highSeriesyes—
lowSeriesyes—
closeSeriesyes—

awesome_oscillator

Signature: awesome_oscillator(high, low, fast=5, slow=34)

Returns: numeric

Awesome Oscillator (median-price SMA difference).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
fastintno5
slowintno34

bb

Signature: bb(data, length=20, mult=2.0)

Returns: tuple

Bollinger Bands — returns (upper, middle, lower). Example: upper, middle, lower = bb(close, 20, 2.0)

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno20
multfloatno2.0

bb_bandwidth

Signature: bb_bandwidth(close, length=20, mult=2.0)

Returns: numeric

Bollinger BandWidth (FE formula): (upper - lower) / basis * 100. basis = SMA(close, length); dev = stdev_pop(close, length) * mult; upper = basis + dev; lower = basis - dev.

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno20
multfloatno2.0

bb_lower

Signature: bb_lower(data, length=20, mult=2.0)

Returns: numeric

Bollinger Lower Band.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno20
multfloatno2.0

bb_middle

Signature: bb_middle(data, length=20, mult=2.0)

Returns: numeric

Bollinger Middle Band.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno20
multfloatno2.0

bb_percent_b

Signature: bb_percent_b(close, length=20, mult=2.0)

Returns: numeric

Bollinger %B — (close - lower) / (upper - lower).

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno20
multfloatno2.0

bb_upper

Signature: bb_upper(data, length=20, mult=2.0)

Returns: numeric

Bollinger Upper Band.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno20
multfloatno2.0

bbtrend

Signature: bbtrend(close, short_length=20, long_length=50, mult=2.0)

Returns: numeric

BBTrend (FE formula): (|sL - lL| - |sU - lU|) / sM * 100. sM = SMA(close, short_length); dev_short = stdev_pop(close, short_length) * mult; sU = sM + dev_short; sL = sM - dev_short; similarly for long_length.

ParameterTypeRequiredDefault
closeSeriesyes—
short_lengthintno20
long_lengthintno50
multfloatno2.0

bollinger_bands

Signature: bollinger_bands(data, length=20, mult=2.0)

Returns: tuple

Long-form alias for bb — returns (upper, middle, lower). The frontend's signal/mean_reversion template emits upper, middle, lower = bollinger_bands(close, 20, 2.0); we expose this name as a registered indicator so the validator and engine both resolve it to the same Bollinger implementation as bb.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno20
multfloatno2.0

bop

Signature: bop(open, high, low, close)

Returns: numeric

Balance of Power.

ParameterTypeRequiredDefault
openSeriesyes—
highSeriesyes—
lowSeriesyes—
closeSeriesyes—

bull_bear_power

Signature: bull_bear_power(high, low, close, length=13)

Returns: numeric

Bull Bear Power — (high - ema) + (low - ema).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno13

cci

Signature: cci(high, low, close, window=20)

Returns: numeric

Commodity Channel Index.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
windowintno20

chaikin_mf

Signature: chaikin_mf(high, low, close, volume, length=20)

Returns: numeric

Chaikin Money Flow.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
volumeSeriesyes—
lengthintno20

chaikin_osc

Signature: chaikin_osc(high, low, close, volume, fast=3, slow=10)

Returns: numeric

Chaikin Oscillator (FE formula): EMA(AD, fast) - EMA(AD, slow). Accumulation/Distribution (AD) is cumulative: if high == low: AD unchanged. else: clv = (close - low - (high - close)) / (high - low); AD += clv * volume. EMAs are FE-style seeded EMAs.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
volumeSeriesyes—
fastintno3
slowintno10

chande_kroll_stop

Signature: chande_kroll_stop(high, low, close, p=10, x=1.0, q=9)

Returns: numeric

Chande Kroll Stop (FE plot0, Stop Long). FE: highestHigh = ta.highest(high, atrLength); lowestLow = ta.lowest(low, atrLength); atrArr = ta.atr(bars, atrLength); firstHighStop = hh - atrCoeffatr; firstLowStop = ll + atrCoeffatr; stopLong (plot0) = ta.lowest(firstLowStop, stopLength). Warmup NaN until atr+highest/lowest are all valid AND stopLength window of firstLowStop is entirely valid.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
pintno10
xfloatno1.0
qintno9

chande_mo

Signature: chande_mo(data, window=9)

Returns: numeric

Chande Momentum Oscillator. FE formula: at each bar i (i >= length), compute sum of gains and sum of absolute losses over the last length bars (mom = close[i] - close[i-1] for i in window), then CMO = 100 * (sumGains - sumLosses) / (sumGains + sumLosses). Warmup: NaN for i < length.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno9

chop_zone

Signature: chop_zone(close, length=34)

Returns: numeric

Chop Zone (FE plot0) — a coloring-only indicator; plot value is always 1. FE ChopZone.calculate pushes value: 1 for every bar (color varies by emaAngle). Since parity is on numeric values only, DSL returns a constant-1 series of the same length. length is kept for signature parity (FE hardcodes EMA=34 internally).

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno34

choppiness

Signature: choppiness(high, low, close, length=14)

Returns: numeric

Choppiness Index.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno14

connors_rsi

Signature: connors_rsi(close, rsi_len=3, streak_len=2, rank_len=100)

Returns: numeric

Connors RSI — (rsi(close, rsi_len) + rsi(ud, streak_len) + percentrank(roc(close,1), rank_len)) / 3. Matches FE calculate78(): ud[0]=0; if close[i]==close[i-1]: 0; if close[i]>close[i-1]: (ud[i-1]<=0 ? 1 : ud[i-1]+1); else (ud[i-1]>=0 ? -1 : ud[i-1]-1). roc1 = ta.roc(close, 1) (NaN for i<1, else 100*(c[i]-c[i-1])/c[i-1]). pr = ta.percentrank(roc1, rank_len) (NaN for i<rank_len or any NaN in window; else count(prior<=cur)/rank_len*100).

ParameterTypeRequiredDefault
closeSeriesyes—
rsi_lenintno3
streak_lenintno2
rank_lenintno100

coppock_curve

Signature: coppock_curve(data, wma_length=10, long_roc=14, short_roc=11)

Returns: numeric

Coppock Curve — WMA(ROC(long) + ROC(short), wma_length).

ParameterTypeRequiredDefault
dataSeriesyes—
wma_lengthintno10
long_rocintno14
short_rocintno11

cvd

Signature: cvd(open, close, volume)

Returns: numeric

Cumulative Volume Delta.

ParameterTypeRequiredDefault
openSeriesyes—
closeSeriesyes—
volumeSeriesyes—

dema

Signature: dema(data, window)

Returns: numeric

Double Exponential Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

dmi

Signature: dmi(high, low, close, di_length=14, adx_smoothing=14)

Returns: tuple

Directional Movement Index — returns (adx, +DI, -DI) to match FE plot order. FE plotConfig66: plot0=ADX, plot1=+DI, plot2=-DI. test_matrix maps {plot0:0, plot1:1, plot2:2} → DSL tuple index 0 must be ADX.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
di_lengthintno14
adx_smoothingintno14

dmi_minus_di

Signature: dmi_minus_di(high, low, close, di_length=14)

Returns: numeric

-DI line using FE DMI formula (calculate66 in FE index.mjs).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
di_lengthintno14

dmi_plus_di

Signature: dmi_plus_di(high, low, close, di_length=14)

Returns: numeric

+DI line using FE DMI formula (calculate66 in FE index.mjs).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
di_lengthintno14

donchian

Signature: donchian(high, low, length=20)

Returns: tuple

Donchian Channels (FE): returns (upper, middle, lower). upper = ta.highest(high, length); lower = ta.lowest(low, length); middle = (upper+lower)/2. All three are NaN for i<length-1 (matches oakscriptjs ta.highest/lowest warmup).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno20

donchian_lower

Signature: donchian_lower(low, length=20)

Returns: numeric

Donchian lower band (rolling lowest low).

ParameterTypeRequiredDefault
lowSeriesyes—
lengthintno20

donchian_middle

Signature: donchian_middle(high, low, length=20)

Returns: numeric

Donchian middle band ((upper + lower) / 2).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno20

donchian_upper

Signature: donchian_upper(high, length=20)

Returns: numeric

Donchian upper band (rolling highest high).

ParameterTypeRequiredDefault
highSeriesyes—
lengthintno20

dpo

Signature: dpo(data, length=21)

Returns: numeric

Detrended Price Oscillator.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno21

elder_force

Signature: elder_force(close, volume, length=13)

Returns: numeric

Elder Force Index (FE formula): ema(force, length) with force[0]=NaN, force[i]=(close[i]-close[i-1])*(volume[i] or 0). Uses SMA-seeded EMA.

ParameterTypeRequiredDefault
closeSeriesyes—
volumeSeriesyes—
lengthintno13

ema

Signature: ema(data, window)

Returns: numeric

Exponential Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

envelope

Signature: envelope(close, length=20, percent=10.0, exponential=False)

Returns: numeric

Envelope basis line (FE plot0) — SMA (or EMA) of close with FE-seeded MA. FE Envelope returns plot0=basis, plot1=basis*(1+k), plot2=basis*(1-k) with k=percent/100. DSL returns the basis so parity matches plot0.

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno20
percentfloatno10.0
exponentialboolnoFalse

eom

Signature: eom(high, low, volume, length=14, divisor=10000)

Returns: numeric

Ease of Movement.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
volumeSeriesyes—
lengthintno14
divisorintno10000

fisher_transform

Signature: fisher_transform(high, low, length=9)

Returns: numeric

Fisher Transform (FE formula, plot0 only). For each bar: hl2 = (high+low)/2; lookback = min(i+1, length) find highest/lowest hl2 over last lookback bars (inclusive) normalized = (hl2 - lowest) / (highest - lowest) - 0.5 if range != 0 else 0 rawValue = 0.66 * normalized + 0.67 * prevValue (clipped at ±0.99→±0.999) fish1 = 0.5 * log((1+value) / (1-value)) + 0.5 * prevFish1 plot0 returns fish1 with NaN for i < length - 1.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno9

heikin_ashi_close

Signature: heikin_ashi_close(open, high, low, close)

Returns: numeric

Heikin Ashi Close.

ParameterTypeRequiredDefault
openSeriesyes—
highSeriesyes—
lowSeriesyes—
closeSeriesyes—

heikin_ashi_open

Signature: heikin_ashi_open(open, close)

Returns: numeric

Heikin Ashi Open (approximated).

ParameterTypeRequiredDefault
openSeriesyes—
closeSeriesyes—

highest

Signature: highest(data, window=20)

Returns: numeric

Rolling highest value over window.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno20

hist_volatility

Signature: hist_volatility(close, length=10, annual=365, per=1)

Returns: numeric

Historical Volatility (FE formula): population stdev of log returns * 100 * sqrt(annual/per). logReturns[0] = NaN; logReturns[i] = log(close[i]/close[i-1]). Result at i < length-1 is NaN (from stdev warmup, since logReturns[0] is NaN); effectively valid from i == length (need length non-NaN log returns).

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno10
annualintno365
perintno1

historical_sr

Signature: historical_sr(high, low, close, sr_type, rank=1, lookback_period=252, cluster_pct=0.005, recency_decay=0.01, swing_order=5)

Returns: numeric

Calculates historical support and resistance levels, optimized with Numba.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
sr_typestryes—
rankintno1
lookback_periodintno252
cluster_pctfloatno0.005
recency_decayfloatno0.01
swing_orderintno5

hma

Signature: hma(data, window)

Returns: numeric

Hull Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

ichimoku

Signature: ichimoku(high, low, close, conversion=9, base=26, span_b=52, displacement=26)

Returns: tuple

Ichimoku Cloud (FE calculate12) — returns (tenkan, kijun, span_a, span_b, chikou). conversionLine = donchian(high, low, conversion) # (highest+lowest)/2, NaN warmup baseLine = donchian(high, low, base) leadingSpanA = (conversionLine + baseLine) / 2 then SHIFTED FORWARD by (displacement-1) leadingSpanB = donchian(high, low, span_b) then SHIFTED FORWARD by (displacement-1) chikou = close shifted BACKWARD by (displacement-1) (sourceIndex = i + (displacement-1)) Plot order in FE: plot0=conversion, plot1=base, plot2=lagging(chikou), plot3=leadA, plot4=leadB. DSL tuple here: (tenkan, kijun, span_a, span_b, chikou) i.e. (0,1,2,3,4). test_matrix maps FE plot0→0, plot1→1, plot2→4, plot3→2, plot4→3.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
conversionintno9
baseintno26
span_bintno52
displacementintno26

ichimoku_chikou

Signature: ichimoku_chikou(close, displacement=26)

Returns: numeric

Ichimoku Chikou (Lagging Span) — close shifted backward by displacement.

ParameterTypeRequiredDefault
closeSeriesyes—
displacementintno26

ichimoku_kijun

Signature: ichimoku_kijun(high, low, length=26)

Returns: numeric

Ichimoku Kijun-sen (Base Line).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno26

ichimoku_span_a

Signature: ichimoku_span_a(high, low, conversion=9, base=26)

Returns: numeric

Ichimoku Leading Span A.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
conversionintno9
baseintno26

ichimoku_span_b

Signature: ichimoku_span_b(high, low, length=52)

Returns: numeric

Ichimoku Leading Span B.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno52

ichimoku_tenkan

Signature: ichimoku_tenkan(high, low, length=9)

Returns: numeric

Ichimoku Tenkan-sen (Conversion Line).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno9

kama

Signature: kama(data, window=10)

Returns: numeric

Kaufman Adaptive Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno10

keltner

Signature: keltner(high, low, close, length=20, mult=2.0, atr_length=10)

Returns: tuple

Keltner Channels (FE defaults: useEMA=true, src='close', bandsStyle='ATR'). Returns (upper, middle, lower). Upper = basis + multatr; Lower = basis - multatr.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno20
multfloatno2.0
atr_lengthintno10

keltner_lower

Signature: keltner_lower(high, low, close, length=20, mult=2.0, atr_length=10)

Returns: numeric

Keltner Channel lower band.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno20
multfloatno2.0
atr_lengthintno10

keltner_middle

Signature: keltner_middle(high, low, close, length=20)

Returns: numeric

Keltner Channel middle (basis) line — FE uses ema(close, length) by default.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno20

keltner_upper

Signature: keltner_upper(high, low, close, length=20, mult=2.0, atr_length=10)

Returns: numeric

Keltner Channel upper band (FE default bandsStyle='Average True Range').

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno20
multfloatno2.0
atr_lengthintno10

klinger

Signature: klinger(high, low, close, volume, fast_length=34, slow_length=55, signal_length=13)

Returns: numeric

Klinger Oscillator (FE plot0): EMA(signedVolume, fast) - EMA(signedVolume, slow). Matches FE calculate67 exactly: hlc3 = (high+low+close)/3; hlc3ChangeArr = ta.change(hlc3Series, 1).toArray() # NaN at i=0 if (change === null) signedVolume.push(volume) # strict null, NOT NaN else signedVolume.push(change >= 0 ? volume : -volume) FE's change === null check does NOT match NaN at i=0 (NaN !== null). So at i=0: NaN >= 0 is false → push -volume.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
volumeSeriesyes—
fast_lengthintno34
slow_lengthintno55
signal_lengthintno13

kst

Signature: kst(data, roc1=10, roc2=15, roc3=20, roc4=30, sma1=10, sma2=10, sma3=10, sma4=15)

Returns: numeric

Know Sure Thing — weighted ROC composite.

ParameterTypeRequiredDefault
dataSeriesyes—
roc1intno10
roc2intno15
roc3intno20
roc4intno30
sma1intno10
sma2intno10
sma3intno10
sma4intno15

linear_reg

Signature: linear_reg(data, window=20)

Returns: numeric

Linear regression line over window.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno20

linear_reg_slope

Signature: linear_reg_slope(data, window=20)

Returns: numeric

Linear regression slope over window.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno20

lowest

Signature: lowest(data, window=20)

Returns: numeric

Rolling lowest value over window.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno20

lsma

Signature: lsma(data, length=25, offset=0)

Returns: numeric

Least Squares Moving Average (linear regression of the closing price).

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno25
offsetintno0

ma

Signature: ma(data, window)

Returns: numeric

Moving Average (alias for SMA).

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

macd

Signature: macd(data, fast=12, slow=26, signal=9)

Returns: tuple

MACD — returns (line, signal, histogram). Uses FE-style seeded EMAs. FE calculates: fastEMA - slowEMA, then EMA(signal) of the line, hist = line - signal.

ParameterTypeRequiredDefault
dataSeriesyes—
fastintno12
slowintno26
signalintno9

macd_hist

Signature: macd_hist(data, fast=12, slow=26, signal=9)

Returns: numeric

MACD histogram only.

ParameterTypeRequiredDefault
dataSeriesyes—
fastintno12
slowintno26
signalintno9

macd_line

Signature: macd_line(data, fast=12, slow=26, signal=9)

Returns: numeric

MACD line only.

ParameterTypeRequiredDefault
dataSeriesyes—
fastintno12
slowintno26
signalintno9

macd_signal

Signature: macd_signal(data, fast=12, slow=26, signal=9)

Returns: numeric

MACD signal line only.

ParameterTypeRequiredDefault
dataSeriesyes—
fastintno12
slowintno26
signalintno9

mass_index

Signature: mass_index(high, low, length=10)

Returns: numeric

Mass Index (FE formula): sum(ratio, length) where ratio = ema1/ema2 of (high-low). ema1 = SMA-seeded EMA(range, 9); ema2 = SMA-seeded EMA(ema1, 9). Requires the full length-bar window to be non-NaN (FE gates on validCount === length).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
lengthintno10

mc_ginley_dynamic

Signature: mc_ginley_dynamic(data, length=14, k=1.0)

Returns: numeric

McGinley Dynamic MA (FE formula): md[i] = md[i-1] + (src - md[i-1]) / (length * ratio^4). FE hardcodes the denom coefficient at 1.0 (k * length * ratio^4 with k=1); the k parameter is preserved for backwards compatibility but defaults to 1.0 so DSL matches FE's McGinleyDynamic.calculate() when called with default params. Seeds md[0] = srcVal; resets to srcVal if prev md is None/0.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno14
kfloatno1.0

median

Signature: median(data, length=3)

Returns: numeric

Rolling median using FE percentileNearestRank (50%) over length bars. Matches FE ta.percentileNearestRank: sorted index = ceil(0.5 * len) - 1. For even-length windows this returns the lower of the two middles (Pine-style), not the arithmetic mean. NaN for i < length - 1.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno3

medprice

Signature: medprice(high, low)

Returns: numeric

Median Price.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—

mfi

Signature: mfi(high, low, close, volume, window=14)

Returns: numeric

Money Flow Index.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
volumeSeriesyes—
windowintno14

momentum

Signature: momentum(data, window=10)

Returns: numeric

Momentum (price difference over window).

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno10

natr

Signature: natr(high, low, close, window=14)

Returns: numeric

Normalized Average True Range.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
windowintno14

net_volume

Signature: net_volume(open, close, volume)

Returns: numeric

Net Volume — alias of volume_delta.

ParameterTypeRequiredDefault
openSeriesyes—
closeSeriesyes—
volumeSeriesyes—

obv

Signature: obv(close, volume)

Returns: numeric

On Balance Volume — cumulative sign(close_diff) * volume, starts at 0.

ParameterTypeRequiredDefault
closeSeriesyes—
volumeSeriesyes—

parabolic_sar

Signature: parabolic_sar(high, low, close, af_start=0.02, af_increment=0.02, af_max=0.2)

Returns: numeric

Parabolic SAR — exact match to FE oakscriptjs ta.sar(bars, start, inc, max). Algorithm (per FE/oakscriptjs sar): - result[0] = NaN. - At i=1, seed direction from close[1] vs close[0]: if up, ep=high[1], sar=low[0]; else ep=low[1], sar=high[0]. Mark isFirstTrendBar=true, accel=start. - sar = sar + accel * (ep - sar). Check reversal: if uptrend and sar>low[i], reverse (isUp=false, sar=max(high[i], ep), ep=low[i], accel=start). Similar for down. - If NOT first-trend-bar and (uptrend & high[i]>ep OR !uptrend & low[i]<ep), update ep to extreme, accel = min(accel + inc, max). - Clamp: if uptrend, sar = min(sar, low[i-1], low[i-2] if i>1); if downtrend, sar = max(sar, high[i-1], high[i-2] if i>1). Push sar. Clear isFirstTrendBar.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
af_startfloatno0.02
af_incrementfloatno0.02
af_maxfloatno0.2

pivot

Signature: pivot(high, low, close, level='P')

Returns: numeric

Calculates classic pivot points based on the provided data.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
levelstrno'P'

price_oscillator

Signature: price_oscillator(data, short=12, long=26, signal=9, exponential=True)

Returns: numeric

Price Oscillator histogram (FE plot0): ppo - signal_ema(ppo). ppo = (shortMA - longMA) / longMA * 100. With exponential=True (FE default), MA is FE-seeded EMA; otherwise SMA. signal line is EMA(ppo, signal). Returns histogram = ppo - signal_line (matches FE plot0 which is columns style).

ParameterTypeRequiredDefault
dataSeriesyes—
shortintno12
longintno26
signalintno9
exponentialboolnoTrue

pvt

Signature: pvt(close, volume)

Returns: numeric

Price Volume Trend — cumulative (pct_change * volume).

ParameterTypeRequiredDefault
closeSeriesyes—
volumeSeriesyes—

rci

Signature: rci(close, length=9)

Returns: numeric

Rank Correlation Index (FE ta.rci): tie-corrected Spearman of source vs time. For each bar i >= length-1: take window of length source values, assign average ranks within ties. Let sumSquaredDiff = sum((rank[j] - (j+1))^2). Let base = (n^3 - n)/12; tieCorrection = sum((tc^3 - tc)/12 for each tie-group of size tc>=2); A = base - tieCorrection, B = base. If A or B == 0 → rho = 0 else rho = (A + B - sumSquaredDiff) / (2 * sqrt(AB)). Result = rho100. NaN if any source is NaN.

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno9

rci_ribbon

Signature: rci_ribbon(close, length=9)

Returns: numeric

RCI Ribbon — single length wrapper; use rci(close, length).

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno9

relative_volume_at_time

Signature: relative_volume_at_time(volume, time, length=10)

Returns: numeric

Relative Volume at Time (FE calculate70, anchor='1D', cumulative mode). Per-bar cumulative volume within the daily period; ratio = current / avg of same intra-day offset across the last length prior periods. Last-bar adjustRealtime is NOT applied here (it only fires for the final partial bar on live charts; the parity fixture only has completed historical bars). For the final historical bar, FE's adjustRealtime path scales current vs. full expected period duration. We replicate FE exactly: if i == n-1 and timePassed > 0 and timePassed < periodDuration, scale currentValue.

ParameterTypeRequiredDefault
volumeSeriesyes—
timeSeriesyes—
lengthintno10

rma

Signature: rma(data, length=14)

Returns: numeric

Wilder's Smoothed Moving Average — SMA-seeded at bar length-1, alpha = 1/length.

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno14

roc

Signature: roc(data, window=10)

Returns: numeric

Rate of Change.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno10

rsi

Signature: rsi(data, window=14)

Returns: numeric

Relative Strength Index.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno14

rvi

Signature: rvi(open, high, low, close, length=10)

Returns: numeric

Relative Vigor Index (FE plot0): rolling sum of SWMA(close-open) / SWMA(high-low). FE: swmaCO[i]=(co[i-3]+2co[i-2]+2co[i-1]+co[i])/6 (NaN i<3); same for swmaHL. For i<length+2: NaN; else rviValues[i] = sum(swmaCO[j], j=i-length+1..i) / sum(swmaHL[j]). If sumHL==0, push 0 (FE).

ParameterTypeRequiredDefault
openSeriesyes—
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno10

rvol

Signature: rvol(close, length=10)

Returns: numeric

Relative Volatility Index (Donald Dorsey) — FE relative-volatility-index plot0. FE: stddevArr = ta.stdev(close, length); change[i] = close[i]-close[i-1] (NaN at 0). upperInput[i] = chg<=0 ? 0 : stddev[i]; lowerInput[i] = chg>0 ? 0 : stddev[i]; upperArr = ta.ema(upperInput, 14); lowerArr = ta.ema(lowerInput, 14); rvi = upper/(upper+lower)*100 (0 when denom 0). Inner EMA length is hardcoded to 14.

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno10

sma

Signature: sma(data, window)

Returns: numeric

Simple Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

smi_ergodic

Signature: smi_ergodic(close, long_len=20, short_len=5, signal_len=5)

Returns: numeric

SMI Ergodic Indicator (FE formula, plot0 only; no *100). pc[0]=NaN, pc[i]=close[i]-close[i-1]. ds_pc = EMA(EMA(pc, long), short); ds_abs_pc = EMA(EMA(abs(pc), long), short). SMI = ds_pc / ds_abs_pc.

ParameterTypeRequiredDefault
closeSeriesyes—
long_lenintno20
short_lenintno5
signal_lenintno5

smi_ergodic_osc

Signature: smi_ergodic_osc(close, long_len=20, short_len=5, signal_len=5)

Returns: numeric

SMI Ergodic Oscillator (FE formula): smi - EMA(smi, signal_len).

ParameterTypeRequiredDefault
closeSeriesyes—
long_lenintno20
short_lenintno5
signal_lenintno5

smma

Signature: smma(data, length=14)

Returns: numeric

Smoothed Moving Average (same math as rma).

ParameterTypeRequiredDefault
dataSeriesyes—
lengthintno14

stdev

Signature: stdev(data, window=20)

Returns: numeric

Population Standard Deviation (FE ta.stdev): sqrt(sum((x-mean)^2) / N).

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno20

stoch

Signature: stoch(high, low, close, k=14, smooth_k=1, d=3)

Returns: tuple

Stochastic Oscillator — returns (k, d). Example: k_line, d_line = stoch(high, low, close, 14, 1, 3)

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
kintno14
smooth_kintno1
dintno3

stoch_d

Signature: stoch_d(high, low, close, k=14, smooth_k=1, d=3)

Returns: numeric

Stochastic %D (smoothed %K).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
kintno14
smooth_kintno1
dintno3

stoch_k

Signature: stoch_k(high, low, close, k=14, smooth_k=1, d=3)

Returns: numeric

Stochastic %K.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
kintno14
smooth_kintno1
dintno3

stoch_rsi

Signature: stoch_rsi(data, rsi_length=14, stoch_length=14, smooth_k=3, smooth_d=3)

Returns: numeric

Stochastic RSI K line (FE plot0): sma(stoch(rsi,rsi,rsi, lengthStoch), smoothK). Matches FE StochRSI.calculate: K = sma(stochRsi, smoothK), D = sma(K, smoothD). This function returns K (FE plot0). Warmup gates on non-NaN rsi values within the stoch window (FE ta.highest/lowest skip NaNs).

ParameterTypeRequiredDefault
dataSeriesyes—
rsi_lengthintno14
stoch_lengthintno14
smooth_kintno3
smooth_dintno3

supertrend

Signature: supertrend(high, low, close, atr_period=10, factor=3.0)

Returns: numeric

SuperTrend (FE oakscriptjs ta.supertrend, wicks=false). source = (high+low)/2; atr = ta.atr(bars, atrPeriod). For each bar: upper = source + factoratr; lower = source - factoratr. Band carry uses PREVIOUS CLOSE (prevLowPrice=close[i-1], prevHighPrice=close[i-1]): lower = (lower>prevLower or close[i-1]<prevLower) ? lower : prevLower upper = (upper<prevUpper or close[i-1]>prevUpper) ? upper : prevUpper Direction: first non-NaN bar → 1 (down); if prevSt==prevUpper → dir=(close[i]>upper ? -1 : 1); else dir=(close[i]<lower ? 1 : -1). SuperTrend = dir==-1 ? lower : upper.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
atr_periodintno10
factorfloatno3.0

tema

Signature: tema(data, window)

Returns: numeric

Triple Exponential Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

trend_strength

Signature: trend_strength(close, length=14, ma_length=50)

Returns: numeric

Trend Strength Index (FE formula): Pearson correlation(close, bar_index, length). ma_length is kept for signature compatibility (FE's indicator ignores any MA smoothing; only length drives the rolling correlation window).

ParameterTypeRequiredDefault
closeSeriesyes—
lengthintno14
ma_lengthintno50

trima

Signature: trima(data, window)

Returns: numeric

Triangular Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

trix

Signature: trix(data, window=18)

Returns: numeric

TRIX oscillator (FE formula): 1e4 * change(ema3(log(close)), 1). ema3 = EMA(EMA(EMA(log(close), length), length), length) with FE-style seeded EMA. Then take 1-period difference and multiply by 10000.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno18

tsi

Signature: tsi(close, long=25, short=13)

Returns: numeric

True Strength Index (FE formula). pc[0]=NaN, pc[i]=close[i]-close[i-1]. Double-smooth pc with EMA(long)->EMA(short) and similarly for abs(pc). TSI = 100 * ds_pc / ds_abs_pc.

ParameterTypeRequiredDefault
closeSeriesyes—
longintno25
shortintno13

twap

Signature: twap(open, high, low, close, time)

Returns: numeric

TWAP (FE calculate83): daily-anchored cumulative mean of ohlc4. FE defaults: anchor='1D', src='ohlc4', offset=0. For each bar, if the UTC day changed vs previous bar, reset sum/count. Push cumulative mean (sum/count) for each bar; push NaN if no non-NaN values seen in the period.

ParameterTypeRequiredDefault
openSeriesyes—
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
timeSeriesyes—

typprice

Signature: typprice(high, low, close)

Returns: numeric

Typical Price.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—

ultimate_osc

Signature: ultimate_osc(high, low, close, length1=7, length2=14, length3=28)

Returns: numeric

Ultimate Oscillator (multi-timeframe momentum).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
length1intno7
length2intno14
length3intno28

volume_delta

Signature: volume_delta(open, close, volume)

Returns: numeric

Volume Delta — signed volume based on close vs open direction.

ParameterTypeRequiredDefault
openSeriesyes—
closeSeriesyes—
volumeSeriesyes—

volume_osc

Signature: volume_osc(volume, short=5, long=10)

Returns: numeric

Volume Oscillator (FE formula): 100 * (ema(volume, short) - ema(volume, long)) / ema(volume, long). Uses FE-seeded EMAs; NaN when long-EMA unavailable or zero.

ParameterTypeRequiredDefault
volumeSeriesyes—
shortintno5
longintno10

vortex

Signature: vortex(high, low, close, length=14)

Returns: tuple

Vortex Indicator — returns (plus, minus).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno14

vortex_minus

Signature: vortex_minus(high, low, close, length=14)

Returns: numeric

Vortex negative line (VI-).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno14

vortex_plus

Signature: vortex_plus(high, low, close, length=14)

Returns: numeric

Vortex positive line (VI+).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno14

vwap

Signature: vwap(high, low, close, volume)

Returns: numeric

Volume Weighted Average Price over the entire series.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
volumeSeriesyes—

vwma

Signature: vwma(data, volume, length=20)

Returns: numeric

Volume Weighted Moving Average over window.

ParameterTypeRequiredDefault
dataSeriesyes—
volumeSeriesyes—
lengthintno20

wclprice

Signature: wclprice(high, low, close)

Returns: numeric

Weighted Close Price.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—

williams_r

Signature: williams_r(high, low, close, window=14)

Returns: numeric

Williams %R momentum indicator (-100 to 0).

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
windowintno14

wma

Signature: wma(data, window)

Returns: numeric

Weighted Moving Average.

ParameterTypeRequiredDefault
dataSeriesyes—
windowintyes—

woodies_cci

Signature: woodies_cci(high, low, close, length=14, turbo=6)

Returns: numeric

Woodies CCI (FE plot0, histogram) — classic CCI on CLOSE with given length. FE woodies-cci uses source = bars.map(b => b.close) (not HLC3) and plots three lines: plot0=CCI(close, cciLength) histogram; plot1=CCI(close, turboLength); plot2=CCI(close, cciLength). DSL returns plot0 (the histogram series). The turbo parameter is preserved for signature compatibility.

ParameterTypeRequiredDefault
highSeriesyes—
lowSeriesyes—
closeSeriesyes—
lengthintno14
turbointno6

zscore

Signature: zscore(data, window=20)

Returns: numeric

Rolling Z-score (standardized value).

ParameterTypeRequiredDefault
dataSeriesyes—
windowintno20

Signal

cross

Signature: cross(series1, series2)

Returns: boolean

Detect when series1 crosses series2 in either direction.

ParameterTypeRequiredDefault
series1Seriesyes—
series2Seriesyes—

crossover

Signature: crossover(series1, series2)

Returns: boolean

Detect when series1 crosses above series2.

ParameterTypeRequiredDefault
series1anyyes—
series2anyyes—

crossunder

Signature: crossunder(series1, series2)

Returns: boolean

Detect when series1 crosses below series2.

ParameterTypeRequiredDefault
series1anyyes—
series2anyyes—

Pattern

abandoned_baby

Signature: abandoned_baby(open, high, low, close)

Returns: numeric

Abandoned Baby: gap-down doji between two candles (bullish or bearish).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

advance_block

Signature: advance_block(open, high, low, close)

Returns: numeric

Advance Block: simplified bearish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

belt_hold

Signature: belt_hold(open, high, low, close)

Returns: numeric

Belt Hold: large body (>1.5x avg) with tiny shadow on the opening side.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

breakaway

Signature: breakaway(open, high, low, close)

Returns: numeric

Breakaway: simplified bullish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

closing_marubozu

Signature: closing_marubozu(open, high, low, close)

Returns: numeric

Closing Marubozu: no shadow on the closing side (bullish: no upper, bearish: no lower).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

concealing_baby_swallow

Signature: concealing_baby_swallow(open, high, low, close)

Returns: numeric

Concealing Baby Swallow: simplified bullish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

counterattack

Signature: counterattack(open, high, low, close)

Returns: numeric

Counterattack: opposite-color candles with same close.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

dark_cloud_cover

Signature: dark_cloud_cover(open, high, low, close)

Returns: numeric

Dark Cloud Cover: bullish candle -> bearish candle that closes below 50% of prev body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

deliberation

Signature: deliberation(open, high, low, close)

Returns: numeric

Deliberation: simplified bearish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

doji

Signature: doji(open, high, low, close)

Returns: numeric

Doji: body < 5% of total range.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

dojistar

Signature: dojistar(open, high, low, close)

Returns: numeric

Doji Star: large candle followed by a doji with a gap.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

downside_tasuki_gap

Signature: downside_tasuki_gap(open, high, low, close)

Returns: numeric

Downside Tasuki Gap: bearish-side tasuki gap only.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

dragonfly_doji

Signature: dragonfly_doji(open, high, low, close)

Returns: numeric

Dragonfly Doji: doji with long lower shadow (>60% range) and tiny upper shadow (<10% range).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

engulfing

Signature: engulfing(open, high, low, close)

Returns: numeric

Engulfing: current candle body completely engulfs previous candle body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

evening_doji_star

Signature: evening_doji_star(open, high, low, close)

Returns: numeric

Evening Doji Star: bullish -> doji -> bearish (closes below 50% of 1st body).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

evening_star

Signature: evening_star(open, high, low, close)

Returns: numeric

Evening Star: long bullish -> small body -> long bearish (closes below 50% of 1st body).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

falling_three_methods

Signature: falling_three_methods(open, high, low, close)

Returns: numeric

Falling Three Methods: simplified bearish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

gap_side_by_side_white

Signature: gap_side_by_side_white(open, high, low, close)

Returns: numeric

Gap Side By Side White: two bullish candles with similar opens after a gap.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

gravestone_doji

Signature: gravestone_doji(open, high, low, close)

Returns: numeric

Gravestone Doji: doji with long upper shadow (>60% range) and tiny lower shadow (<10% range).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

hammer

Signature: hammer(open, high, low, close)

Returns: numeric

Hammer: small body at top, lower shadow >= 2x body, upper shadow < 30% body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

hanging_man

Signature: hanging_man(open, high, low, close)

Returns: numeric

Hanging Man: like hammer but bearish context (close < open).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

harami

Signature: harami(open, high, low, close)

Returns: numeric

Harami: current candle body is contained within previous candle body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

harami_cross

Signature: harami_cross(open, high, low, close)

Returns: numeric

Harami Cross: large candle followed by a doji contained within its body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

high_wave

Signature: high_wave(open, high, low, close)

Returns: numeric

High Wave: very small body (<15% range) with both long shadows (>30% range).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

homing_pigeon

Signature: homing_pigeon(open, high, low, close)

Returns: numeric

Homing Pigeon: two bearish candles, second contained within the first (bullish reversal).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

identical_three_crows

Signature: identical_three_crows(open, high, low, close)

Returns: numeric

Identical Three Crows: three bearish candles, each opening at previous close.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

in_neck

Signature: in_neck(open, high, low, close)

Returns: numeric

In Neck: bearish candle -> bullish candle that closes near the close of the first.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

inverted_hammer

Signature: inverted_hammer(open, high, low, close)

Returns: numeric

Inverted Hammer: small body at bottom, upper shadow >= 2x body, lower shadow < 30% body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

kicking

Signature: kicking(open, high, low, close)

Returns: numeric

Kicking: two opposite marubozu candles with a gap.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

kicking_by_length

Signature: kicking_by_length(open, high, low, close)

Returns: numeric

Kicking By Length: alias for Kicking.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

ladder_bottom

Signature: ladder_bottom(open, high, low, close)

Returns: numeric

Ladder Bottom: simplified bullish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

long_legged_doji

Signature: long_legged_doji(open, high, low, close)

Returns: numeric

Long Legged Doji: doji with both shadows > 30% of range.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

marubozu

Signature: marubozu(open, high, low, close)

Returns: numeric

Marubozu: body > 95% of total range (almost no shadows).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

mat_hold

Signature: mat_hold(open, high, low, close)

Returns: numeric

Mat Hold: simplified bullish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

matching_high

Signature: matching_high(open, high, low, close)

Returns: numeric

Matching High: two bullish candles with same close (bearish reversal).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

matching_low

Signature: matching_low(open, high, low, close)

Returns: numeric

Matching Low: two bearish candles with same close (bullish reversal).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

meeting_lines

Signature: meeting_lines(open, high, low, close)

Returns: numeric

Meeting Lines: opposite-color candles with same close.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

morning_doji_star

Signature: morning_doji_star(open, high, low, close)

Returns: numeric

Morning Doji Star: bearish -> doji -> bullish (closes above 50% of 1st body).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

morning_star

Signature: morning_star(open, high, low, close)

Returns: numeric

Morning Star: long bearish -> small body -> long bullish (closes above 50% of 1st body).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

on_neck

Signature: on_neck(open, high, low, close)

Returns: numeric

On Neck: bearish candle -> bullish candle that closes near the low of the first.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

opening_marubozu

Signature: opening_marubozu(open, high, low, close)

Returns: numeric

Opening Marubozu: no shadow on the opening side (bullish: no lower, bearish: no upper).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

piercing

Signature: piercing(open, high, low, close)

Returns: numeric

Piercing Line: bearish candle -> bullish candle that closes above 50% of prev body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

rickshaw_man

Signature: rickshaw_man(open, high, low, close)

Returns: numeric

Rickshaw Man: alias for Long Legged Doji.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

rising_three_methods

Signature: rising_three_methods(open, high, low, close)

Returns: numeric

Rising Three Methods: simplified bullish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

separating_lines

Signature: separating_lines(open, high, low, close)

Returns: numeric

Separating Lines: opposite-color candles with same open.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

shooting_star

Signature: shooting_star(open, high, low, close)

Returns: numeric

Shooting Star: like inverted hammer but bearish context (close < open).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

side_by_side_white_lines

Signature: side_by_side_white_lines(open, high, low, close)

Returns: numeric

Side By Side White Lines: alias for Gap Side By Side White.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

spinning_top

Signature: spinning_top(open, high, low, close)

Returns: numeric

Spinning Top: small body (<30% range) with both shadows > body.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

stalled_pattern

Signature: stalled_pattern(open, high, low, close)

Returns: numeric

Stalled Pattern: simplified bearish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

stick_sandwich

Signature: stick_sandwich(open, high, low, close)

Returns: numeric

Stick Sandwich: bearish-bullish-bearish with 1st and 3rd close at same level.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

tasuki_gap

Signature: tasuki_gap(open, high, low, close)

Returns: numeric

Tasuki Gap: two same-direction candles with gap, 3rd opposite fills the gap.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_black_crows

Signature: three_black_crows(open, high, low, close)

Returns: numeric

Three Black Crows: three consecutive bearish candles, each closing lower.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_inside

Signature: three_inside(open, high, low, close)

Returns: numeric

Three Inside: harami pattern confirmed by 3rd candle breaking out.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_inside_down

Signature: three_inside_down(open, high, low, close)

Returns: numeric

Three Inside Down: bullish -> bearish harami -> bearish close below 1st open.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_inside_up

Signature: three_inside_up(open, high, low, close)

Returns: numeric

Three Inside Up: bearish -> bullish harami -> bullish close above 1st open.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_line_strike

Signature: three_line_strike(open, high, low, close)

Returns: numeric

Three Line Strike: three same-direction candles + 4th opposite engulfs all three.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_outside

Signature: three_outside(open, high, low, close)

Returns: numeric

Three Outside: engulfing pattern confirmed by 3rd candle continuing.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_stars_in_south

Signature: three_stars_in_south(open, high, low, close)

Returns: numeric

Three Stars in South: simplified bullish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

three_white_soldiers

Signature: three_white_soldiers(open, high, low, close)

Returns: numeric

Three White Soldiers: three consecutive bullish candles, each closing higher.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

thrusting

Signature: thrusting(open, high, low, close)

Returns: numeric

Thrusting: bearish candle -> bullish candle that closes above prev close but below midpoint.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

tristar

Signature: tristar(open, high, low, close)

Returns: numeric

Tri-Star: three consecutive dojis with middle one gapping.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

tweezer_bottom

Signature: tweezer_bottom(open, high, low, close)

Returns: numeric

Tweezer Bottom: two candles with same low, first bearish, second bullish.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

tweezer_top

Signature: tweezer_top(open, high, low, close)

Returns: numeric

Tweezer Top: two candles with same high, first bullish, second bearish.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

two_crows

Signature: two_crows(open, high, low, close)

Returns: numeric

Two Crows: bullish -> bearish gap up -> bearish closing below 1st close.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

unique_three_river

Signature: unique_three_river(open, high, low, close)

Returns: numeric

Unique Three River: simplified bullish triple reversal.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

up_down_gap_three_methods

Signature: up_down_gap_three_methods(open, high, low, close)

Returns: numeric

Up/Down Gap Three Methods: alias for Tasuki Gap.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

upside_gap_two_crows

Signature: upside_gap_two_crows(open, high, low, close)

Returns: numeric

Upside Gap Two Crows: bullish -> bearish gap up -> bearish engulfing (bearish).

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

upside_tasuki_gap

Signature: upside_tasuki_gap(open, high, low, close)

Returns: numeric

Upside Tasuki Gap: bullish-side tasuki gap only.

ParameterTypeRequiredDefault
openpl.Seriesyes—
highpl.Seriesyes—
lowpl.Seriesyes—
closepl.Seriesyes—

Timeseries

adf_statistic

Signature: adf_statistic(x, d=60)

Returns: numeric

Rolling Augmented Dickey-Fuller test statistic. Tests for stationarity. More negative = more stationary. Critical values: -3.43 (1%), -2.86 (5%), -2.57 (10%) Args: x: Time series to test d: Rolling window size Returns: ADF test statistic series Usage: adf = adf_statistic(spread, 60) is_stationary = adf < -2.86 # 5% significance

ParameterTypeRequiredDefault
xSeriesyes—
dintno60

half_life

Signature: half_life(x, d=60)

Returns: numeric

Rolling half-life of mean reversion. Estimates how quickly a series reverts to its mean using AR(1) model. Half-life = -ln(2) / ln(rho) where rho is AR(1) coefficient. Args: x: Time series (typically a spread or z-score) d: Rolling window size Returns: Half-life in number of periods (lower = faster mean reversion) Usage: hl = half_life(spread, 60) # Good pair if hl is between 1-30 days

ParameterTypeRequiredDefault
xSeriesyes—
dintno60

hurst_exponent

Signature: hurst_exponent(x, d=100, max_lag=20)

Returns: numeric

Rolling Hurst Exponent for regime detection. H < 0.5: Mean-reverting (good for pair trading) H = 0.5: Random walk (no predictability) H > 0.5: Trending (momentum strategies) Args: x: Time series to analyze d: Rolling window size max_lag: Maximum lag for R/S calculation Returns: Hurst exponent series Usage: h = hurst_exponent(spread, 100) is_mean_reverting = h < 0.5

ParameterTypeRequiredDefault
xSeriesyes—
dintno100
max_lagintno20

kalman_filter

Signature: kalman_filter(y, x, delta=0.0001, ve=0.001)

Returns: tuple

Kalman Filter - Returns (beta, alpha, spread) tuple. Full Kalman filter output for pair trading. Usage: beta, alpha, spread = kalman_filter(price_y, price_x)

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
deltafloatno0.0001
vefloatno0.001

kalman_hedge_ratio

Signature: kalman_hedge_ratio(y, x, delta=0.0001, ve=0.001)

Returns: numeric

Kalman Filter for adaptive hedge ratio estimation. Implements online Kalman filter to estimate time-varying hedge ratio (beta). Superior to OLS for non-stationary relationships. Args: y: Dependent variable (e.g., asset Y price) x: Independent variable (e.g., asset X price) delta: Process variance - controls how fast beta can change (default: 1e-4) ve: Measurement variance - observation noise (default: 1e-3) Returns: Time-varying hedge ratio (beta) series Usage: beta = kalman_hedge_ratio(price_y, price_x) spread = price_y - beta * price_x

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
deltafloatno0.0001
vefloatno0.001

rolling_ols_beta

Signature: rolling_ols_beta(y, x, d)

Returns: numeric

Rolling OLS hedge ratio (beta). Standard rolling regression beta. Use kalman_hedge_ratio for adaptive estimation that handles regime changes better. Args: y: Dependent variable x: Independent variable d: Rolling window Returns: Rolling beta series

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
dintyes—

spread

Signature: spread(y, x, beta)

Returns: numeric

Calculate spread given hedge ratio. Args: y: Dependent asset price x: Independent asset price beta: Hedge ratio (can be from OLS or Kalman) Returns: Spread series (y - beta * x) Usage: beta = kalman_hedge_ratio(price_y, price_x) sprd = spread(price_y, price_x, beta) zscore = ts_zscore(sprd, 20)

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
betaSeriesyes—

spread_zscore

Signature: spread_zscore(y, x, d=60)

Returns: numeric

Z-score of Kalman filter spread. Combines Kalman filter hedge ratio estimation with z-score normalization. Useful for generating pair trading signals directly. Args: y: Dependent asset price x: Independent asset price d: Window for z-score calculation Returns: Z-score of spread Usage: zscore = spread_zscore(price_y, price_x, 60) long_signal = zscore < -2 short_signal = zscore > 2

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
dintno60

ts_arg_max

Signature: ts_arg_max(x, d)

Returns: numeric

Returns the relative index of the max value in the time series for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_arg_min

Signature: ts_arg_min(x, d)

Returns: numeric

Returns the relative index of the min value in the time series for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_av_diff

Signature: ts_av_diff(x, d)

Returns: numeric

Returns x - tsmean(x, d)

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_backfill

Signature: ts_backfill(x, lookback=None, k=1, ignore=None)

Returns: numeric

Backfill is the process of replacing the NAN values by a meaningful value (i.e., a first non-NaN value)

ParameterTypeRequiredDefault
xSeriesyes—
lookbackintnoNone
kintno1
ignorefloatnoNone

ts_corr

Signature: ts_corr(x, y, d)

Returns: numeric

Returns correlation of x and y for the past d days. OPTIMIZED: Uses numpy vectorized operations for O(n) complexity.

ParameterTypeRequiredDefault
xSeriesyes—
ySeriesyes—
dintyes—

ts_count_nans

Signature: ts_count_nans(x, d)

Returns: numeric

Returns the number of NaN values in x for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_covariance

Signature: ts_covariance(y, x, d)

Returns: numeric

Returns covariance of y and x for the past d days

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
dintyes—

ts_decay_linear

Signature: ts_decay_linear(x, d, dense=False)

Returns: numeric

Returns the linear decay on x for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—
denseboolnoFalse

ts_delay

Signature: ts_delay(x, d)

Returns: numeric

Returns x value d bars ago

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_delta

Signature: ts_delta(x, d)

Returns: numeric

Returns x - ts_delay(x, d)

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_max

Signature: ts_max(x, d)

Returns: numeric

Returns maximum value of x for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_mean

Signature: ts_mean(x, d)

Returns: numeric

Returns average value of x for the past d days.

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_min

Signature: ts_min(x, d)

Returns: numeric

Returns minimum value of x for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_product

Signature: ts_product(x, d)

Returns: numeric

Returns product of x for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_rank

Signature: ts_rank(x, d, constant=0)

Returns: numeric

Rank the values of x for each instrument over the past d days, then return the rank of the current value + constant.

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—
constantfloatno0

ts_regintercept

Signature: ts_regintercept(y, x, d)

Returns: numeric

Returns rolling regression intercept (alpha) of y on x.

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
dintyes—

ts_regression

Signature: ts_regression(y, x, d, lag=0, rettype=0)

Returns: numeric

Returns various parameters related to regression function. OPTIMIZED: Uses numpy vectorized operations with stride_tricks for O(n) complexity.

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
dintyes—
lagintno0
rettypeLiteral[0, 1, 2]no0

ts_regression_resid

Signature: ts_regression_resid(y, x, d)

Returns: numeric

Returns rolling regression residual (spread = y - beta*x - alpha).

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
dintyes—

ts_regslope

Signature: ts_regslope(y, x, d)

Returns: numeric

Returns rolling regression slope (beta/hedge ratio) of y on x.

ParameterTypeRequiredDefault
ySeriesyes—
xSeriesyes—
dintyes—

ts_scale

Signature: ts_scale(x, d, constant=0)

Returns: numeric

Returns (x - ts_min(x, d)) / (ts_max(x, d) - ts_min(x, d)) + constant

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—
constantfloatno0

ts_std_dev

Signature: ts_std_dev(x, d)

Returns: numeric

Returns standard deviation of x for the past d days

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_sum

Signature: ts_sum(x, d)

Returns: numeric

Sum values of x for the past d days.

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

ts_zscore

Signature: ts_zscore(x, d)

Returns: numeric

Z-score: (x - tsmean(x,d)) / tsstddev(x,d)

ParameterTypeRequiredDefault
xSeriesyes—
dintyes—

Arithmetic

abs

Signature: abs(x)

Returns: numeric

Absolute value of x

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—

add

Signature: add(x, y, filter=False)

Returns: numeric

Add all inputs (at least 2 inputs required). If filter = true, filter all input NaN to 0 before adding

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—
filterboolnoFalse

divide

Signature: divide(x, y)

Returns: numeric

Divide x by y

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—

inverse

Signature: inverse(x)

Returns: numeric

Inverse of x

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—

log

Signature: log(x)

Returns: numeric

Natural logarithm of x

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—

max

Signature: max(x, y, *args)

Returns: numeric

Maximum value of all inputs. At least 2 inputs are required

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—
*argsUnion[float, int, Series]no—

min

Signature: min(x, y, *args)

Returns: numeric

Minimum value of all inputs. At least 2 inputs are required

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—
*argsUnion[float, int, Series]no—

multiply

Signature: multiply(x, y, *args, filter=False)

Returns: numeric

Multiply all inputs. At least 2 inputs are required. Filter sets the NaN values to 1

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—
*argsUnion[float, int, Series]no—
filterboolnoFalse

power

Signature: power(x, y)

Returns: numeric

x raised to the power of y

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—

reverse

Signature: reverse(x)

Returns: numeric

Reverse of x

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—

sign

Signature: sign(x)

Returns: numeric

Sign of x

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—

signed_power

Signature: signed_power(x, y)

Returns: numeric

x raised to the power of y such that final result preserves sign of x

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—

subtract

Signature: subtract(x, y, filter=False)

Returns: numeric

Subtract y from x. If filter = true, filter all input NaN to 0 before subtracting

ParameterTypeRequiredDefault
xUnion[float, int, Series]yes—
yUnion[float, int, Series]yes—
filterboolnoFalse

Logical

and_operator

Signature: and_operator(input1, input2)

Returns: boolean

Logical AND operator, returns true if both operands are true and returns false otherwise

ParameterTypeRequiredDefault
input1Union[float, int, Series, bool]yes—
input2Union[float, int, Series, bool]yes—

if_else

Signature: if_else(condition, a, b)

Returns: boolean

If condition is true, return a, else return b

ParameterTypeRequiredDefault
conditionSeriesyes—
aanyyes—
banyyes—

is_nan

Signature: is_nan(a)

Returns: boolean

Return true if a is nan

ParameterTypeRequiredDefault
aSeriesyes—

is_not_nan

Signature: is_not_nan(a)

Returns: boolean

Return true if a is not nan

ParameterTypeRequiredDefault
aSeriesyes—

logical_not

Signature: logical_not(a)

Returns: boolean

Return true if a is false

ParameterTypeRequiredDefault
aSeriesyes—

not_operator

Signature: not_operator(x)

Returns: boolean

Returns the logical negation of x. If x is true (1), it returns false (0), and if input is false (0), it returns true (1).

ParameterTypeRequiredDefault
xUnion[float, int, Series, bool]yes—

or_operator

Signature: or_operator(input1, input2)

Returns: boolean

Logical OR operator returns true if either or both inputs are true and returns false otherwise

ParameterTypeRequiredDefault
input1Union[float, int, Series, bool]yes—
input2Union[float, int, Series, bool]yes—

Wallet

wallet_filled

Signature: wallet_filled(address, coin=None)

Returns: boolean

Check if a tracked wallet has a new fill.

ParameterTypeRequiredDefault
addressstryes—
coinstrnoNone

wallet_price

Signature: wallet_price(address, coin=None)

Returns: numeric

Get the price of the latest fill.

ParameterTypeRequiredDefault
addressstryes—
coinstrnoNone

wallet_side

Signature: wallet_side(address, coin=None)

Returns: string

Get the side of the latest fill (BUY/SELL).

ParameterTypeRequiredDefault
addressstryes—
coinstrnoNone

wallet_size

Signature: wallet_size(address, coin=None)

Returns: numeric

Get the size of the latest fill.

ParameterTypeRequiredDefault
addressstryes—
coinstrnoNone