PROTECTED SOURCE SCRIPT

MACD Divergence Ultimate

46
MACD Divergence Ultimate (V6) —— Structural Lock & Price Action Confirmation
📖 Strategy Overview
This is a sophisticated trend-reversal and pullback strategy specifically engineered for the 15-minute timeframe and above. Unlike generic divergence scripts, this strategy implements a "Triple-Filter" mechanism: Momentum Decay Thresholds, Dynamic Structural Refreshing, and Candle Color Confirmation. It doesn't just look for "Divergence"—it hunts for the exact moment of exhaustion and confirmed reversal.

🚀 Core Logic Highlights
1. Momentum Decay Threshold
The strategy goes beyond simple price/MACD decoupling. It introduces a decay_threshold parameter. A signal is only valid if the current MACD histogram peak has decayed to 60% (default) or less of the previous peak. This ensures we only trade when the trend’s momentum is significantly depleted.

2. "One Wave, One Trade" & Structural Reset
This is the strategy’s primary defensive layer:

Wave Locking: Within a single MACD wave (on one side of the zero line), the strategy allows only one entry attempt to prevent "catching a falling knife" during strong trending moves.

Structural Refresh: If the market achieves a "New Price High + New MACD High" (for bulls), the system recognizes a trend continuation. It immediately unlocks and resets, preparing for the next valid divergence setup.

3. Candle Confirmation & "Golden Pullback" Entry
Upon detecting a divergence (A-Bar), the system enters "Stalking Mode":

Bullish Divergence: Must wait for the first Bullish Candle (Close > Open).

Bearish Divergence: Must wait for the first Bearish Candle (Close < Open).

Entry Optimization: Once confirmed, the system places a Limit Order at the 75% retracement level of that confirmation candle. We never chase; we only enter on high-probability pullbacks to maximize the Reward-to-Risk (RR) ratio.

4. New York Open Protection
Built-in Time Filtering (defaulting to 08:30-10:30 New York Time) helps avoid the high-volatility "whipsaws" typical of the market open, which often create trap-like divergence signals.



MACD 背离策略

📖 策略概述
这是一款专为 15分钟周期(及以上)设计的趋势反转/回调策略。与市面上平庸的背离脚本不同,本策略引入了动量衰减阈值、价格结构刷新锁以及K线行为确认三重过滤机制。它不只是在寻找“背离”,而是在寻找“力竭”且“确认反转”的黄金入场点。

🚀 核心逻辑亮点
1. 动量衰减阈值 (Momentum Decay)
本策略不仅要求 MACD 柱状图不创新高/新低,更引入了 decay_threshold 参数。只有当当前的 MACD 波峰衰减至前波的 60%(默认)以下时,系统才认为趋势动能已实质性枯竭,从而排除无效的微弱波动。

2. “一波一单”与结构刷新锁
这是本策略最强大的防御机制:

单波锁定:在 MACD 柱状图同属于零轴一侧的波动中,策略默认只进行一次交易尝试,避免在阴跌行情中反复抄底。

结构同步重置:如果行情出现“价格新高 + MACD新高”(多头能量增强),系统会判定之前的背离逻辑失效,并即刻解除锁定,重新捕捉下一个背离机会。

3. K线颜色确认与“黄金回撤”入场
系统在捕捉到背离信号(A柱)后,不会盲目入场,而是进入**“蹲守模式”**:

看涨背离:必须等到出现第一根阳线。

看跌背离:必须等到出现第一根阴线。

入场位优化:确认 K 线出现后,系统会挂出该 K 线 3/4 位置的回调单。这意味着我们始终在追求极致的盈亏比,不追高,只做高确定性的回调切入。

4. 纽约开盘保护
针对 15 分钟线,策略内置了时间过滤逻辑(默认避开纽约开盘 08:30-10:30),有效规避了开盘初期剧烈双向扫单带来的虚假背离信号。

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.