MACD_Cross Strategy Analysis
Strategy Number: #190 (190th of 465 strategies)
Strategy Type: Trend Following / Moving Average Crossover
Timeframe: 5 Minutes (5m)
I. Strategy Overview
MACD_Cross is a simplified version of the MACD strategy, focusing exclusively on MACD's crossover signals, removing the CCI condition constraint. The core idea is: buy when the MACD line crosses above the Signal line from below, and sell when it crosses from above.
Core Features
| Feature | Description |
|---|---|
| Entry Condition | MACD crosses above Signal line + CCI < -50 |
| Exit Condition | MACD crosses below Signal line + CCI > 100 |
| Protection | Hard stop-loss |
| Timeframe | 5 Minutes |
| Dependencies | TA-Lib, technical (qtpylib) |
II. Strategy Configuration Analysis
2.1 Basic Risk Parameters
minimal_roi = {
"60": 0.01, # After 60 minutes: 1% exit
"30": 0.03, # After 30 minutes: 3% exit
"20": 0.04, # After 20 minutes: 4% exit
"0": 0.05 # Immediate: 5% exit
}
stoploss = -0.30 # -30% hard stop-loss
Design Philosophy:
- Identical risk parameter settings to the MACD strategy
- Streamlined entry/exit conditions
2.2 Fixed Parameters
# Entry Condition
buy_cci_threshold = -50.0
# Exit Condition
sell_cci_threshold = 100.0
III. Entry Conditions Details
3.1 Core Entry Logic
# Entry Condition
(
qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']) & # MACD crosses above Signal
(dataframe['cci'] <= -50.0) # CCI oversold
)
Interpretation:
- MACD crosses above Signal: MACD line just crossed from below to above (key crossover signal)
- CCI <= -50: CCI is in oversold territory
3.2 Crossover Detection
# Using qtpylib's crossover detection function
qtpylib.crossed_above(array1, array2)
Characteristics:
- Detects "just crossed" rather than a sustained state
- More sensitive than simple "MACD > Signal"
- Earlier signals, but may increase false signals
IV. Exit Conditions Details
4.1 Core Exit Logic
# Exit Condition
(
qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal']) & # MACD crosses below Signal
(dataframe['cci'] >= 100.0) # CCI overbought
)
Interpretation:
- MACD crosses below Signal: MACD line just crossed from above to below
- CCI >= 100: CCI is in overbought territory
V. Technical Indicator System
5.1 MACD Indicator
| Indicator | Calculation | Default Period |
|---|---|---|
| MACD | EMA12 - EMA26 | 12, 26 |
| Signal | EMA9 of MACD | 9 |
| Histogram | MACD - Signal | - |
5.2 CCI Indicator
CCI = (Typical Price - SMA) / (0.015 × Mean Deviation)
| Zone | CCI Value |
|---|---|
| Oversold | < -100 |
| Neutral | -100 ~ 100 |
| Overbought | > 100 |
VI. Risk Management
6.1 ROI Exit Strategy
| Time | Minimum Profit |
|---|---|
| 0 minutes | 5% |
| 20 minutes | 4% |
| 30 minutes | 3% |
| 60 minutes | 1% |
6.2 Stop-Loss Strategy
| Parameter | Value |
|---|---|
| Hard Stop | -30% |
VII. Strategy Pros & Cons
✅ Pros
- Earlier Signals:
crossed_above/belowis more sensitive than sustained states - Clean & Clear: Logic is simple, easy to understand
- Classic Combo: MACD crossover + CCI filtering
- Fast Response: Catches trend changes more quickly
⚠️ Cons
- More False Signals: Crossover signals are more prone to false signals than sustained states
- No Parameter Optimization: Fixed CCI thresholds, no auto-optimization
- Inherent Lag: MACD's lagging nature cannot be fully eliminated
- Large Stop-Loss: -30% is a wide stop
VIII. MACD vs. MACD_Cross Comparison
| Characteristic | MACD | MACD_Cross |
|---|---|---|
| MACD Condition | MACD > Signal | crossed_above |
| CCI Condition | Optimizable | Fixed (-50/100) |
| Signal Sensitivity | Lower | Higher |
| False Signals | Fewer | More |
| Optimization Space | Supports hyperopt | Fixed parameters |
IX. Applicable Scenarios
| Market Environment | Performance | Description |
|---|---|---|
| Trending Up | ⭐⭐⭐⭐⭐ | Perfectly captures crossover points |
| Trending Down | ⭐⭐⭐⭐⭐ | Same logic applied for shorting |
| Ranging Upward | ⭐⭐⭐ | Crossover signals are frequent |
| Sideways Ranging | ⭐⭐ | False signals increase |
X. Parameter Adjustment
10.1 Adjustable Parameters
| Parameter | Current Value | Adjustment Suggestion |
|---|---|---|
| buy_cci | -50 | -100 ~ 0 |
| sell_cci | 100 | 0 ~ 500 |
| timeframe | 5m | Adjust per style |
| stoploss | -0.30 | -0.20 ~ -0.40 |
10.2 Timeframe
| Timeframe | Characteristics |
|---|---|
| 1m/5m | More signals, higher noise |
| 15m/1h | Balanced |
| 4h | Fewer signals but more stable |
XI. Summary
MACD_Cross is a simplified version of the classic MACD strategy, focusing on the moment of MACD line crossovers. Compared to the standard MACD strategy, it uses more sensitive crossover detection functions, catching trend changes earlier — but may also generate more false signals.
Core characteristics:
- Crossover Signals: Uses
crossed_above/belowto detect instant crossings - CCI Filtering: Fixed CCI thresholds as auxiliary confirmation
- Simple Logic: Conditions are easy to understand and implement
- Fast Response: Issues signals earlier than sustained-state conditions
Usage recommendations:
- Suitable for traders seeking earlier entry timing
- Needs trend filtering to reduce false signals
- Best performance in clearly trending markets
- Validate signal quality on paper trading first