OPEN-SOURCE SCRIPT
Evil MACD Trading System (Pine Script v6)

Indicator Overview
The Evil MACD Trading System is an enhanced version of the classic MACD indicator, optimized for TradingView with Pine Script v6. It integrates trend filtering, volume confirmation, and precision signal positioning to reduce false signals and improve trading decision accuracy—distinguishing itself from the traditional 12/26/9 MACD by focusing on trend-aligned entries and exits.
Core Logic & Features
1. Enhanced MACD Calculation
Departing from the standard MACD parameters, this system uses customizable fast (default:14), slow (default:28), and signal (default:8) periods to adapt to different market volatility and asset types (stocks, futures, cryptos). The core DIF, DEA, and histogram are retained while optimized for better sensitivity to medium-term trends.
2. Trend Filtering Mechanism
A 60-period EMA (adjustable) acts as the primary trend filter, ensuring buy signals only trigger in uptrends (price above EMA) and sell signals in downtrends (price below EMA). This avoids counter-trend trades and minimizes exposure to sideways market noise.
3. Volume Confirmation (Toggleable)
The optional volume filter validates signals by requiring trading volume to exceed 120% of the 20-period average volume. This ensures entries/exits are supported by capital flow, reducing false breakouts/breakdowns.
4. Precision Signal Positioning
Signals are overlaid directly on the price chart (not the subwindow) for intuitive price correlation. Buy signals (green upward triangles + "Buy" label) attach to the bottom of candlesticks, while sell signals (red downward triangles + "Sell" label) align with candlestick highs—adjustable offset parameters let users fine-tune signal proximity to price.
Usage Guidelines
- Buy Signal: Triggered when DIF crosses above DEA, price stays above the 60-period EMA, and volume (if enabled) meets the 120% threshold.
- Sell Signal: Triggered when DIF crosses below DEA, price stays below the 60-period EMA, and volume (if enabled) meets the 120% threshold.
- Customization: Adjust MACD periods, trend filter length, volume sensitivity, and signal offset to match your trading style (scalping, swing trading) and target assets.
Compatibility & Notes
Built for Pine Script v6 (latest TradingView version) with no syntax errors. The indicator supports all timeframes and asset classes. For best results, combine with additional technical tools (support/resistance, RSI) for multi-factor confirmation. Disable the volume filter in low-liquidity markets to avoid missing valid signals.
The Evil MACD Trading System is an enhanced version of the classic MACD indicator, optimized for TradingView with Pine Script v6. It integrates trend filtering, volume confirmation, and precision signal positioning to reduce false signals and improve trading decision accuracy—distinguishing itself from the traditional 12/26/9 MACD by focusing on trend-aligned entries and exits.
Core Logic & Features
1. Enhanced MACD Calculation
Departing from the standard MACD parameters, this system uses customizable fast (default:14), slow (default:28), and signal (default:8) periods to adapt to different market volatility and asset types (stocks, futures, cryptos). The core DIF, DEA, and histogram are retained while optimized for better sensitivity to medium-term trends.
2. Trend Filtering Mechanism
A 60-period EMA (adjustable) acts as the primary trend filter, ensuring buy signals only trigger in uptrends (price above EMA) and sell signals in downtrends (price below EMA). This avoids counter-trend trades and minimizes exposure to sideways market noise.
3. Volume Confirmation (Toggleable)
The optional volume filter validates signals by requiring trading volume to exceed 120% of the 20-period average volume. This ensures entries/exits are supported by capital flow, reducing false breakouts/breakdowns.
4. Precision Signal Positioning
Signals are overlaid directly on the price chart (not the subwindow) for intuitive price correlation. Buy signals (green upward triangles + "Buy" label) attach to the bottom of candlesticks, while sell signals (red downward triangles + "Sell" label) align with candlestick highs—adjustable offset parameters let users fine-tune signal proximity to price.
Usage Guidelines
- Buy Signal: Triggered when DIF crosses above DEA, price stays above the 60-period EMA, and volume (if enabled) meets the 120% threshold.
- Sell Signal: Triggered when DIF crosses below DEA, price stays below the 60-period EMA, and volume (if enabled) meets the 120% threshold.
- Customization: Adjust MACD periods, trend filter length, volume sensitivity, and signal offset to match your trading style (scalping, swing trading) and target assets.
Compatibility & Notes
Built for Pine Script v6 (latest TradingView version) with no syntax errors. The indicator supports all timeframes and asset classes. For best results, combine with additional technical tools (support/resistance, RSI) for multi-factor confirmation. Disable the volume filter in low-liquidity markets to avoid missing valid signals.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.