OPEN-SOURCE SCRIPT
Double MACD Strategy

Double MACD Strategy (Default Settings)
This automated strategy uses two independent MACD indicators to flip between long and short positions.
How It Works
• Fast MACD (MACD 1) captures rapid micro-trends
• Slow MACD (MACD 2) confirms broader momentum
• Long Entry when both MACD lines cross above their signal lines
• Short Entry when both MACD lines cross below their signal lines
• Existing opposing trades are closed before opening new ones
Default Input Settings
• Fast MACD (MACD 1)
• Fast Length 1: 12
• Slow Length 1: 26
• Signal Length 1: 9
• MA Type 1: EMA
• Slow MACD (MACD 2)
• Fast Length 2: 24
• Slow Length 2: 52
• Signal Length 2: 9
• MA Type 2: EMA
• Position Sizing: 100 % of equity
• Pyramiding: 1 concurrent entry per direction
Usage
1. Apply to any chart on your desired timeframe.
2. Monitor background shading (green for bullish, red for bearish bias).
3. Manage risk with your own stop loss, take profit, and position-sizing rules.
Disclaimer
This script is provided for educational purposes only. It is not financial advice or a recommendation to buy or sell any instrument. All trading involves risk, and any losses incurred are the sole responsibility of the trader.
This automated strategy uses two independent MACD indicators to flip between long and short positions.
How It Works
• Fast MACD (MACD 1) captures rapid micro-trends
• Slow MACD (MACD 2) confirms broader momentum
• Long Entry when both MACD lines cross above their signal lines
• Short Entry when both MACD lines cross below their signal lines
• Existing opposing trades are closed before opening new ones
Default Input Settings
• Fast MACD (MACD 1)
• Fast Length 1: 12
• Slow Length 1: 26
• Signal Length 1: 9
• MA Type 1: EMA
• Slow MACD (MACD 2)
• Fast Length 2: 24
• Slow Length 2: 52
• Signal Length 2: 9
• MA Type 2: EMA
• Position Sizing: 100 % of equity
• Pyramiding: 1 concurrent entry per direction
Usage
1. Apply to any chart on your desired timeframe.
2. Monitor background shading (green for bullish, red for bearish bias).
3. Manage risk with your own stop loss, take profit, and position-sizing rules.
Disclaimer
This script is provided for educational purposes only. It is not financial advice or a recommendation to buy or sell any instrument. All trading involves risk, and any losses incurred are the sole responsibility of the trader.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.