Table of Contents
- Introduction to MACD
- Signal Types
- Configuration Parameters
- Trading Strategy Optimization
- Timeframe-Specific Settings
- Asset-Specific Configurations
- Alert Broadcasting
- Best Practices
Introduction to MACD
The Moving Average Convergence Divergence (MACD) is a momentum indicator that shows the relationship between two moving averages of an asset's price. This system generates automated BUY and SELL signals based on MACD crossovers, histogram analysis, and zero-line crosses.
Default MACD Parameters:
- Fast Period: 12
- Slow Period: 26
- Signal Period: 9
Signal Types
MACD_BUY Signals
Generated when:
- Golden Cross: MACD line crosses above the signal line
- Bullish Histogram: Histogram exceeds
macd_histogram_strong_buythreshold - Zero Line Cross: MACD crosses above zero line (strong momentum confirmation)
MACD_SELL Signals
Generated when:
- Death Cross: MACD line crosses below the signal line
- Bearish Histogram: Histogram drops below
macd_histogram_strong_sellthreshold - Zero Line Cross: MACD crosses below zero line (bearish momentum confirmation)
Additional Volatility Signals
- PUMP: Extreme bullish momentum detected
- CRASH: Extreme bearish momentum detected
- BUY/SELL: General trend signals (can combine with MACD for confirmation)
Configuration Parameters
# Enable/Disable MACD Signals
enable_macd_crossover_signal: true # Primary signal type
enable_macd_divergence_signal: false # Advanced feature (future)
# Histogram Thresholds (adjust per asset class)
macd_histogram_strong_buy: 0.5 # Bullish threshold
macd_histogram_strong_sell: -0.5 # Bearish threshold
# Zero Line Detection
macd_zero_line_threshold: 0.001 # Sensitivity for zero crosses
# MACD Periods
macd_fast_period: 12 # Fast EMA
macd_slow_period: 26 # Slow EMA
macd_signal_period: 9 # Signal line
Key Configuration Tips
- Histogram Thresholds: Higher values = fewer but stronger signals
- Zero Line Threshold: Lower values = more sensitive to momentum shifts
- Period Settings: Standard (12,26,9) works for most cases; adjust for specific strategies
Trading Strategy Optimization
1. Scalping Strategy (High-Frequency Trading)
Objective: Quick profits from small price movements (seconds to minutes)
Recommended Timeframes: 1m, 3m, 5m
Optimized MACD Settings:
# Faster, more sensitive settings
macd_fast_period: 5
macd_slow_period: 13
macd_signal_period: 5
# Tighter thresholds for quick signals
macd_histogram_strong_buy: 0.1 # Crypto
macd_histogram_strong_sell: -0.1
macd_zero_line_threshold: 0.0005
enable_macd_crossover_signal: true
Broadcast Signals:
supported_volatility_action_broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "PUMP" # For scalping quick pumps
- "CRASH" # Exit signals
Best Practices:
- Use 1m or 3m charts for maximum signal frequency
- Combine with volume analysis for confirmation
- Set tight stop-losses (0.5-1%)
- Risk/reward ratio: 1:1 or 1:1.5
- Avoid during low liquidity periods
2. Day Trading Strategy (Intraday)
Objective: Capitalize on daily price movements (minutes to hours)
Recommended Timeframes: 5m, 15m, 30m, 1h
Optimized MACD Settings:
# Balanced sensitivity
macd_fast_period: 8
macd_slow_period: 17
macd_signal_period: 7
# Moderate thresholds
macd_histogram_strong_buy: 0.3 # Crypto
macd_histogram_strong_sell: -0.3
macd_zero_line_threshold: 0.001
enable_macd_crossover_signal: true
Broadcast Signals:
supported_volatility_action_broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "BUY" # Trend confirmation
- "SELL"
Best Practices:
- Primary timeframe: 15m or 30m
- Use 1h for trend confirmation
- Check 5m for precise entry/exit
- Stop-loss: 1-2%
- Risk/reward ratio: 1:2
- Close all positions before market close
3. Swing Trading Strategy (Multi-Day)
Objective: Ride medium-term trends (days to weeks)
Recommended Timeframes: 1h, 2h, 6h, 12h, 1d
Optimized MACD Settings:
# Standard settings for reliability
macd_fast_period: 12
macd_slow_period: 26
macd_signal_period: 9
# Standard thresholds
macd_histogram_strong_buy: 0.5 # Crypto
macd_histogram_strong_sell: -0.5
macd_zero_line_threshold: 0.001
enable_macd_crossover_signal: true
Broadcast Signals:
supported_volatility_action_broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "BUY"
- "SELL"
- "PUMP" # Major trend shifts
Best Practices:
- Primary timeframe: 1h or 6h
- Use 1d for major trend direction
- Use 2h for entry refinement
- Stop-loss: 3-5%
- Risk/reward ratio: 1:3
- Hold positions 3-10 days typically
4. Long-Term Trading/Position Trading
Objective: Long-term wealth accumulation (weeks to months)
Recommended Timeframes: 6h, 12h, 1d
Optimized MACD Settings:
# Slower, more stable settings
macd_fast_period: 19
macd_slow_period: 39
macd_signal_period: 9
# Higher thresholds for strong signals only
macd_histogram_strong_buy: 1.0 # Crypto
macd_histogram_strong_sell: -1.0
macd_zero_line_threshold: 0.002
enable_macd_crossover_signal: true
Broadcast Signals:
supported_volatility_action_broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "PUMP" # Major market shifts
- "CRASH" # Exit warnings
Best Practices:
- Primary timeframe: 1d
- Use 12h for confirmation
- Ignore short-term noise
- Stop-loss: 8-15%
- Risk/reward ratio: 1:5 or higher
- Hold positions weeks to months
- Focus on fundamental analysis too
Timeframe-Specific Settings
Ultra-Fast Timeframes (1m, 3m)
macd_fast_period: 5
macd_slow_period: 13
macd_signal_period: 5
macd_histogram_strong_buy: 0.05-0.15 # Very sensitive
macd_histogram_strong_sell: -0.05 to -0.15
Use Case: Scalping, bot trading
Pros: High signal frequency
Cons: Many false signals, high noise
Fast Timeframes (5m, 15m)
macd_fast_period: 8
macd_slow_period: 17
macd_signal_period: 7
macd_histogram_strong_buy: 0.2-0.4
macd_histogram_strong_sell: -0.2 to -0.4
Use Case: Day trading, active scalping
Pros: Good balance of speed and accuracy
Cons: Requires constant monitoring
Medium Timeframes (30m, 1h, 2h)
macd_fast_period: 12
macd_slow_period: 26
macd_signal_period: 9
macd_histogram_strong_buy: 0.3-0.6
macd_histogram_strong_sell: -0.3 to -0.6
Use Case: Day trading, swing trading
Pros: Reliable signals, manageable frequency
Cons: May miss quick opportunities
Slow Timeframes (6h, 12h, 1d)
macd_fast_period: 12-19
macd_slow_period: 26-39
macd_signal_period: 9
macd_histogram_strong_buy: 0.8-2.0
macd_histogram_strong_sell: -0.8 to -2.0
Use Case: Swing trading, position trading
Pros: Strong trend identification, fewer false signals
Cons: Delayed entries, fewer signals
Asset-Specific Configurations
Cryptocurrency (Bitcoin, Ethereum, etc.)
# Standard crypto settings
macd_histogram_strong_buy: 0.5-2.0
macd_histogram_strong_sell: -0.5 to -2.0
macd_zero_line_threshold: 0.001
# Volatile altcoins (lower thresholds)
macd_histogram_strong_buy: 0.3-1.0
macd_histogram_strong_sell: -0.3 to -1.0
Characteristics: High volatility, 24/7 trading
Recommended: Use 15m-1h for day trading, 1h-1d for swing
Forex (EUR/USD, GBP/USD, etc.)
# Very sensitive thresholds
macd_histogram_strong_buy: 0.0001-0.001
macd_histogram_strong_sell: -0.0001 to -0.001
macd_zero_line_threshold: 0.00001
# Standard periods work well
macd_fast_period: 12
macd_slow_period: 26
macd_signal_period: 9
Characteristics: Lower volatility, high liquidity
Recommended: Use 5m-30m for day trading, 1h-6h for swing
Stocks (AAPL, TSLA, SPY, etc.)
# Moderate thresholds
macd_histogram_strong_buy: 0.1-1.0
macd_histogram_strong_sell: -0.1 to -1.0
macd_zero_line_threshold: 0.001
# Can use longer periods for stability
macd_fast_period: 12-15
macd_slow_period: 26-30
macd_signal_period: 9
Characteristics: Medium volatility, market hours only
Recommended: Use 15m-1h for day trading, 1h-1d for swing
Alert Broadcasting
Supported Volatility Actions
supported_volatility_action:
- "BUY" # General buy signal
- "SELL" # General sell signal
- "PUMP" # Extreme upward momentum
- "CRASH" # Extreme downward momentum
Broadcast Configuration
supported_volatility_action_broadcast:
- "BUY" # Trend signals
- "SELL"
- "PUMP" # Extreme volatility
- "CRASH"
- "MACD_SELL" # MACD-specific signals
- "MACD_BUY"
Broadcasting Strategy by Trading Style
Scalpers (1m-5m):
broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "PUMP" # Quick opportunities
- "CRASH" # Fast exits
Day Traders (5m-1h):
broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "BUY" # Confirmation
- "SELL"
Swing Traders (1h-1d):
broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "PUMP" # Major trend changes
- "SELL"
Position Traders (12h-1d):
broadcast:
- "MACD_BUY"
- "MACD_SELL"
- "PUMP" # Market regime changes
- "CRASH"
Best Practices
- Multi-Timeframe Analysis
- Primary Timeframe: Your main trading chart
- Higher Timeframe: Identify overall trend (3-5x longer)
- Lower Timeframe: Precise entry/exit (3-5x shorter)
Example for Day Trading:
- Higher: 1h (trend direction)
- Primary: 15m (signals)
- Lower: 5m (entries)
- Confirmation Strategies
Never trade on MACD alone. Combine with:
- Volume: Confirm breakouts with volume spikes
- Support/Resistance: Trade near key levels
- RSI: Avoid overbought/oversold extremes
- Price Action: Look for candlestick patterns
- Signal Quality Filters
High-Quality MACD Signals:
- Histogram momentum increasing
- Zero line cross in same direction
- Multiple timeframe alignment
- Occurs at support/resistance
Low-Quality Signals (avoid):
- Histogram divergence from cross
- Choppy, sideways markets
- Against higher timeframe trend
- During low volume periods
- Risk Management
- Position Sizing: Never risk more than 1-2% per trade
- Stop Loss: Always use stops based on strategy
- Take Profit: Set targets at 2-3x your risk minimum
- Max Drawdown: Pause trading if down 10% from peak
- Optimization Workflow
- Backtest settings on historical data (500+ trades)
- Paper Trade for 2-4 weeks
- Small Live Test with minimal capital
- Scale Up gradually as confidence builds
- Review & Adjust monthly
- Common Mistakes to Avoid
- Over-optimizing on limited data (curve fitting)
- Ignoring market conditions (trending vs ranging)
- Trading every signal without confirmation
- Using same settings across all assets
- Neglecting to adjust thresholds for volatility changes
- Trading during major news events without preparation
- Market Condition Adjustments
Trending Markets:
- Use standard MACD settings
- Focus on MACD_BUY in uptrends, MACD_SELL in downtrends
- Trade in direction of trend only
Ranging Markets:
- Tighten histogram thresholds
- Use shorter periods (faster response)
- Consider disabling signals or trading less
High Volatility:
- Increase histogram thresholds
- Widen stop losses
- Reduce position sizes
Low Volatility:
- Decrease histogram thresholds
- May need to switch to longer timeframes
- Be patient for quality setups
Quick Reference Table
| Strategy | Timeframes | Fast/Slow/Signal | Histogram Thresholds | Best For |
|---|---|---|---|---|
| Scalping | 1m, 3m, 5m | 5/13/5 | ±0.1-0.2 | Quick profits, high activity |
| Day Trading | 5m, 15m, 30m, 1h | 8/17/7 | ±0.3-0.5 | Intraday trends |
| Swing Trading | 1h, 6h, 12h, 1d | 12/26/9 | ±0.5-1.0 | Multi-day positions |
| Position Trading | 6h, 12h, 1d | 19/39/9 | ±1.0-2.0 | Long-term holds |
Conclusion
MACD signals are powerful when configured correctly for your trading style and asset class. Start with the recommended settings for your strategy, backtest thoroughly, and adjust based on your results. Remember that no indicator is perfect—always use proper risk management and combine MACD with other analysis methods for best results.
Final Checklist:
- ✅ Enable
enable_macd_crossover_signal: true - ✅ Set histogram thresholds appropriate for your asset
- ✅ Configure periods matching your timeframe
- ✅ Set up broadcast alerts for your platform
- ✅ Test settings before live trading
- ✅ Document your results and iterate
Happy trading!