Guacamole Strategy: In-Depth Analysis
Strategy ID: #191 (191st of 465 strategies) Strategy Type: Multi-Indicator Composite / Trend Following Timeframe: 5 Minutes (5m)
I. Strategy Overview
Guacamole is a trend-following strategy based on MACD, KAMA, and RMI indicators. The core idea is to capture buy opportunities during uptrends, using multi-indicator confirmation to verify trend direction and momentum changes.
Core Features
| Feature | Description |
|---|---|
| Entry Conditions | Multi-condition combo: KAMA trend confirmation + MACD signal + RMI momentum |
| Exit Conditions | Order book dynamic take-profit/stop-loss + RMI extreme value exit |
| Protections | Trailing stop + Order timeout management |
| Timeframe | 5 Minutes |
| Dependencies | TA-Lib, technical (qtpylib, RMI, VIDYA) |
II. Strategy Configuration Analysis
2.1 Core Risk Parameters
minimal_roi = {
"0": 0.13336, # Immediate exit: 13.34% profit
"19": 0.07455, # After 19 minutes: 7.46% profit
"37": 0.04206, # After 37 minutes: 4.21% profit
"57": 0.02682, # After 57 minutes: 2.68% profit
"73": 0.01225, # After 73 minutes: 1.23% profit
"125": 0.0037, # After 125 minutes: 0.37% profit
"244": 0.0025, # After 244 minutes: 0.25% profit
}
stoploss = -0.10 # -10% hard stop-loss
trailing_stop = True
trailing_stop_positive = 0.01673 # 1.67% trailing activation point
trailing_stop_positive_offset = 0.01851 # 1.85% offset trigger
Design Philosophy:
- Aggressive ROI: Primary ROI as high as 13.34% indicates the strategy aims to capture large swings
- Tight Stop-Loss: -10% stop-loss is relatively tight, giving trades limited room for volatility
- Trailing Stop: 1.67% activation + 1.85% offset, suitable for trend continuation markets
2.2 Order Type Configuration
order_types = {
'entry': 'limit',
'exit': 'limit',
'stoploss': 'limit',
'stoploss_on_exchange': False
}
III. Entry Conditions Details
3.1 Buy Logic With No Position
# Core entry conditions
conditions.append(dataframe["kama-3"] > dataframe["kama-21"]) # KAMA uptrend
conditions.append(dataframe["macd"] > dataframe["macdsignal"]) # MACD golden cross
conditions.append(dataframe["macd"] > params["macd"]) # MACD value threshold
conditions.append(dataframe["macdhist"] > params["macdhist"]) # MACD histogram
conditions.append(dataframe["rmi"] > dataframe["rmi"].shift()) # RMI rising
conditions.append(dataframe["rmi"] > params["rmi"]) # RMI threshold
conditions.append(dataframe["volume"] < (dataframe["volume_ma"] * 20)) # Volume filter
Logic Breakdown:
- KAMA Trend Confirmation: KAMA(3) > KAMA(21), indicating short-term trend is upward
- MACD Golden Cross Confirmation: MACD line > Signal line, with threshold conditions met
- RMI Momentum Confirmation: RMI continuously rising and breaking through threshold
- Volume Filter: Current volume below 20x average volume, avoiding false breakouts on high volume
3.2 Buy Logic With Existing Position (Continuous Entry Signals)
# With position: price breaks above SAR and RMI is strong
conditions.append(dataframe["close"] > dataframe["sar"]) # Price above SAR
conditions.append(dataframe["rmi"] >= 75) # RMI strong
IV. Exit Logic Details
4.1 Active Exit Conditions
# Exit conditions (checked only when in position)
conditions.append(dataframe["rmi"] < 30) # RMI enters oversold territory
conditions.append(current_profit > -0.03) # Profitable or small loss
conditions.append(dataframe["volume"].gt(0)) # Volume present
4.2 Order Timeout Management
# Entry timeout: cancel if price exceeds order price by 1%
def check_entry_timeout(pair, trade, order):
if current_price > order["price"] * 1.01:
return True
return False
# Exit timeout: cancel if price falls below order price by 1%
def check_exit_timeout(pair, trade, order):
if current_price < order["price"] * 0.99:
return True
return False
# Confirm trade entry: reject if price exceeds quote by 1%
def confirm_trade_entry(pair, order_type, amount, rate, time_in_force):
if current_price > rate * 1.01:
return False
return True
V. Technical Indicator System
5.1 Core Indicators
| Indicator Category | Specific Indicators | Purpose |
|---|---|---|
| Trend Indicators | KAMA (3, 21) | Trend direction confirmation |
| Momentum Indicators | MACD, MACD Signal, MACD Hist | Trend momentum |
| Momentum Indicators | RMI | Relative momentum changes |
| Price Indicators | SAR | Trend reversal points |
| Volume Indicators | Volume MA (24) | Volume filtering |
5.2 Indicator Calculation Details
# KAMA Calculation
dataframe["kama-3"] = ta.KAMA(dataframe, timeperiod=3)
dataframe["kama-21"] = ta.KAMA(dataframe, timeperiod=21)
# MACD Calculation
macd = ta.MACD(dataframe)
dataframe["macd"] = macd["macd"]
dataframe["macdsignal"] = macd["macdsignal"]
dataframe["macdhist"] = macd["macdhist"]
# RMI Calculation
dataframe["rmi"] = RMI(dataframe)
# SAR Calculation
dataframe["sar"] = ta.SAR(dataframe)
# Volume Moving Average
dataframe["volume_ma"] = dataframe["volume"].rolling(window=24).mean()
VI. Risk Management Highlights
6.1 Trailing Stop System
- Activation Condition: Activates after 1.67% profit
- Trail Distance: 1.85% offset
- Suitable Scenario: Trend continuation markets
6.2 Order Timeout Management
| Scenario | Timeout Condition | Handling |
|---|---|---|
| Entry Timeout | Price > Order Price × 1.01 | Cancel order |
| Exit Timeout | Price < Order Price × 0.99 | Cancel order |
| Confirm Entry | Price > Quote × 1.01 | Reject order |
VII. Strategy Pros & Cons
Strengths
- Multi-Indicator Confirmation: Uses three independent indicators (KAMA, MACD, RMI), reducing false signal probability
- Volume Filtering: Avoids entering during high-volume false breakouts
- Strict Order Management: Complete timeout and confirmation mechanisms reduce slippage losses
- Trailing Stop: Protects accumulated profits
Weaknesses
- Parameter Sensitivity: MACD and RMI thresholds require optimization for different markets
- Trend Dependency: Poor performance in ranging markets
- Complex Conditions: 7 conditions must all be met simultaneously, resulting in fewer entry opportunities
VIII. Applicable Scenarios
| Market Environment | Recommended Config | Notes |
|---|---|---|
| Strong Bull Market | Enable | Multi-indicator confirmation, excellent in trends |
| Strong Bear Market | Enable | Short logic same as long, can capture downtrends |
| Ranging Market | Use with Caution | Conditions hard to satisfy simultaneously |
| Sideways Consolidation | Not Recommended | Many false signals |
IX. Applicable Market Environment Analysis
Guacamole is a typical multi-indicator trend-following strategy. Based on its code architecture and indicator combination, it is best suited for markets with clear trends (strong bull or bear markets), and performs poorly in ranging and sideways markets.
9.1 Strategy Core Logic
- Trend Confirmation: KAMA moving average crossover judges trend direction
- Momentum Verification: MACD and RMI verify trend strength
- Filter Mechanism: Volume filtering avoids false breakouts
9.2 Performance in Different Market Environments
| Market Type | Rating | Analysis |
|---|---|---|
| Strong Bull Market | ⭐⭐⭐⭐⭐ | Clear trends, multi-indicator resonance |
| Ranging Market | ⭐⭐⭐☆☆ | Conditions hard to satisfy simultaneously |
| Strong Bear Market | ⭐⭐⭐⭐☆ | Can capture downtrends |
| Sideways Consolidation | ⭐⭐☆☆☆ | Frequent false signals |
X. Important Notes: The Cost of Complexity
10.1 Learning Curve
The strategy contains 7 independent entry conditions, requiring deep understanding of each indicator's meaning and interactions.
10.2 Hardware Requirements
| Number of Pairs | Minimum RAM | Recommended RAM |
|---|---|---|
| 10-20 pairs | 2GB | 4GB |
| 20-50 pairs | 4GB | 8GB |
10.3 Backtesting vs. Live Trading Differences
- Order timeout logic helps avoid slippage in live trading
- Volume filtering conditions may be too strict for low-liquidity pairs
XI. Summary
Guacamole is a well-designed multi-indicator trend-following strategy. Its core value lies in:
- Multi-Dimensional Verification: Verifies signals through three dimensions: trend, momentum, and volume
- Strict Order Management: Complete timeout mechanisms reduce unnecessary losses
- Trailing Stop Protection: Locks in profits during trending markets
For quantitative traders, it is recommended to thoroughly backtest on historical data, adjust MACD and RMI thresholds to suit the target market, and then conduct small-capital live trading tests.