OPEN-SOURCE SCRIPT
MACD Triple divergence signals

This script is a basic combination of several scripts that I found very useful. It's a MACD divergence on steroids. Instead of using only one plot as a source for detecting divergence, I use all of the plots.
The idea is that if more divergence signals appear—especially after a prolonged downtrend or uptrend—they can be interpreted as a strong divergence signal.
The third divergence signal is taken from the MACD signal line. It has a longer-term lookback range, which could provide a more reliable divergence signal.
The default minimum lookback range is 15, much greater than the usual value of 5. This makes it more suitable for long-term trading or for lower timeframes (lower than 4H) to reduce noise from excessive signals. For timeframes higher than 4H, the setting can be reduced to around 10 or even 5.
For the 1W (weekly) timeframe, try using a value of 3.
I also added a band to give a clear visual of overbought and oversold areas. It works similarly to Bollinger Bands (BB). You can spot when the price is ranging or when a stop-loss hunt occurs (i.e., the price breaks the band).
Please do your homework—backtest it yourself to find which timeframe suits you best. You can also tweak the settings if you find the default values too aggressive or too mild.
I’ve found that MACD is more reliable on timeframes greater than 1H. Personally, I use it on the 4H and 1D timeframes.
in bahasa:
MACD dengan 3 sinyal divergence, kalau muncul lebih banyak, bisa jadi sinyal lebih menyakinkan.
Minimum lookback range default-nya 15 agar tidak muncul terlalu banyak sinyal. 15 lebih panjang, lebih ok. Kalau main di higher timeframe seperti 1D, bisa 5-10, kalau weeky timeframe = 3.
Untuk band, cek ketika plot-nya keluar dari band, itu bisa jadi jackpot, apalagi kalau plot-nya membentuk double bottom.
Backtest sendiri, siapa tahu kalian bisa dapet setting sendiri.
MACD with upper and lower band will give you a clear visual of price movements

More divergence signals are generated and when the price breaks out of the oversold band = jackpot.





The idea is that if more divergence signals appear—especially after a prolonged downtrend or uptrend—they can be interpreted as a strong divergence signal.
The third divergence signal is taken from the MACD signal line. It has a longer-term lookback range, which could provide a more reliable divergence signal.
The default minimum lookback range is 15, much greater than the usual value of 5. This makes it more suitable for long-term trading or for lower timeframes (lower than 4H) to reduce noise from excessive signals. For timeframes higher than 4H, the setting can be reduced to around 10 or even 5.
For the 1W (weekly) timeframe, try using a value of 3.
I also added a band to give a clear visual of overbought and oversold areas. It works similarly to Bollinger Bands (BB). You can spot when the price is ranging or when a stop-loss hunt occurs (i.e., the price breaks the band).
Please do your homework—backtest it yourself to find which timeframe suits you best. You can also tweak the settings if you find the default values too aggressive or too mild.
I’ve found that MACD is more reliable on timeframes greater than 1H. Personally, I use it on the 4H and 1D timeframes.
in bahasa:
MACD dengan 3 sinyal divergence, kalau muncul lebih banyak, bisa jadi sinyal lebih menyakinkan.
Minimum lookback range default-nya 15 agar tidak muncul terlalu banyak sinyal. 15 lebih panjang, lebih ok. Kalau main di higher timeframe seperti 1D, bisa 5-10, kalau weeky timeframe = 3.
Untuk band, cek ketika plot-nya keluar dari band, itu bisa jadi jackpot, apalagi kalau plot-nya membentuk double bottom.
Backtest sendiri, siapa tahu kalian bisa dapet setting sendiri.
MACD with upper and lower band will give you a clear visual of price movements
More divergence signals are generated and when the price breaks out of the oversold band = jackpot.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。