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)
| Field | Required | Description |
|---|---|---|
indicator | Yes | The 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). |
operator | Yes | How to compare the indicator to the target. One of: >, <, =, cross_above, cross_below. |
target | Yes | The value to compare against. Either a number ("30", "0", "-3") or another indicator ("sma_200", "bb_upper", "price"). |
timeframe | No | Which candle timeframe to evaluate on: 1m, 5m, 15m, 1h, 4h, 1d. If omitted, uses the session's default timeframe. |
max_count | No | Maximum 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:
| Indicator | Format | Example | Description |
|---|---|---|---|
| SMA | sma_{period} | sma_50, sma_200 | Simple Moving Average |
| EMA | ema_{period} | ema_9, ema_21, ema_200 | Exponential Moving Average |
| RSI | rsi_{period} | rsi_14, rsi_7 | Relative Strength Index (0-100) |
| Bollinger Bands | bb_{band} | bb_lower, bb_upper, bb_middle | Bollinger Band levels |
| MACD | macd_{component} | macd_line, macd_signal, macd_histogram | MACD components |
| StochRSI | stoch_rsi_{period} | stoch_rsi_14 | Stochastic RSI (0-100) |
| ROC | roc_{period} | roc_10 | Rate of Change (%) |
| ATR | atr_{period} | atr_14 | Average True Range |
| OBV | obv | obv | On-Balance Volume (no period) |
| OBV SMA | obv_sma_{period} | obv_sma_20 | SMA of On-Balance Volume |
| Volume SMA | vol_sma_{period} | vol_sma_20 | SMA of Volume |
| TTM Trend | ttm_trend | ttm_trend | TTM Squeeze trend (1 = bullish, -1 = bearish) |
| Price | price | price | Current market price (close) |
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"
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"
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
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.
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.
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:
- SMA — Simple Moving Average — Golden Cross, Death Cross, trend filters
- EMA — Exponential Moving Average — Fast crossovers, scalping pairs
- RSI — Relative Strength Index — Oversold/overbought zones, recovery signals
- MACD — Crossovers, histogram, zero-line signals
- Bollinger Bands — Bounce, squeeze, mean reversion
- StochRSI, ROC, ATR, OBV, VolSMA, TTM Trend, Price
- Operators Reference — Complete guide to
>,<,=,cross_above,cross_below