Signals Overview

Signals are the building blocks of automated trading strategies in Mangrove. Each signal is a boolean function that evaluates a market condition against OHLCV (Open, High, Low, Close, Volume) data and returns True or False. Signals are stateless: they receive a DataFrame of historical price data, run a technical indicator calculation, compare the result to a threshold or pattern, and return a boolean. They do not maintain internal state between evaluations.

Signal Types

Every signal is classified as either a TRIGGER or a FILTER.

TRIGGER

A TRIGGER signal fires on a specific event — the exact bar where a condition transitions from false to true. Triggers detect crossovers, breakouts, reversals, and other discrete transitions. Examples:
  • sma_cross_up — fires when the fast SMA crosses above the slow SMA
  • bb_upper_breakout — fires when price crosses above the upper Bollinger Band
  • macd_bullish_cross — fires when the MACD line crosses above the signal line
Triggers return True only on the bar where the event occurs. On subsequent bars where the condition remains true, they return False.

FILTER

A FILTER signal evaluates a continuous condition — whether the market is currently in a particular state. Filters confirm trend direction, momentum levels, volatility regimes, and volume conditions. Examples:
  • rsi_overbought — true whenever RSI is above the overbought threshold
  • adx_strong_trend — true whenever ADX indicates a strong trend
  • vwap_above — true whenever price is above the VWAP
Filters return True on every bar where the condition holds.

Why the distinction matters

Strategies use TRIGGERS to decide when to enter or exit, and FILTERS to decide whether conditions are favorable. A trigger fires an event; a filter gates it.

Strategy Composition

A strategy is composed of one or more entry blocks and exit blocks. Each block contains:
  • 1 TRIGGER signal — the event that initiates the action
  • 1 FILTER signal — the condition that must also be true
The entry fires only when the TRIGGER returns True and the FILTER returns True on the same bar.
{
  "entry": {
    "trigger": {
      "name": "macd_bullish_cross",
      "parameters": {
        "window_fast": 12,
        "window_slow": 26,
        "window_sign": 9
      }
    },
    "filter": {
      "name": "adx_strong_trend",
      "parameters": {
        "window": 14,
        "threshold": 25.0
      }
    }
  }
}
In this example, the strategy enters a position when the MACD has a bullish crossover and the ADX confirms a strong trend.

Required Data Columns

Every signal declares which OHLCV columns it requires. The platform validates that the provided DataFrame contains these columns before evaluation.
ColumnDescription
CloseClosing price. Required by virtually all signals.
HighHighest price in the bar. Required by signals using range-based indicators (ATR, Stochastic, Bollinger Bands, etc.).
LowLowest price in the bar. Required alongside High for range-based indicators.
VolumeTrading volume. Required by volume-based signals (OBV, MFI, VWAP, CMF, etc.).
Most momentum and trend signals require only Close. Volatility signals typically require High, Low, and Close. Volume signals add Volume to their requirements.

Signal Parameters

Each signal accepts configurable parameters with documented ranges and defaults. For example, rsi_overbought accepts:
ParameterTypeRangeDefaultDescription
windowint2-10014RSI calculation window
thresholdfloat50-10070.0Overbought threshold
Parameters always have a valid range. The platform validates that supplied values fall within these bounds. If no value is provided, the default is used.

Using Signals

Python (direct)

from mangrove_kb import RuleRegistry

# Import signals to trigger registration
import mangrove_kb.signals  # noqa

# Evaluate a signal
rule = {
    "name": "rsi_overbought",
    "parameters": {
        "window": 14,
        "threshold": 70.0
    }
}
result = RuleRegistry.evaluate(rule, df)
print(result)  # True or False

REST API

curl -X POST https://api.mangrovedeveloper.ai/api/v1/execution/evaluate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "rsi_overbought",
    "parameters": {
      "window": 14,
      "threshold": 70.0
    }
  }'

Listing available signals

curl https://api.mangrovedeveloper.ai/api/v1/signals/ \
  -H "Authorization: Bearer $API_KEY"

Signal Categories

Signals are organized into six categories based on the underlying indicator type:
CategoryCountFocus
Momentum42RSI, Stochastic, Williams %R, TSI, KAMA, ROC, Awesome Oscillator, StochRSI, PPO, PVO, MOM, BOP, APO, CMO
Trend88SMA, EMA, WMA, MACD, ADX, Aroon, Ichimoku, PSAR, Vortex, DEMA, TEMA, HMA, ALMA, T3, MAMA, SuperTrend, Alligator, HeikinAshi, MARibbon, Divergence
Volume33OBV, CMF, MFI, VWAP, ADI, Force Index, NVI, EOM, VPT, VWMA, ADOSC, KVO
Volatility20Bollinger Bands, ATR, Keltner Channel, Donchian Channel, Ulcer Index, NATR, STARC Bands, ATR Trailing Stop, TTM Squeeze
Patterns40Candlestick patterns (engulfing, hammer, doji, stars) and multi-bar pattern recognition
On-Chain10Exchange netflow, smart-money flows, whale accumulation, holder concentration (consumes alternative-data columns alongside OHLCV)

Scope & limitations

The categories above describe what the library can express. Signals are stateless functions over OHLCV bars (plus, for On-Chain signals, the alternative-data columns the caller supplies) — they carry no clock, calendar, or session context, and they do not model market-microstructure constructs. A few popular trading frameworks are therefore not currently available as built-in signals:
Not currently in the libraryWhy / closest in-library proxy
Session / time-of-day filters — London open, New York open, Asian session, etc.Signals evaluate purely on bars and carry no time-of-day context, so a session window cannot be expressed. No proxy reproduces a calendar window.
ICT / Smart Money Concepts — Fair Value Gap (FVG), Order Block, Breaker Block, liquidity sweepsNot implemented. For an institutional-reference price use vwap_above / vwap_below; for directional bias use adx_strong_trend or a moving-average filter such as is_above_sma; for price-action structure browse the Patterns category (engulfing, pin bar, inside/outside bar, …). These approximate the intent but are not the same constructs.
Check this section before building a strategy so you know what is expressible. Adding session-based or ICT/SMC signals is a feature request, not a configuration the current library can satisfy.

Full Reference

See the Signal Catalog for the complete reference of all 233 signals with parameters, descriptions, and usage examples.