OPEN-SOURCE SCRIPT

MACD Liquidity Tracker Strategy [Quant Trading]

4 227
MACD Liquidity Tracker Strategy
Overview
The MACD Liquidity Tracker Strategy is an enhanced trading system that transforms the traditional MACD indicator into a comprehensive momentum-based strategy with advanced visual signals and risk management. This strategy builds upon the original MACD Liquidity Tracker System indicator by TheNeWSystemLqtyTrckr, converting it into a fully automated trading strategy with improved parameters and additional features.
What Makes This Strategy Original
This strategy significantly enhances the basic MACD approach by introducing:
  • Four distinct system types for different market conditions and trading styles
  • Advanced color-coded histogram visualization with four dynamic colors showing momentum strength and direction
  • Integrated trend filtering using 9 different moving average types
  • Comprehensive risk management with customizable stop-loss and take-profit levels
  • Multiple alert systems for entry signals, exits, and trend conditions
  • Flexible signal display options with customizable entry markers

How It Works
Core MACD Calculation
The strategy uses a fully customizable MACD configuration with traditional default parameters:
  • Fast MA: 12 periods (customizable, minimum 1, no maximum limit)
  • Slow MA: 26 periods (customizable, minimum 1, no maximum limit)
  • Signal Line: 9 periods (customizable, now properly implemented and used)

Cryptocurrency Optimization: The strategy's flexible parameter system allows for significant optimization across different crypto assets. Traditional MACD settings (12/26/9) often generate excessive noise and false signals in volatile crypto markets. By using slower, more smoothed parameters, traders can capture meaningful momentum shifts while filtering out market noise.
Example - DOGE Optimization (45/80/290 settings):
Performance: Optimized parameters yielding exceptional backtesting results with 29,800% PnL
Why it works: DOGE's high volatility and social sentiment-driven price action benefits from heavily smoothed indicators
Timeframes: Particularly effective on 30-minute and 4-hour charts for swing trading
Logic: The very slow parameters filter out noise and capture only the most significant trend changes

Other Optimizable Cryptocurrencies: This parameter flexibility makes the strategy highly effective for major altcoins including SUI, SEI, LINK, Solana (SOL), and many others. Each crypto asset can benefit from custom parameter tuning based on its unique volatility profile and trading characteristics.
Four Trading System Types
1. Normal System (Default)
  • Long signals: When MACD line is above the signal line
  • Short signals: When MACD line is below the signal line
  • Best for: Swing trading and capturing longer-term trends in stable markets
  • Logic: Traditional MACD crossover approach using the signal line

2. Fast System
  • Long signals: Bright Blue OR Dark Magenta (transparent) histogram colors
  • Short signals: Dark Blue (transparent) OR Bright Magenta histogram colors
  • Best for: Scalping and high-volatility markets (crypto, forex)
  • Logic: Leverages early momentum shifts based on histogram color changes

3. Safe System
  • Long signals: Only Bright Blue histogram color (strongest bullish momentum)
  • Short signals: All other colors (Dark Blue, Bright Magenta, Dark Magenta)
  • Best for: Risk-averse traders and choppy markets
  • Logic: Prioritizes only the strongest bullish signals while treating everything else as bearish

4. Crossover System
  • Long signals: MACD line crosses above signal line
  • Short signals: MACD line crosses below signal line
  • Best for: Precise timing entries with traditional MACD methodology
  • Logic: Pure crossover signals for more precise entry timing

Color-Coded Histogram Logic
The strategy uses four distinct colors to visualize momentum:
  • 🔹 Bright Blue: MACD > 0 and rising (strong bullish momentum)
  • 🔹 Dark Blue (Transparent): MACD > 0 but falling (weakening bullish momentum)
  • 🔹 Bright Magenta: MACD < 0 and falling (strong bearish momentum)
  • 🔹 Dark Magenta (Transparent): MACD < 0 but rising (weakening bearish momentum)

Trend Filter Integration
The strategy includes an advanced trend filter using 9 different moving average types:
  • SMA (Simple Moving Average)
  • EMA (Exponential Moving Average) - Default
  • WMA (Weighted Moving Average)
  • HMA (Hull Moving Average)
  • RMA (Running Moving Average)
  • LSMA (Least Squares Moving Average)
  • DEMA (Double Exponential Moving Average)
  • TEMA (Triple Exponential Moving Average)
  • VIDYA (Variable Index Dynamic Average)

Default Settings: 50-period EMA for trend identification
Visual Signal System
  • Entry Markers: Blue triangles (▲) below candles for long entries, Magenta triangles (▼) above candles for short entries
  • Candle Coloring: Price candles change color based on active signals (Blue = Long, Magenta = Short)
  • Signal Text: Optional "Long" or "Short" text inside entry triangles (toggleable)
  • Trend MA: Gray line plotted on main chart for trend reference

Parameter Optimization Examples
DOGE Trading Success (Optimized Parameters):
Using 45/80/290 MACD settings with 50-period EMA trend filter has shown exceptional results on DOGE:
  • Performance: Backtesting results showing 29,800% PnL demonstrate the power of proper parameter optimization
  • Reasoning: DOGE's meme-driven volatility and social sentiment spikes create significant noise with traditional MACD settings
  • Solution: Very slow parameters (45/80/290) filter out social media-driven price spikes while capturing only major momentum shifts
  • Optimal Timeframes: 30-minute and 4-hour charts for swing trading opportunities
  • Result: Exceptionally clean signals with minimal false entries during DOGE's characteristic pump-and-dump cycles

Multi-Crypto Adaptability:
The same optimization principles apply to other major cryptocurrencies:
  • SUI: Benefits from smoothed parameters due to newer coin volatility patterns
  • SEI: Requires adjustment for its unique DeFi-related price movements
  • LINK: Oracle news events create price spikes that benefit from noise filtering
  • Solana (SOL): Network congestion events and ecosystem developments need smoothed detection
  • General Rule: Higher volatility coins typically benefit from very slow MACD parameters (40-50 / 70-90 / 250-300 ranges)

Key Input Parameters
  • System Type: Choose between Fast, Normal, Safe, or Crossover (Default: Normal)
  • MACD Fast MA: 12 periods default (no maximum limit, consider 40-50 for crypto optimization)
  • MACD Slow MA: 26 periods default (no maximum limit, consider 70-90 for crypto optimization)
  • MACD Signal MA: 9 periods default (now properly utilized, consider 250-300 for crypto optimization)
  • Trend MA Type: EMA default (9 options available)
  • Trend MA Length: 50 periods default (no maximum limit)
  • Signal Display: Both, Long Only, Short Only, or None
  • Show Signal Text: True/False toggle for entry marker text

Trading Applications
Recommended Use Cases
  1. Momentum Trading: Capitalize on strong directional moves using the color-coded system
  2. Trend Following: Combine MACD signals with trend MA filter for higher probability trades
  3. Scalping: Use "Fast" system type for quick entries in volatile markets
  4. Swing Trading: Use "Normal" or "Safe" system types for longer-term positions
  5. Cryptocurrency Trading: Optimize parameters for individual crypto assets (e.g., 45/80/290 for DOGE, custom settings for SUI, SEI, LINK, SOL)

Market Suitability
  • Volatile Markets: Forex, crypto, indices (recommend "Fast" system or smoothed parameters)
  • Stable Markets: Stocks, ETFs (recommend "Normal" or "Safe" system)
  • All Timeframes: Effective from 1-minute charts to daily charts
  • Crypto Optimization: Each major cryptocurrency (DOGE, SUI, SEI, LINK, SOL, etc.) can benefit from custom parameter tuning. Consider slower MACD parameters for noise reduction in volatile crypto markets

Alert System
The strategy provides comprehensive alerts for:
  • Entry Signals: Long and short entry triangle appearances
  • Exit Signals: Position exit notifications
  • Color Changes: Individual histogram color alerts
  • Trend Conditions: Price above/below trend MA alerts

Strategy Parameters
Default Settings
  • Initial Capital: $1,000
  • Position Size: 100% of equity
  • Commission: 0.1%
  • Slippage: 3 points
  • Date Range: January 1, 2018 to December 31, 2069

Risk Management (Optional)
  • Stop Loss: Disabled by default (customizable percentage-based)
  • Take Profit: Disabled by default (customizable percentage-based)
  • Short Trades: Disabled by default (can be enabled)

Important Notes and Limitations
Backtesting Considerations
  • Uses realistic commission (0.1%) and slippage (3 points)
  • Default position sizing uses 100% equity - adjust based on risk tolerance
  • Stop-loss and take-profit are disabled by default to show raw strategy performance
  • Strategy does not use lookahead bias or future data

Risk Warnings
  • Past performance does not guarantee future results
  • MACD-based strategies may produce false signals in ranging markets
  • Consider combining with additional confluences like support/resistance levels
  • Test thoroughly on demo accounts before live trading
  • Adjust position sizing based on your risk management requirements

Technical Limitations
  • Strategy does not work on non-standard chart types (Heikin Ashi, Renko, etc.)
  • Signals are based on close prices and may not reflect intraday price action
  • Multiple rapid signals in volatile conditions may result in overtrading

Credits and Attribution
This strategy is based on the original "MACD Liquidity Tracker System" indicator created by TheNeWSystemLqtyTrckr. This strategy version includes significant enhancements:
  • Complete strategy implementation with entry/exit logic
  • Addition of the "Crossover" system type
  • Proper implementation and utilization of the MACD signal line
  • Enhanced risk management features
  • Improved parameter flexibility with no artificial maximum limits
  • Additional alert systems for comprehensive trade management

The original indicator's core color logic and visual system have been preserved while expanding functionality for automated trading applications.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.