Technical Indicator Triggers

Technical triggers compare an indicator's current value against a target. They answer questions like "is RSI below 30?", "did the 50-day SMA just cross above the 200-day SMA?", or "is price above the upper Bollinger Band?"

These are the most common triggers in any strategy. If you have used TradingView alerts or any charting tool, you will recognize the logic immediately.

Anatomy of a Technical Trigger

A technical trigger has four fields:

[[actions.triggers]]
indicator = "rsi_14"        # What to measure
operator = "<"              # How to compare
target = "30"               # What to compare against
timeframe = "1h"            # On which candle timeframe (optional)
max_count = 1               # How many times it can fire per position (optional)
FieldRequiredDescription
indicatorYesThe indicator to read. Format: type_period (e.g., rsi_14, sma_50, ema_200) or a special name (bb_lower, macd_line, price, ttm_trend).
operatorYesHow to compare the indicator to the target. One of: >, <, =, cross_above, cross_below.
targetYesThe value to compare against. Either a number ("30", "0", "-3") or another indicator ("sma_200", "bb_upper", "price").
timeframeNoWhich candle timeframe to evaluate on: 1m, 5m, 15m, 1h, 4h, 1d. If omitted, uses the session's default timeframe.
max_countNoMaximum number of times this trigger can fire per position. Omit for unlimited.

Available Indicators

All of these can be used in the indicator field or as a target:

IndicatorFormatExampleDescription
SMAsma_{period}sma_50, sma_200Simple Moving Average
EMAema_{period}ema_9, ema_21, ema_200Exponential Moving Average
RSIrsi_{period}rsi_14, rsi_7Relative Strength Index (0-100)
Bollinger Bandsbb_{band}bb_lower, bb_upper, bb_middleBollinger Band levels
MACDmacd_{component}macd_line, macd_signal, macd_histogramMACD components
StochRSIstoch_rsi_{period}stoch_rsi_14Stochastic RSI (0-100)
ROCroc_{period}roc_10Rate of Change (%)
ATRatr_{period}atr_14Average True Range
OBVobvobvOn-Balance Volume (no period)
OBV SMAobv_sma_{period}obv_sma_20SMA of On-Balance Volume
Volume SMAvol_sma_{period}vol_sma_20SMA of Volume
TTM Trendttm_trendttm_trendTTM Squeeze trend (1 = bullish, -1 = bearish)
PricepricepriceCurrent market price (close)

Note

Period values must be between 1 and 200. Using sma_0 or rsi_300 will fail validation.

Operators Explained

> (Greater Than) and < (Less Than)

Simple threshold comparisons. The trigger is true whenever the indicator is above or below the target value.

# True whenever RSI(14) is below 30
[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "30"

These fire on every candle where the condition is true, not just the moment it crosses the threshold. If RSI stays below 30 for ten candles, the trigger is "active" on all ten. (Use max_count if you only want it to fire once.)

cross_above and cross_below (Crossover Detection)

A crossover trigger fires at the moment of transition. It checks two consecutive candles:

  • cross_above: The indicator was at or below the target on the previous candle, and is above it on the current candle.
  • cross_below: The indicator was at or above the target on the previous candle, and is below it on the current candle.
graph LR
    subgraph "cross_above"
        P1["Previous candle:<br/>SMA(50) <= SMA(200)"]
        C1["Current candle:<br/>SMA(50) > SMA(200)"]
        P1 -->|"transition"| C1
    end
    subgraph "cross_below"
        P2["Previous candle:<br/>SMA(50) >= SMA(200)"]
        C2["Current candle:<br/>SMA(50) < SMA(200)"]
        P2 -->|"transition"| C2
    end
# Golden cross: SMA(50) crosses above SMA(200)
[[actions.triggers]]
indicator = "sma_50"
operator = "cross_above"
target = "sma_200"
timeframe = "1d"

Crossovers are the most powerful tool for trend detection

Use cross_above and cross_below instead of > and < when you want to catch the turning point rather than the sustained condition. A golden cross (sma_50 cross_above sma_200) fires once when the trend shifts bullish, rather than on every single candle where SMA(50) happens to be above SMA(200).

= (Equal)

Exact match comparison. This is rarely used because indicator values are continuous floating-point numbers and exact equality is unlikely. The primary use case is the TTM Trend indicator, which outputs discrete integer values:

  • 1 = bullish trend
  • -1 = bearish trend
# TTM Trend is bullish
[[actions.triggers]]
indicator = "ttm_trend"
operator = "="
target = "1"

Warning

Do not use = with floating-point indicators like RSI or SMA. A condition like rsi_14 = 30 will almost never be exactly true because RSI values are typically decimals like 29.87 or 30.12. Use < or > instead.

Target Types

The target field accepts two kinds of values:

Numeric Target

A fixed number. Used for absolute thresholds like RSI levels, zero-line crossings, or price levels.

target = "30"      # RSI threshold
target = "0"       # MACD zero-line
target = "-3"      # Negative value (ROC dropped below -3%)
target = "50000"   # A specific price level

Indicator Target

Another indicator. Used for comparing two moving averages, checking if price is above/below a band, or volume breakout detection.

target = "sma_200"     # Compare against 200-period SMA
target = "ema_50"      # Compare against 50-period EMA
target = "bb_upper"    # Compare against upper Bollinger Band
target = "price"       # Compare indicator against current price
target = "obv_sma_20"  # Compare OBV against its SMA
target = "macd_signal" # Compare MACD line against its signal line

Note

When using an indicator as a target, both the indicator and target are evaluated on the same candle at the same timeframe. The order matters: indicator = "sma_50" with target = "sma_200" means "is SMA(50) above/below SMA(200)?", not the other way around.

Examples

Example 1: RSI Oversold Entry

Open a position when RSI(14) drops below 30 on the 1-hour chart.

[[actions]]
type = "open_long"
amount = "100 USDC"

[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "30"
timeframe = "1h"

When to use: Classic mean-reversion entry. RSI below 30 suggests the asset is oversold and may bounce.

Example 2: Golden Cross (SMA 50/200)

Open a position when the daily SMA(50) crosses above SMA(200).

[[actions]]
type = "open_long"
amount = "200 USDC"

[[actions.triggers]]
indicator = "sma_50"
operator = "cross_above"
target = "sma_200"
timeframe = "1d"

When to use: Long-term trend following. The golden cross is one of the most widely watched signals in traditional finance and crypto alike.

Example 3: Death Cross Exit

Sell the entire position when SMA(50) crosses below SMA(200), signaling a trend reversal.

[[actions]]
type = "sell"
amount = "100%"

[[actions.triggers]]
indicator = "sma_50"
operator = "cross_below"
target = "sma_200"
timeframe = "1d"

When to use: As a safety exit. Even if your take-profit has not been reached, a death cross suggests the uptrend is over.

Example 4: Bollinger Band Bounce

Open a position when price drops below the lower Bollinger Band on the 1-hour chart (and RSI confirms oversold conditions on the daily chart).

[[actions]]
type = "open_long"
amount = "100 USDC"

[[actions.triggers]]
indicator = "bb_lower"
operator = ">"
target = "price"
timeframe = "1h"

[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "40"
timeframe = "1d"

When to use: Volatility-based entry. When price punches below the lower band, it has moved more than two standard deviations from the mean. Combining with RSI filters out false signals during strong downtrends.

Note

Notice the operator direction: bb_lower > price means "the lower band is above the current price," which is the same as saying "price is below the lower band." Botmarley always reads left-to-right: indicator operator target.

Example 5: MACD Zero-Line Crossover

Buy when the MACD line crosses above zero, confirming bullish momentum.

[[actions]]
type = "open_long"
amount = "100 USDC"

[[actions.triggers]]
indicator = "macd_line"
operator = "cross_above"
target = "0"
timeframe = "4h"

When to use: Momentum confirmation. The MACD crossing above zero means the short-term EMA has moved above the long-term EMA, confirming upward momentum.

Example 6: TTM Trend Filter with RSI

Only enter when RSI is oversold AND the TTM Trend confirms bullish direction.

[[actions]]
type = "open_long"
amount = "100 USDC"

[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "35"

[[actions.triggers]]
indicator = "ttm_trend"
operator = "="
target = "1"

When to use: Filtered entries. RSI alone can give false signals in a strong downtrend. Adding TTM Trend = 1 ensures you only buy dips during an overall uptrend.

Example 7: EMA Crossover (Fast over Slow)

Enter when EMA(9) crosses above EMA(21) on the 5-minute chart for short-term scalping.

[[actions]]
type = "open_long"
amount = "50 USDC"

[[actions.triggers]]
indicator = "ema_9"
operator = "cross_above"
target = "ema_21"
timeframe = "5m"

When to use: Short-term momentum trading. Faster EMA pairs (9/21, 12/26) react more quickly than SMA pairs, making them suitable for scalping on lower timeframes.

Example 8: Uptrend Filter (SMA 50 Above SMA 200)

Use as a guard condition on another action. Only allow entries while the macro trend is bullish.

[[actions]]
type = "open_long"
amount = "100 USDC"

[[actions.triggers]]
indicator = "sma_50"
operator = ">"
target = "sma_200"
timeframe = "1d"

[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "35"
timeframe = "1h"

When to use: Multi-timeframe filtering. The daily SMA check acts as a macro trend gate (only buy in uptrends), while the hourly RSI finds dip entries within that uptrend. This is the foundation of the "trend-safe DCA" pattern.

Timeframe Considerations

When you set a timeframe on a technical trigger, Botmarley evaluates the indicator on candles of that timeframe. A few things to keep in mind:

  • If you omit timeframe, the trigger uses the trading session's default timeframe.
  • You can mix timeframes on the same action. For example, one trigger checks the daily SMA while another checks the hourly RSI. Both must be true for the action to fire.
  • Valid timeframes are: 1m, 5m, 15m, 1h, 4h, 1d.
  • Lower timeframes (1m, 5m) produce more signals but are noisier. Higher timeframes (4h, 1d) produce fewer signals but are more reliable.

Tip

A powerful pattern is to use a higher timeframe for trend direction (daily SMA or TTM Trend) and a lower timeframe for entry timing (hourly RSI or 5-minute EMA crossover). This gives you the best of both worlds: reliable trend identification with precise entry points.


Deep-Dive: Indicators Reference

For in-depth explanations of each indicator — with annotated chart screenshots, operator behavior, and TOML examples — see the Indicators Reference and its sub-pages: