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.mangrovetechnologies.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.mangrovetechnologies.ai/api/v1/signals/ \
  -H "Authorization: Bearer $API_KEY"

Signal Categories

Signals are organized into five categories based on the underlying indicator type:
CategoryCountFocus
Momentum26RSI, Stochastic, Williams %R, TSI, KAMA, ROC, Awesome Oscillator, StochRSI, PPO, PVO
Trend38SMA, EMA, WMA, MACD, ADX, Aroon, TRIX, Mass Index, Ichimoku, KST, DPO, CCI, Vortex, PSAR, STC
Volume22OBV, CMF, Force Index, EOM, VPT, NVI, MFI, VWAP, ADI, plus return-based signals
Volatility10Bollinger Bands, ATR, Keltner Channel, Donchian Channel, Ulcer Index
Patterns40Candlestick patterns (engulfing, hammer, doji, stars) and multi-bar pattern recognition

Full Reference

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