PROTECTED SOURCE SCRIPT
MACD 直方图背离 + 连续N柱动能 + 量能/RSI 过滤(4周期版)

Strategy Overview (Concise English Description)
This trading script is built for Pine Script v6. It combines classic divergence detection with several trade-management safeguards to deliver fewer, higher-quality signals.
Core Signal Logic
MACD Histogram Divergence on up to four configurable time-frames (15 min, 30 min, 1 h, 4 h by default).
A trade is allowed if any selected timeframe shows a bullish or bearish divergence and its histogram bars move in the same direction for N consecutive candles (user-set per timeframe).
Context Filters
Volume filter: current volume must exceed a moving-average threshold (MA × multiplier).
RSI direction filter: RSI must be rising (for longs) or falling (for shorts).
Entry Controls
Cooldown: enforces a minimum number of minutes between new entries.
No pyramiding: just one position at a time.
Position Management
Minimum holding time: bars cannot be closed until a user-defined number of minutes has elapsed.
Fixed take-profit / stop-loss: expressed as percentages of entry price.
Optional trailing stop: activates once price moves a specified distance in favor; exits if it pulls back by a set offset.
Execution Details
Runs intrabar (calc_on_every_tick = true) and can send live orders, not just on bar close.
Uses fixed position size (1 contract) and applies a 0.05 % commission assumption.
Overall, the script targets clear momentum reversals confirmed by divergence, then layers on volume/RSI validation and strict timing rules to avoid over-trading and premature exits.Total Net Profit: +8,370,812.29 USDT (+837.08%)
Max Drawdown: 1,516,712.90 USDT (25.48%)
Total Trades: 700
Winning Trades: 36.71% (257 out of 700)
Profit Factor: 1.524
This trading script is built for Pine Script v6. It combines classic divergence detection with several trade-management safeguards to deliver fewer, higher-quality signals.
Core Signal Logic
MACD Histogram Divergence on up to four configurable time-frames (15 min, 30 min, 1 h, 4 h by default).
A trade is allowed if any selected timeframe shows a bullish or bearish divergence and its histogram bars move in the same direction for N consecutive candles (user-set per timeframe).
Context Filters
Volume filter: current volume must exceed a moving-average threshold (MA × multiplier).
RSI direction filter: RSI must be rising (for longs) or falling (for shorts).
Entry Controls
Cooldown: enforces a minimum number of minutes between new entries.
No pyramiding: just one position at a time.
Position Management
Minimum holding time: bars cannot be closed until a user-defined number of minutes has elapsed.
Fixed take-profit / stop-loss: expressed as percentages of entry price.
Optional trailing stop: activates once price moves a specified distance in favor; exits if it pulls back by a set offset.
Execution Details
Runs intrabar (calc_on_every_tick = true) and can send live orders, not just on bar close.
Uses fixed position size (1 contract) and applies a 0.05 % commission assumption.
Overall, the script targets clear momentum reversals confirmed by divergence, then layers on volume/RSI validation and strict timing rules to avoid over-trading and premature exits.Total Net Profit: +8,370,812.29 USDT (+837.08%)
Max Drawdown: 1,516,712.90 USDT (25.48%)
Total Trades: 700
Winning Trades: 36.71% (257 out of 700)
Profit Factor: 1.524
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
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.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
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.