OPEN-SOURCE SCRIPT
Updated MACD MTF Lines

The indicator shows the MACD histogram sign (positive or negative) for several timeframes at once. You can see at a glance how the price is trending across higher and lower timeframes.
The code uses recursive calculations for the SMA and EMA to avoid lookahead errors and repainting on higher timeframes.
Note that, for lower timeframes, the line becomes yellow to the left because history is limited and there are not enough bars to calculate.
The code uses recursive calculations for the SMA and EMA to avoid lookahead errors and repainting on higher timeframes.
Note that, for lower timeframes, the line becomes yellow to the left because history is limited and there are not enough bars to calculate.
Release Notes
The indicator was updated to show the maximum number of lines supported.Release Notes
Each line can be enabled or disabled individually, so that unused ones can be hidden.Release Notes
Added simple trend detection based on the number of bullish and bearish timeframes; threshold can be changed in Settings.Added data outputs:
* "Score": counting the net number of bullish and bearish timeframes
* "Trend": changes to bullish or bearish as the score goes over or under the threshold
Added background color (green or red according to trend); can be enabled in Settings.
Added alert for trend change.
Fix: named individual timeframe outputs.
Release Notes
Added another alert with a separate threshold score for flexibility.Release Notes
Fix: minimum values set to 1.Release Notes
Added score weights for further customization of trend detection and alerts. Input parameters are now set in terms of score values instead of number of lines.Release Notes
Release notes:Added input options to choose alert modes for trend and extra alerts. The options are:
* once per bar close (default)
* once per bar
* every time
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.