Strategy Examples
This page contains four complete, working strategies with line-by-line explanations. You can use these as starting points for your own strategies -- copy the TOML, modify the parameters, and backtest to see how they perform on your target pair.
1. RSI Scalper
A simple momentum strategy that buys when RSI signals oversold conditions and sells in two stages as price recovers.
Concept: RSI below 30 indicates extreme selling pressure. Statistically, price tends to bounce after reaching oversold levels. This strategy captures that bounce by entering at RSI < 30 and exiting in two steps: partial at RSI > 50 (neutral) and full at RSI > 70 (overbought).
Full TOML
[meta]
name = "RSI_Scalper"
# ENTRY: Buy when RSI drops below 30 (oversold)
[[actions]]
type = "open_long"
amount = "100 USDC"
[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "30"
# PARTIAL EXIT: Sell 50% when RSI recovers to neutral
[[actions]]
type = "sell"
amount = "50%"
[[actions.triggers]]
indicator = "rsi_14"
operator = ">"
target = "50"
# FULL EXIT: Sell remaining when RSI reaches overbought
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
indicator = "rsi_14"
operator = ">"
target = "70"
Line-by-Line Explanation
[meta] -- Strategy metadata. No max_open_positions set, so only one position at a time by default behavior of the entry trigger.
Action 1 -- Entry:
type = "open_long"-- Creates a new position.amount = "100 USDC"-- Buys $100 worth of the asset.- Trigger:
rsi_14 < 30-- RSI with a 14-period lookback drops below 30. This is the classic oversold signal.
Action 2 -- Partial Exit:
type = "sell"-- Sells part of the existing position.amount = "50%"-- Sells half. This locks in partial profit while leaving room for more upside.- Trigger:
rsi_14 > 50-- RSI recovers to neutral territory. The worst of the selling is over.
Action 3 -- Full Exit:
type = "sell"-- Sells the rest.amount = "100%"-- Exits completely.- Trigger:
rsi_14 > 70-- RSI reaches overbought. The bounce is likely exhausted.
This strategy has no stop-loss. For production use, add a stop-loss action (e.g., sell 100% at pos_price_change of -5%). Without a stop-loss, the bot holds through any drawdown waiting for RSI to recover.
Strengths and Weaknesses
| Strength | Weakness |
|---|---|
| Simple and easy to understand | No stop-loss -- can hold losing positions |
| Works well in ranging markets | Performs poorly in strong downtrends |
| Two-stage exit captures more gain | RSI can stay below 30 for extended periods |
2. Bollinger Bounce DCA
A mean-reversion strategy that enters when price touches the lower Bollinger Band, uses DCA to average down on continued dips, and exits on recovery.
Concept: Bollinger Bands measure volatility. When price drops below the lower band, it is statistically "extended" and tends to revert toward the middle band. This strategy exploits that tendency with DCA to handle cases where price continues to drop after the initial entry.
Full TOML
[meta]
name = "BB_Bounce_DCA"
description = "Enter at BB lower, DCA at -2% and -4%, exit at +3%"
max_open_positions = 3
# ENTRY: Price drops below the lower Bollinger Band
[[actions]]
type = "open_long"
amount = "100 USDC"
average_price = false
[[actions.triggers]]
indicator = "price"
operator = "<"
target = "bb_lower"
# DCA LEVEL 1: Position drops 2% -- buy more
[[actions]]
type = "buy"
amount = "100 USDC"
average_price = true
[[actions.triggers]]
type = "pos_price_change"
value = "-2%"
max_count = 1
# DCA LEVEL 2: Position drops 4% -- buy even more
[[actions]]
type = "buy"
amount = "200 USDC"
average_price = true
[[actions.triggers]]
type = "pos_price_change"
value = "-4%"
max_count = 1
# TAKE PROFIT: Exit at +3% from averaged entry
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
type = "pos_price_change"
value = "3%"
# STOP LOSS: Cut losses at -8%
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
type = "pos_price_change"
value = "-8%"
Line-by-Line Explanation
[meta]:
max_open_positions = 3-- allows up to 3 simultaneous positions. If the entry trigger fires while 3 positions are open, it is ignored.
Action 1 -- Entry:
price < bb_lower-- current price is below the lower Bollinger Band. This means price is at least 2 standard deviations below the 20-period mean.average_price = false-- this is the initial entry, no averaging needed.
Action 2 -- DCA Level 1:
type = "buy"-- adds to the existing position.average_price = true-- recalculates entry price as a weighted average.pos_price_change = "-2%"-- fires when price drops 2% below the entry price.max_count = 1-- only triggers once per position, preventing repeated buys if price oscillates.
Action 3 -- DCA Level 2:
- Same logic as Level 1, but fires at -4% with a larger amount ($200). The increasing amounts at deeper dips is pyramid DCA -- more capital deployed where risk-reward improves.
Action 4 -- Take Profit:
pos_price_change = "3%"-- sell everything when price is 3% above the (averaged) entry. Thanks to DCA, the averaged entry is lower than the original entry, making this target easier to reach.
Action 5 -- Stop Loss:
pos_price_change = "-8%"-- if price drops 8% from entry without recovery, cut losses.
The stop-loss at -8% means the maximum loss per position (before DCA) is 8% of $100 = $8. With DCA, total capital at risk is $100 + $100 + $200 = $400, but the averaged entry brings the stop-loss trigger closer to the deeper DCA levels.
3. MACD Crossover
A trend-following strategy that enters on a MACD bullish crossover and exits on a bearish crossover, with DCA and a fixed take-profit target.
Concept: When the MACD line crosses above its signal line, it indicates bullish momentum is increasing. When it crosses below, momentum is fading. This strategy rides the momentum wave.
Full TOML
[meta]
name = "MACD_Crossover"
description = "Enter on MACD bullish cross, DCA on dips, exit on bearish cross or profit"
max_open_positions = 3
# ENTRY: MACD line crosses above signal line on 1h chart
[[actions]]
type = "open_long"
amount = "100 USDC"
[[actions.triggers]]
indicator = "macd_line"
operator = "cross_above"
target = "macd_signal"
timeframe = "1h"
# DCA LEVEL 1: Buy more if price dips 2%
[[actions]]
type = "buy"
amount = "100 USDC"
average_price = true
[[actions.triggers]]
type = "pos_price_change"
value = "-2%"
max_count = 1
# DCA LEVEL 2: Buy more if price dips 4%
[[actions]]
type = "buy"
amount = "200 USDC"
average_price = true
[[actions.triggers]]
type = "pos_price_change"
value = "-4%"
max_count = 1
# TAKE PROFIT: Exit at +3%
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
type = "pos_price_change"
value = "3%"
# EXIT ON BEARISH CROSS: MACD line crosses below signal
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
indicator = "macd_line"
operator = "cross_below"
target = "macd_signal"
timeframe = "1h"
Line-by-Line Explanation
Action 1 -- Entry:
macd_line cross_above macd_signalon1h-- this is the classic MACD bullish crossover. It occurs when the difference between the 12-period and 26-period EMAs starts increasing, signaling that short-term momentum is turning bullish.timeframe = "1h"-- using hourly candles filters out noise. A 1-minute MACD crossover is common and often meaningless; a 1-hour crossover is a stronger signal.
Actions 2 & 3 -- DCA:
- Same pyramid DCA pattern as the previous example. If the crossover was a false signal and price drops, DCA lowers the average entry.
max_count = 1prevents repeated buys.
Action 4 -- Take Profit:
pos_price_change = "3%"-- exits with profit regardless of MACD state.
Action 5 -- Bearish Exit:
macd_line cross_below macd_signalon1h-- the opposite crossover. Momentum has shifted from bullish to bearish.- This acts as a dynamic stop-loss -- instead of a fixed percentage, you exit when the momentum signal that got you in reverses.
The MACD crossover strategy has two exit conditions: a fixed profit target (+3%) and a dynamic momentum reversal (bearish cross). Whichever happens first closes the position. This is a good pattern -- you take profit when available, but cut losses when the thesis breaks.
Strengths and Weaknesses
| Strength | Weakness |
|---|---|
| Follows momentum -- rides trends | MACD can whipsaw in ranging/choppy markets |
| Dynamic exit based on momentum shift | Crossovers lag -- entry/exit is never at the top/bottom |
| DCA mitigates false signal entries | 1h timeframe means slower reaction to fast moves |
4. Multi-Timeframe Trend Follower
An advanced strategy that uses daily moving averages for trend direction, hourly RSI for timing, 5-minute momentum for precise entry, and a trailing stop for exits.
Concept: This strategy only enters in confirmed uptrends (daily SMA golden cross), waits for hourly oversold conditions, and times the entry using 5-minute momentum dips. The trailing stop locks in profits on runs while allowing the position to grow.
Full TOML
[meta]
name = "Multi_TF_Trend_Follower"
description = "Daily trend filter + hourly RSI + 5m entry + trailing stop exit"
max_open_positions = 1
# ENTRY: Three-layer confirmation
# Layer 1: Daily uptrend (SMA 50 > SMA 200 = golden cross)
# Layer 2: Hourly RSI oversold (< 40)
# Layer 3: 5-minute sharp dip (ROC < -3)
[[actions]]
type = "open_long"
amount = "100 USDC"
average_price = false
[[actions.triggers]]
indicator = "sma_50"
operator = ">"
target = "sma_200"
timeframe = "1d"
[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "40"
timeframe = "1h"
[[actions.triggers]]
indicator = "roc_10"
operator = "<"
target = "-3"
timeframe = "5m"
# DCA: Buy more if price drops 5%, but only if RSI confirms oversold
[[actions]]
type = "buy"
amount = "100 USDC"
average_price = true
[[actions.triggers]]
type = "pos_price_change"
value = "-5%"
[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "35"
timeframe = "1h"
# TAKE PROFIT: +5% fixed target
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
type = "pos_price_change"
value = "5%"
# TRAILING STOP: Sell when price drops 3% from its peak since entry
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
type = "trailing_stop"
value = "-3%"
# TREND BREAK EXIT: Sell if the daily trend reverses (death cross)
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
indicator = "sma_50"
operator = "cross_below"
target = "sma_200"
timeframe = "1d"
# STOP LOSS: Hard stop at -8%
[[actions]]
type = "sell"
amount = "100%"
[[actions.triggers]]
type = "pos_price_change"
value = "-8%"
Line-by-Line Explanation
[meta]:
max_open_positions = 1-- conservative, only one position at a time. Quality over quantity.
Action 1 -- Entry (3 triggers, ALL must be true):
- Trigger 1:
sma_50 > sma_200on1d-- the daily 50-period SMA is above the 200-period SMA. This is the "golden cross" -- the strongest trend confirmation in traditional technical analysis. It ensures we only buy in a macro uptrend. - Trigger 2:
rsi_14 < 40on1h-- hourly RSI is oversold. Even in an uptrend, price dips temporarily. This catches those dips. - Trigger 3:
roc_10 < -3on5m-- the 5-minute Rate of Change shows a sharp 3%+ dip in the last 10 candles. This is the precise "buy the dip" moment.
All three must be true simultaneously. This is a very selective entry that fires rarely but with high conviction.
Action 2 -- DCA with Confirmation:
pos_price_change = "-5%"ANDrsi_14 < 35on1h-- adds to the position only if price has dropped significantly AND the hourly RSI confirms oversold. The RSI confirmation prevents DCA during a trend break.
Action 3 -- Take Profit:
pos_price_change = "5%"-- exits with +5% profit. A higher target than the simpler strategies because the entry is more selective.
Action 4 -- Trailing Stop:
trailing_stop = "-3%"-- this is the key feature. A trailing stop tracks the highest price since entry and sells when price drops 3% from that peak. If price rises 10% and then drops 3%, the trailing stop fires with approximately +7% profit locked in.
Action 5 -- Trend Break Exit:
sma_50 cross_below sma_200on1d-- the daily death cross. If the macro trend that justified our entry reverses, exit immediately regardless of P&L.
Action 6 -- Hard Stop Loss:
pos_price_change = "-8%"-- absolute worst-case exit. If all other exits fail to trigger, this limits loss to 8%.
This strategy has four separate exit conditions. Whichever fires first closes the position:
- +5% profit target (ideal case)
- -3% trailing stop (locks in gains on a run)
- Daily death cross (trend reversal)
- -8% hard stop (absolute maximum loss)
Multiple exit conditions provide layered protection -- this is a hallmark of well-designed strategies.
Strengths and Weaknesses
| Strength | Weakness |
|---|---|
| Very selective -- high-quality entries | Fires infrequently; may miss opportunities |
| Multi-timeframe reduces false signals | Requires data on all timeframes |
| Trailing stop captures large moves | Complex -- harder to debug and optimize |
| Trend filter avoids buying in downtrends | Daily golden cross can be late to form |
Comparing the Strategies
| Strategy | Complexity | Entry Frequency | Risk Level | Best Market Condition |
|---|---|---|---|---|
| RSI Scalper | Low | High | Medium | Ranging / choppy |
| Bollinger Bounce DCA | Medium | Medium | Low-Medium | Mean-reverting |
| MACD Crossover | Medium | Medium | Medium | Trending |
| Multi-TF Trend Follower | High | Low | Low | Strong uptrend |