OPEN-SOURCE SCRIPT
Updated Pradip's MACD Divergence Pro

This is where the "magic" happens, Pradip. MACD Divergence is one of the most powerful concepts because it acts like an early-warning system. It tells you when the market is "lying"—when the price is moving up or down, but the energy (momentum) behind it is dying.
Release Notes
How to Read These Signals"BUY" (Small Green Triangle): This appears when the price is above the 200 EMA and we see a Bullish MACD Divergence. This is your standard entry signal.
"DIV BUY PRO" (Big Green Label): This is your High-Confidence Setup. It means you have the Divergence, the 200 EMA trend, AND the 13/30 EMA crossover all happening together. This is a very powerful signal for Nifty 50.
"SELL" (Small Red Triangle): Appears in a downtrend (below 200 EMA) with Bearish Divergence
Release Notes
The Entry Rules (Confirmation)Don't enter "blindly" as soon as the label appears. Wait for the Signal Candle to close.
For BUY Signal:
Wait for the Green Candle (Signal Candle) to close.
Place a Buy Stop order 1-2 ticks above the high of that signal candle. If the next candle doesn't break that high, the momentum might be weak—be careful.
For SELL Signal:
Wait for the Red Candle to close.
Place a Sell Stop order 1-2 ticks below the low of that signal candle.
2. Setting Stop Loss (SL) & Targets (TP)
As a trader with your level of experience, you know that "Capital Preservation" is key.
Stop Loss (SL):
Buy: Place the SL just below the recent Swing Low (where the divergence formed).
Sell: Place the SL just above the recent Swing High.
Take Profit (TP):
Level 1: Aim for a 1:1.5 Risk-to-Reward. Once hit, move your SL to Cost (Break-even).
Level 2: Aim for 1:2.5. This is where you exit 80% of your position.
Level 3: Let the remaining 20% run until the MACD crosses back in the opposite direction.
Release Notes
Best Time Frame 1 mint
5 mint
15 mint
Release Notes
New Version!more Powerful
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.