Skip to main content

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

FeatureDescription
Entry ConditionsMulti-condition combo: KAMA trend confirmation + MACD signal + RMI momentum
Exit ConditionsOrder book dynamic take-profit/stop-loss + RMI extreme value exit
ProtectionsTrailing stop + Order timeout management
Timeframe5 Minutes
DependenciesTA-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:

  1. KAMA Trend Confirmation: KAMA(3) > KAMA(21), indicating short-term trend is upward
  2. MACD Golden Cross Confirmation: MACD line > Signal line, with threshold conditions met
  3. RMI Momentum Confirmation: RMI continuously rising and breaking through threshold
  4. 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 CategorySpecific IndicatorsPurpose
Trend IndicatorsKAMA (3, 21)Trend direction confirmation
Momentum IndicatorsMACD, MACD Signal, MACD HistTrend momentum
Momentum IndicatorsRMIRelative momentum changes
Price IndicatorsSARTrend reversal points
Volume IndicatorsVolume 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

ScenarioTimeout ConditionHandling
Entry TimeoutPrice > Order Price × 1.01Cancel order
Exit TimeoutPrice < Order Price × 0.99Cancel order
Confirm EntryPrice > Quote × 1.01Reject order

VII. Strategy Pros & Cons

Strengths

  1. Multi-Indicator Confirmation: Uses three independent indicators (KAMA, MACD, RMI), reducing false signal probability
  2. Volume Filtering: Avoids entering during high-volume false breakouts
  3. Strict Order Management: Complete timeout and confirmation mechanisms reduce slippage losses
  4. Trailing Stop: Protects accumulated profits

Weaknesses

  1. Parameter Sensitivity: MACD and RMI thresholds require optimization for different markets
  2. Trend Dependency: Poor performance in ranging markets
  3. Complex Conditions: 7 conditions must all be met simultaneously, resulting in fewer entry opportunities

VIII. Applicable Scenarios

Market EnvironmentRecommended ConfigNotes
Strong Bull MarketEnableMulti-indicator confirmation, excellent in trends
Strong Bear MarketEnableShort logic same as long, can capture downtrends
Ranging MarketUse with CautionConditions hard to satisfy simultaneously
Sideways ConsolidationNot RecommendedMany 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 TypeRatingAnalysis
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 PairsMinimum RAMRecommended RAM
10-20 pairs2GB4GB
20-50 pairs4GB8GB

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:

  1. Multi-Dimensional Verification: Verifies signals through three dimensions: trend, momentum, and volume
  2. Strict Order Management: Complete timeout mechanisms reduce unnecessary losses
  3. 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.