Trend Signals

88 signals in this category. See the full Signal Catalog for the cross-category index, or the Signals Overview for an introduction. Click a signal to expand parameters and examples.
Check if +DI is greater than -DI (bullish directional movement). When +DI > -DI, bulls have the upper hand.Parameters
NameTypeRangeDefaultDescription
windowint5 — 5014ADX period
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "adx_bullish_di",
    "parameters": {
        "window": 14
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if ADX indicates a strong trend. ADX values above 25 typically indicate a strong trend (either up or down).Parameters
NameTypeRangeDefaultDescription
windowint5 — 5014ADX period
thresholdfloat15.0 — 50.025.0Trend strength threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "adx_strong_trend",
    "parameters": {
        "window": 14,
        "threshold": 25.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Williams Alligator lines are in bearish alignment (lips < teeth < jaw). Strong downtrend, all lines spreading downward.Parameters
NameTypeRangeDefaultDescription
jawint5 — 5013Jaw SMMA period
teethint3 — 308Teeth SMMA period
lipsint2 — 205Lips SMMA period
jaw_offsetint0 — 208Jaw forward shift
teeth_offsetint0 — 155Teeth forward shift
lips_offsetint0 — 103Lips forward shift
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "alligator_bearish",
    "parameters": {
        "jaw": 13,
        "teeth": 8,
        "lips": 5,
        "jaw_offset": 8,
        "teeth_offset": 5,
        "lips_offset": 3
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Williams Alligator lines are in bullish alignment (lips > teeth > jaw). Bill Williams’s “hungry alligator” state: strong uptrend, all lines spreading upward.Parameters
NameTypeRangeDefaultDescription
jawint5 — 5013Jaw SMMA period
teethint3 — 308Teeth SMMA period
lipsint2 — 205Lips SMMA period
jaw_offsetint0 — 208Jaw forward shift
teeth_offsetint0 — 155Teeth forward shift
lips_offsetint0 — 103Lips forward shift
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "alligator_bullish",
    "parameters": {
        "jaw": 13,
        "teeth": 8,
        "lips": 5,
        "jaw_offset": 8,
        "teeth_offset": 5,
        "lips_offset": 3
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the Williams Alligator is sleeping (lines tangled, no trend). True when lines are neither strictly bullish-aligned nor bearish-aligned. Used as a no-trade filter during consolidation.Parameters
NameTypeRangeDefaultDescription
jawint5 — 5013Jaw SMMA period
teethint3 — 308Teeth SMMA period
lipsint2 — 205Lips SMMA period
jaw_offsetint0 — 208Jaw forward shift
teeth_offsetint0 — 155Teeth forward shift
lips_offsetint0 — 103Lips forward shift
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "alligator_sleeping",
    "parameters": {
        "jaw": 13,
        "teeth": 8,
        "lips": 5,
        "jaw_offset": 8,
        "teeth_offset": 5,
        "lips_offset": 3
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish ALMA crossover (fast ALMA crosses below slow ALMA).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast ALMA window
window_slowint2 — 20021Slow ALMA window
offsetfloat0.0 — 1.00.85Weight center
sigmafloat0.1 — 20.06.0Gaussian spread
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "alma_cross_down",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21,
        "offset": 0.85,
        "sigma": 6.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish ALMA crossover (fast ALMA crosses above slow ALMA). Both ALMAs use the same offset and sigma; only the window differs.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast ALMA window
window_slowint2 — 20021Slow ALMA window
offsetfloat0.0 — 1.00.85Weight center
sigmafloat0.1 — 20.06.0Gaussian spread
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "alma_cross_up",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21,
        "offset": 0.85,
        "sigma": 6.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Aroon lines cross (trend change signal).Parameters
NameTypeRangeDefaultDescription
windowint10 — 5025Lookback period
directionstr-bullishCrossover direction, ‘bullish’ or ‘bearish’
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "aroon_crossover",
    "parameters": {
        "window": 25,
        "direction": "bullish"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Aroon Down indicates strong downtrend.Parameters
NameTypeRangeDefaultDescription
windowint10 — 5025Lookback period
thresholdfloat50.0 — 100.070.0Strong trend threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "aroon_down_trend",
    "parameters": {
        "window": 25,
        "threshold": 70.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Aroon Up indicates strong uptrend.Parameters
NameTypeRangeDefaultDescription
windowint10 — 5025Lookback period
thresholdfloat50.0 — 100.070.0Strong trend threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "aroon_up_trend",
    "parameters": {
        "window": 25,
        "threshold": 70.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if CCI indicates overbought condition.Parameters
NameTypeRangeDefaultDescription
windowint10 — 5020CCI period
constantfloat0.001 — 0.10.015CCI constant
thresholdfloat50.0 — 200.0100.0Overbought threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "cci_overbought",
    "parameters": {
        "window": 20,
        "constant": 0.015,
        "threshold": 100.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if CCI indicates oversold condition.Parameters
NameTypeRangeDefaultDescription
windowint10 — 5020CCI period
constantfloat0.001 — 0.10.015CCI constant
thresholdfloat-200.0 — -50.0-100.0Oversold threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "cci_oversold",
    "parameters": {
        "window": 20,
        "constant": 0.015,
        "threshold": -100.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if close has breached the Chandelier long stop (close < long_stop). If holding a long position, this is your exit trigger.Parameters
NameTypeRangeDefaultDescription
windowint5 — 10022Rolling high/ATR window
multiplierfloat0.5 — 10.03.0ATR multiplier
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "chandelier_long_stop_hit",
    "parameters": {
        "window": 22,
        "multiplier": 3.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if close has breached the Chandelier short stop (close > short_stop). If holding a short position, this is your exit trigger.Parameters
NameTypeRangeDefaultDescription
windowint5 — 10022Rolling low/ATR window
multiplierfloat0.5 — 10.03.0ATR multiplier
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "chandelier_short_stop_hit",
    "parameters": {
        "window": 22,
        "multiplier": 3.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish DEMA crossover (fast DEMA crosses below slow DEMA). Lower-lag equivalent of an SMA/EMA death cross.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast DEMA window
window_slowint2 — 20021Slow DEMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "dema_cross_down",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish DEMA crossover (fast DEMA crosses above slow DEMA). Lower-lag equivalent of an SMA/EMA golden cross.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast DEMA window
window_slowint2 — 20021Slow DEMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "dema_cross_up",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if DPO is negative (price below detrended average).Parameters
NameTypeRangeDefaultDescription
windowint10 — 5020DPO period
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "dpo_negative",
    "parameters": {
        "window": 20
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if DPO is positive (price above detrended average).Parameters
NameTypeRangeDefaultDescription
windowint10 — 5020DPO period
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "dpo_positive",
    "parameters": {
        "window": 20
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect bearish EMA crossover (fast EMA crosses below slow EMA). Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast EMA window
window_slowint5 — 20021Slow EMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ema_cross_down",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect bullish EMA crossover (fast EMA crosses above slow EMA). Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast EMA window
window_slowint5 — 20021Slow EMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ema_cross_up",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect an EMA crossover signal with configurable direction (bullish or bearish). Uses EMA indicator to calculate window_fast and window_slow EMAs. Returns True when a crossover is detected in the specified direction. Bullish crossover: window_fast EMA crosses above window_slow EMA Bearish crossover: window_fast EMA crosses below window_slow EMA The crossover detection compares the previous and current bars: - Bullish: prev window_fast <= prev window_slow AND current window_fast > current window_slow - Bearish: prev window_fast >= prev window_slow AND current window_fast < current window_slow Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets.Parameters
NameTypeRangeDefaultDescription
window_fastint1 — 200requiredFast EMA window in bars
window_slowint1 — 200requiredSlow EMA window in bars
directionstr-bullishCrossover direction, ‘bullish’ or ‘bearish’
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ema_crossover",
    "parameters": {
        "window_fast": 1,
        "window_slow": 1,
        "direction": "bullish"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish EPMA crossover (fast EPMA crosses below slow EPMA).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 10010Fast EPMA window
window_slowint2 — 20030Slow EPMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "epma_cross_down",
    "parameters": {
        "window_fast": 10,
        "window_slow": 30
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish EPMA crossover (fast EPMA crosses above slow EPMA).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 10010Fast EPMA window
window_slowint2 — 20030Slow EPMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "epma_cross_up",
    "parameters": {
        "window_fast": 10,
        "window_slow": 30
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current Heikin-Ashi candle is bearish (HA_close < HA_open).No configurable parameters.Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "heikin_ashi_bearish",
    "parameters": {}
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current Heikin-Ashi candle is bullish (HA_close > HA_open). A bullish HA candle indicates buying pressure on the smoothed bar. Strings of bullish HA candles indicate a sustained uptrend.No configurable parameters.Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "heikin_ashi_bullish",
    "parameters": {}
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish HMA crossover (fast HMA crosses below slow HMA). Low-lag crossover; fires earlier than SMA/EMA equivalents.Parameters
NameTypeRangeDefaultDescription
window_fastint4 — 1009Fast HMA window
window_slowint4 — 20025Slow HMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "hma_cross_down",
    "parameters": {
        "window_fast": 9,
        "window_slow": 25
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish HMA crossover (fast HMA crosses above slow HMA). Low-lag crossover; fires earlier than SMA/EMA equivalents.Parameters
NameTypeRangeDefaultDescription
window_fastint4 — 1009Fast HMA window
window_slowint4 — 20025Slow HMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "hma_cross_up",
    "parameters": {
        "window_fast": 9,
        "window_slow": 25
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Ichimoku indicates bearish signal (price below cloud).Parameters
NameTypeRangeDefaultDescription
window_tenkanint5 — 209Tenkan-sen (conversion line) window
window_kijunint15 — 4026Kijun-sen (base line) window
window_senkouint30 — 7052Senkou Span B (leading span B) window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ichimoku_bearish",
    "parameters": {
        "window_tenkan": 9,
        "window_kijun": 26,
        "window_senkou": 52
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Ichimoku indicates bullish signal (price above cloud).Parameters
NameTypeRangeDefaultDescription
window_tenkanint5 — 209Tenkan-sen (conversion line) window
window_kijunint15 — 4026Kijun-sen (base line) window
window_senkouint30 — 7052Senkou Span B (leading span B) window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ichimoku_bullish",
    "parameters": {
        "window_tenkan": 9,
        "window_kijun": 26,
        "window_senkou": 52
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Tenkan-sen crosses Kijun-sen (TK cross).Parameters
NameTypeRangeDefaultDescription
window_tenkanint5 — 209Tenkan-sen (conversion line) window
window_kijunint15 — 4026Kijun-sen (base line) window
window_senkouint30 — 7052Senkou Span B (leading span B) window
directionstr-bullishCrossover direction, ‘bullish’ or ‘bearish’
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ichimoku_tk_cross",
    "parameters": {
        "window_tenkan": 9,
        "window_kijun": 26,
        "window_senkou": 52,
        "direction": "bullish"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Arnaud Legoux Moving Average (ALMA). ALMA is a Gaussian-weighted MA that can be tuned to react faster (offset near 1, lower sigma) or smoother (offset near 0, higher sigma).Parameters
NameTypeRangeDefaultDescription
windowint2 — 20021ALMA window in bars
offsetfloat0.0 — 1.00.85Weight center, 0=oldest, 1=newest
sigmafloat0.1 — 20.06.0Gaussian spread. Higher = smoother
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_alma",
    "parameters": {
        "window": 21,
        "offset": 0.85,
        "sigma": 6.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Double Exponential Moving Average (DEMA). DEMA reduces lag compared to a standard EMA by combining two EMA passes. Useful for trend-following filters where responsiveness matters.Parameters
NameTypeRangeDefaultDescription
windowint2 — 20021DEMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_dema",
    "parameters": {
        "window": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the End Point Moving Average (EPMA / LSMA). EPMA is the endpoint of a linear regression over the window, projecting the trend to “now” rather than averaging past values.Parameters
NameTypeRangeDefaultDescription
windowint2 — 20020EPMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_epma",
    "parameters": {
        "window": 20
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Hull Moving Average (HMA). HMA tracks price with very low lag while remaining smoother than WMA. A common crypto trend filter.Parameters
NameTypeRangeDefaultDescription
windowint4 — 20016HMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_hma",
    "parameters": {
        "window": 16
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the MESA Adaptive Moving Average (MAMA). MAMA adapts its smoothing to volatility via a Hilbert transform.Parameters
NameTypeRangeDefaultDescription
fast_limitfloat0.1 — 1.00.5Upper alpha bound (fast response)
slow_limitfloat0.01 — 0.50.05Lower alpha bound (slow response)
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_mama",
    "parameters": {
        "fast_limit": 0.5,
        "slow_limit": 0.05
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Simple Moving Average. Uses SMA indicator to calculate the SMA for the given window and returns True if the most recent close price is strictly greater than the SMA value. Returns False if insufficient data is available. Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets.Parameters
NameTypeRangeDefaultDescription
windowint1 — 200requiredSMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_sma",
    "parameters": {
        "window": 1
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Smoothed Moving Average (SMMA / Wilder’s). SMMA uses Wilder’s smoothing (alpha=1/n) rather than EMA’s 2/(n+1), producing a slower, more stable trend line. Same family used inside RSI and ATR.Parameters
NameTypeRangeDefaultDescription
windowint2 — 20014SMMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_smma",
    "parameters": {
        "window": 14
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Tillson T3 moving average. T3 is a smooth low-lag MA that combines 6 EMAs via the volume factor.Parameters
NameTypeRangeDefaultDescription
windowint2 — 20010T3 window in bars
volume_factorfloat0.0 — 1.00.7Tillson volume factor, controls smoothness
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_t3",
    "parameters": {
        "window": 10,
        "volume_factor": 0.7
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Triple Exponential Moving Average (TEMA). TEMA has even less lag than DEMA by combining three EMA passes.Parameters
NameTypeRangeDefaultDescription
windowint2 — 20021TEMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_tema",
    "parameters": {
        "window": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the current price is above the Triangular Moving Average (TRIMA). TRIMA is a double-smoothed SMA that weights the middle of the window more heavily, producing a smoother trend line than SMA.Parameters
NameTypeRangeDefaultDescription
windowint2 — 20020TRIMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "is_above_trima",
    "parameters": {
        "window": 20
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if KST crosses below signal line (bearish).Parameters
NameTypeRangeDefaultDescription
roc1int1 — 20010ROC1 period
roc2int1 — 20015ROC2 period
roc3int1 — 20020ROC3 period
roc4int1 — 20030ROC4 period
window_sma1int2 — 20010SMA1 smoothing window for ROC1
window_sma2int2 — 20010SMA2 smoothing window for ROC2
window_sma3int2 — 20010SMA3 smoothing window for ROC3
window_sma4int2 — 20015SMA4 smoothing window for ROC4
nsigint1 — 2009Signal line period
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "kst_bearish_cross",
    "parameters": {
        "roc1": 10,
        "roc2": 15,
        "roc3": 20,
        "roc4": 30,
        "window_sma1": 10,
        "window_sma2": 10,
        "window_sma3": 10,
        "window_sma4": 15,
        "nsig": 9
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if KST crosses above signal line (bullish).Parameters
NameTypeRangeDefaultDescription
roc1int1 — 20010ROC1 period
roc2int1 — 20015ROC2 period
roc3int1 — 20020ROC3 period
roc4int1 — 20030ROC4 period
window_sma1int2 — 20010SMA1 smoothing window for ROC1
window_sma2int2 — 20010SMA2 smoothing window for ROC2
window_sma3int2 — 20010SMA3 smoothing window for ROC3
window_sma4int2 — 20015SMA4 smoothing window for ROC4
nsigint1 — 2009Signal line period
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "kst_bullish_cross",
    "parameters": {
        "roc1": 10,
        "roc2": 15,
        "roc3": 20,
        "roc4": 30,
        "window_sma1": 10,
        "window_sma2": 10,
        "window_sma3": 10,
        "window_sma4": 15,
        "nsig": 9
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if all MAs in the ribbon are in strict bearish alignment (faster below slower).Parameters
NameTypeRangeDefaultDescription
windowstuple2.0 — 1000.0(5, 8, 13, 21, 34, 55, 89, 144)Strictly increasing tuple of SMA periods
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ma_ribbon_bearish",
    "parameters": {
        "windows": "(5, 8, 13, 21, 34, 55, 89, 144)"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if all MAs in the ribbon are in strict bullish alignment (faster above slower). Uses 8 Fibonacci-spaced SMAs by default. Strict alignment means SMA(5) > SMA(8) > SMA(13) > … > SMA(144). This is a strong trend filter — when true, the market is in a clear uptrend across all horizons.Parameters
NameTypeRangeDefaultDescription
windowstuple2.0 — 1000.0(5, 8, 13, 21, 34, 55, 89, 144)Strictly increasing tuple of SMA periods
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ma_ribbon_bullish",
    "parameters": {
        "windows": "(5, 8, 13, 21, 34, 55, 89, 144)"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if MAs in the ribbon are tangled (no strict alignment — consolidation filter). Useful as a no-trade filter during choppy markets.Parameters
NameTypeRangeDefaultDescription
windowstuple2.0 — 1000.0(5, 8, 13, 21, 34, 55, 89, 144)Strictly increasing tuple of SMA periods
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ma_ribbon_tangled",
    "parameters": {
        "windows": "(5, 8, 13, 21, 34, 55, 89, 144)"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect MACD bearish crossover (MACD line crosses below signal line). A bearish MACD crossover occurs when the MACD line crosses below the signal line, indicating potential downward momentum. Crypto’s high volatility may produce frequent signals; use with trend confirmation.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 5012Fast EMA window
window_slowint10 — 10026Slow EMA window
window_signint2 — 509Signal line EMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "macd_bearish_cross",
    "parameters": {
        "window_fast": 12,
        "window_slow": 26,
        "window_sign": 9
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect MACD bullish crossover (MACD line crosses above signal line). A bullish MACD crossover occurs when the MACD line crosses above the signal line, indicating potential upward momentum. Crypto’s high volatility may produce frequent signals; use with trend confirmation.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 5012Fast EMA window
window_slowint10 — 10026Slow EMA window
window_signint2 — 509Signal line EMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "macd_bullish_cross",
    "parameters": {
        "window_fast": 12,
        "window_slow": 26,
        "window_sign": 9
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if MACD histogram is positive (bullish momentum). Crypto’s high volatility may produce frequent signals; use with trend confirmation.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 5012Fast EMA window
window_slowint10 — 10026Slow EMA window
window_signint2 — 509Signal line EMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "macd_positive",
    "parameters": {
        "window_fast": 12,
        "window_slow": 26,
        "window_sign": 9
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish MAMA/FAMA crossover (MAMA crosses below FAMA). Classic Ehlers exit signal: MAMA falling below FAMA signals a downtrend.Parameters
NameTypeRangeDefaultDescription
fast_limitfloat0.1 — 1.00.5Upper alpha bound
slow_limitfloat0.01 — 0.50.05Lower alpha bound
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "mama_cross_down",
    "parameters": {
        "fast_limit": 0.5,
        "slow_limit": 0.05
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish MAMA/FAMA crossover (MAMA crosses above FAMA). Classic Ehlers entry signal: MAMA rising above FAMA signals an uptrend.Parameters
NameTypeRangeDefaultDescription
fast_limitfloat0.1 — 1.00.5Upper alpha bound
slow_limitfloat0.01 — 0.50.05Lower alpha bound
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "mama_cross_up",
    "parameters": {
        "fast_limit": 0.5,
        "slow_limit": 0.05
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Mass Index signals potential reversal (reversal bulge). A reversal bulge occurs when Mass Index rises above 27 then falls below 26.5.Parameters
NameTypeRangeDefaultDescription
window_fastint5 — 159Fast EMA period
window_slowint15 — 4025Sum period
threshold_highfloat25.0 — 30.027.0Upper threshold
threshold_lowfloat24.0 — 27.026.5Lower threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "mass_reversal_signal",
    "parameters": {
        "window_fast": 9,
        "window_slow": 25,
        "threshold_high": 27.0,
        "threshold_low": 26.5
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the higher-timeframe EMA is falling.Parameters
NameTypeRangeDefaultDescription
higher_tfstr-1WPandas offset alias
windowint2 — 10010EMA period
slope_thresholdfloat0.0 — 0.50.0Slope threshold for non-flat
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "multi_tf_trend_bearish",
    "parameters": {
        "higher_tf": "1W",
        "window": 10,
        "slope_threshold": 0.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the higher-timeframe EMA is rising (trend confirmation filter). Requires a DatetimeIndex. Resamples to the specified higher timeframe, computes an EMA on the resampled closes, and returns True if the EMA slope is positive. Broadcasts back to the current bar’s timestamp so lower-TF signals can be filtered by higher-TF trend.Parameters
NameTypeRangeDefaultDescription
higher_tfstr-1WPandas offset alias for the higher timeframe
windowint2 — 10010EMA period on the resampled close
slope_thresholdfloat0.0 — 0.50.0Relative slope threshold for non-flat classification
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "multi_tf_trend_bullish",
    "parameters": {
        "higher_tf": "1W",
        "window": 10,
        "slope_threshold": 0.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if price is above the EMA. Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets.Parameters
NameTypeRangeDefaultDescription
windowint2 — 20020EMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "price_above_ema",
    "parameters": {
        "window": 20
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if PSAR indicates bearish trend (PSAR above price).Parameters
NameTypeRangeDefaultDescription
stepfloat0.01 — 0.10.02PSAR acceleration factor step
max_stepfloat0.1 — 0.50.2PSAR max acceleration factor
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "psar_bearish",
    "parameters": {
        "step": 0.02,
        "max_step": 0.2
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if PSAR indicates bullish trend (PSAR below price).Parameters
NameTypeRangeDefaultDescription
stepfloat0.01 — 0.10.02PSAR acceleration factor step
max_stepfloat0.1 — 0.50.2PSAR max acceleration factor
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "psar_bullish",
    "parameters": {
        "step": 0.02,
        "max_step": 0.2
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if PSAR flips sides (potential reversal).Parameters
NameTypeRangeDefaultDescription
stepfloat0.01 — 0.10.02PSAR acceleration factor step
max_stepfloat0.1 — 0.50.2PSAR max acceleration factor
directionstr-bullishReversal direction, ‘bullish’ (flip to below price) or ‘bearish’
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "psar_reversal",
    "parameters": {
        "step": 0.02,
        "max_step": 0.2,
        "direction": "bullish"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a regular bearish RSI divergence: price higher high, RSI lower high. Classic reversal signal indicating bullish momentum is weakening.Parameters
NameTypeRangeDefaultDescription
rsi_windowint2 — 10014RSI period
swing_windowint2 — 205Bars on each side to confirm swing extremum
min_swing_distanceint3 — 5010Min bars between the two swing points compared
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "rsi_bearish_divergence",
    "parameters": {
        "rsi_window": 14,
        "swing_window": 5,
        "min_swing_distance": 10
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a regular bullish RSI divergence: price lower low, RSI higher low. Classic reversal signal indicating bearish momentum is weakening.Parameters
NameTypeRangeDefaultDescription
rsi_windowint2 — 10014RSI period
swing_windowint2 — 205Bars on each side to confirm swing extremum
min_swing_distanceint3 — 5010Min bars between the two swing points compared
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "rsi_bullish_divergence",
    "parameters": {
        "rsi_window": 14,
        "swing_window": 5,
        "min_swing_distance": 10
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a hidden bearish RSI divergence: price lower high, RSI higher high. Continuation signal in a downtrend.Parameters
NameTypeRangeDefaultDescription
rsi_windowint2 — 10014RSI period
swing_windowint2 — 205Bars on each side to confirm swing extremum
min_swing_distanceint3 — 5010Min bars between swings
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "rsi_hidden_bearish_divergence",
    "parameters": {
        "rsi_window": 14,
        "swing_window": 5,
        "min_swing_distance": 10
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a hidden bullish RSI divergence: price higher low, RSI lower low. Continuation signal in an uptrend — indicates the uptrend is still intact despite a pullback.Parameters
NameTypeRangeDefaultDescription
rsi_windowint2 — 10014RSI period
swing_windowint2 — 205Bars on each side to confirm swing extremum
min_swing_distanceint3 — 5010Min bars between swings
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "rsi_hidden_bullish_divergence",
    "parameters": {
        "rsi_window": 14,
        "swing_window": 5,
        "min_swing_distance": 10
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish SMA crossover as an exit signal. Returns True when the window_fast SMA crosses below the window_slow SMA (death cross). This is a momentum-driven exit signal, indicating a transition from bullish to bearish momentum. Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets. Note: This is a backwards-compatible wrapper around sma_crossover.Parameters
NameTypeRangeDefaultDescription
window_fastint1 — 200requiredFast SMA window in bars
window_slowint1 — 200requiredSlow SMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "sma_cross_down",
    "parameters": {
        "window_fast": 1,
        "window_slow": 1
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish SMA crossover as an entry signal. Returns True when the window_fast SMA crosses above the window_slow SMA (golden cross). This is a momentum-driven entry signal, indicating a transition from bearish to bullish momentum. Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets. Note: This is a backwards-compatible wrapper around sma_crossover.Parameters
NameTypeRangeDefaultDescription
window_fastint1 — 200requiredFast SMA window in bars
window_slowint1 — 200requiredSlow SMA window in bars
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "sma_cross_up",
    "parameters": {
        "window_fast": 1,
        "window_slow": 1
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect an SMA crossover signal with configurable direction (bullish or bearish). Uses SMA indicator to calculate window_fast and window_slow SMAs. Returns True when a crossover is detected in the specified direction. Bullish crossover (golden cross): window_fast SMA crosses above window_slow SMA Bearish crossover (death cross): window_fast SMA crosses below window_slow SMA The crossover detection compares the previous and current bars: - Bullish: prev window_fast <= prev window_slow AND current window_fast > current window_slow - Bearish: prev window_fast >= prev window_slow AND current window_fast < current window_slow Common periods: 9/21 (short-term), 50/200 (long-term). Adjust for crypto’s 24/7 markets.Parameters
NameTypeRangeDefaultDescription
window_fastint1 — 200requiredFast SMA window in bars
window_slowint1 — 200requiredSlow SMA window in bars
directionstr-bullishCrossover direction, ‘bullish’ or ‘bearish’
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "sma_crossover",
    "parameters": {
        "window_fast": 1,
        "window_slow": 1,
        "direction": "bullish"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish SMMA crossover (fast SMMA crosses below slow SMMA). Slower, more stable crossover than EMA cross; fewer false triggers.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 10014Fast SMMA window
window_slowint2 — 20050Slow SMMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "smma_cross_down",
    "parameters": {
        "window_fast": 14,
        "window_slow": 50
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish SMMA crossover (fast SMMA crosses above slow SMMA). Slower, more stable crossover than EMA cross; fewer false triggers.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 10014Fast SMMA window
window_slowint2 — 20050Slow SMMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "smma_cross_up",
    "parameters": {
        "window_fast": 14,
        "window_slow": 50
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if STC indicates overbought condition.Parameters
NameTypeRangeDefaultDescription
window_slowint2 — 20050Slow EMA period
window_fastint2 — 20023Fast EMA period
cycleint1 — 20010Cycle period
smooth1int1 — 2003First smoothing period
smooth2int1 — 2003Second smoothing period
thresholdfloat0.0 — 100.075.0Overbought threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "stc_overbought",
    "parameters": {
        "window_slow": 50,
        "window_fast": 23,
        "cycle": 10,
        "smooth1": 3,
        "smooth2": 3,
        "threshold": 75.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if STC indicates oversold condition.Parameters
NameTypeRangeDefaultDescription
window_slowint2 — 20050Slow EMA period
window_fastint2 — 20023Fast EMA period
cycleint1 — 20010Cycle period
smooth1int1 — 2003First smoothing period
smooth2int1 — 2003Second smoothing period
thresholdfloat0.0 — 100.025.0Oversold threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "stc_oversold",
    "parameters": {
        "window_slow": 50,
        "window_fast": 23,
        "cycle": 10,
        "smooth1": 3,
        "smooth2": 3,
        "threshold": 25.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect SuperTrend flipping from long (+1) to short (-1). Classic SuperTrend bearish entry signal.Parameters
NameTypeRangeDefaultDescription
windowint5 — 5010ATR window
multiplierfloat0.5 — 10.03.0ATR multiplier
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "supertrend_flip_down",
    "parameters": {
        "window": 10,
        "multiplier": 3.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect SuperTrend flipping from short (-1) to long (+1). Classic SuperTrend bullish entry signal.Parameters
NameTypeRangeDefaultDescription
windowint5 — 5010ATR window
multiplierfloat0.5 — 10.03.0ATR multiplier
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "supertrend_flip_up",
    "parameters": {
        "window": 10,
        "multiplier": 3.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if SuperTrend is in the long regime (+1 direction).Parameters
NameTypeRangeDefaultDescription
windowint5 — 5010ATR window
multiplierfloat0.5 — 10.03.0ATR multiplier
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "supertrend_long",
    "parameters": {
        "window": 10,
        "multiplier": 3.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if SuperTrend is in the short regime (-1 direction).Parameters
NameTypeRangeDefaultDescription
windowint5 — 5010ATR window
multiplierfloat0.5 — 10.03.0ATR multiplier
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "supertrend_short",
    "parameters": {
        "window": 10,
        "multiplier": 3.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish T3 crossover (fast T3 crosses below slow T3).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1005Fast T3 window
window_slowint2 — 20010Slow T3 window
volume_factorfloat0.0 — 1.00.7Tillson volume factor
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "t3_cross_down",
    "parameters": {
        "window_fast": 5,
        "window_slow": 10,
        "volume_factor": 0.7
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish T3 crossover (fast T3 crosses above slow T3). Very smooth, low-lag crossover. Both T3s share the same volume_factor.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1005Fast T3 window
window_slowint2 — 20010Slow T3 window
volume_factorfloat0.0 — 1.00.7Tillson volume factor
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "t3_cross_up",
    "parameters": {
        "window_fast": 5,
        "window_slow": 10,
        "volume_factor": 0.7
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish TEMA crossover (fast TEMA crosses below slow TEMA). Very low-lag cross signal; expect more whipsaw in noisy markets.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast TEMA window
window_slowint2 — 20021Slow TEMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "tema_cross_down",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish TEMA crossover (fast TEMA crosses above slow TEMA). Very low-lag cross signal; expect more whipsaw in noisy markets.Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 1009Fast TEMA window
window_slowint2 — 20021Slow TEMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "tema_cross_up",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bearish TRIMA crossover (fast TRIMA crosses below slow TRIMA).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 10010Fast TRIMA window
window_slowint2 — 20030Slow TRIMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "trima_cross_down",
    "parameters": {
        "window_fast": 10,
        "window_slow": 30
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect a bullish TRIMA crossover (fast TRIMA crosses above slow TRIMA).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 10010Fast TRIMA window
window_slowint2 — 20030Slow TRIMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "trima_cross_up",
    "parameters": {
        "window_fast": 10,
        "window_slow": 30
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if TRIX indicates bearish momentum.Parameters
NameTypeRangeDefaultDescription
windowint5 — 3015TRIX period
thresholdfloat0.0 — 100.00.0Bearish threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "trix_bearish",
    "parameters": {
        "window": 15,
        "threshold": 0.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if TRIX indicates bullish momentum.Parameters
NameTypeRangeDefaultDescription
windowint5 — 3015TRIX period
thresholdfloat0.0 — 100.00.0Bullish threshold
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "trix_bullish",
    "parameters": {
        "window": 15,
        "threshold": 0.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if the TTM Squeeze is active (BB inside KC — volatility contraction). Use as a no-breakout filter: when true, market is coiled and waiting for a directional move.Parameters
NameTypeRangeDefaultDescription
bb_windowint5 — 10020Bollinger Band window
bb_stdfloat1.0 — 4.02.0Bollinger std multiplier
kc_windowint5 — 10020Keltner Channel window (used for both EMA and ATR)
kc_atr_multfloat0.5 — 3.01.5Keltner ATR multiplier
mom_windowint5 — 5012Momentum regression window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ttm_squeeze_active",
    "parameters": {
        "bb_window": 20,
        "bb_std": 2.0,
        "kc_window": 20,
        "kc_atr_mult": 1.5,
        "mom_window": 12
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect TTM Squeeze release with bearish momentum.Parameters
NameTypeRangeDefaultDescription
bb_windowint5 — 10020Bollinger Band window
bb_stdfloat1.0 — 4.02.0Bollinger std multiplier
kc_windowint5 — 10020Keltner Channel window
kc_atr_multfloat0.5 — 3.01.5Keltner ATR multiplier
mom_windowint5 — 5012Momentum regression window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ttm_squeeze_fired_bearish",
    "parameters": {
        "bb_window": 20,
        "bb_std": 2.0,
        "kc_window": 20,
        "kc_atr_mult": 1.5,
        "mom_window": 12
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Detect TTM Squeeze release with bullish momentum. Fires when the squeeze just ended (was on previous bar, off now) AND momentum is positive. Classic Carter entry signal.Parameters
NameTypeRangeDefaultDescription
bb_windowint5 — 10020Bollinger Band window
bb_stdfloat1.0 — 4.02.0Bollinger std multiplier
kc_windowint5 — 10020Keltner Channel window
kc_atr_multfloat0.5 — 3.01.5Keltner ATR multiplier
mom_windowint5 — 5012Momentum regression window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "ttm_squeeze_fired_bullish",
    "parameters": {
        "bb_window": 20,
        "bb_std": 2.0,
        "kc_window": 20,
        "kc_atr_mult": 1.5,
        "mom_window": 12
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Vortex Indicator shows bearish trend (-VI > +VI).Parameters
NameTypeRangeDefaultDescription
windowint5 — 3014Vortex period
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "vortex_bearish",
    "parameters": {
        "window": 14
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Vortex Indicator shows bullish trend (+VI > -VI).Parameters
NameTypeRangeDefaultDescription
windowint5 — 3014Vortex period
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "vortex_bullish",
    "parameters": {
        "window": 14
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if Vortex lines cross (trend change).Parameters
NameTypeRangeDefaultDescription
windowint5 — 3014Vortex period
directionstr-bullishCrossover direction, ‘bullish’ (+VI crosses above -VI) or ‘bearish’
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "vortex_crossover",
    "parameters": {
        "window": 14,
        "direction": "bullish"
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if fast WMA crosses below slow WMA (bearish).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 509Fast WMA window
window_slowint10 — 10021Slow WMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "wma_cross_down",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False
Check if fast WMA crosses above slow WMA (bullish).Parameters
NameTypeRangeDefaultDescription
window_fastint2 — 509Fast WMA window
window_slowint10 — 10021Slow WMA window
Example
from mangrove_kb import RuleRegistry

rule = {
    "name": "wma_cross_up",
    "parameters": {
        "window_fast": 9,
        "window_slow": 21
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False