OPEN-SOURCE SCRIPT
AO + MACD Combined

Awesome Oscillator (AO):
Calculates AO as the difference between 5-period and 34-period SMAs of the hl2 price.
Plots the AO histogram with colors: green (#009688) when increasing, red (#F44336) when decreasing.
Includes alerts for color changes (green/red).
MACD:
Calculates MACD using user-defined fast (12) and slow (26) SMA lengths, with a signal line smoothed over 9 periods.
Plots the MACD line (blue, #2962FF) and Signal line (orange, #FF6D00).
The MACD histogram is replaced by the AO histogram, but alerts for histogram state changes (rising to falling, falling to rising) are based on AO.
Shorttitle:
Set to AO+MACD (7 characters), within the 10-character limit.
Plots:
AO histogram, MACD line, Signal line, and a zero line are plotted in a single pane.
Uses color.new for version 6 compatibility.
Alerts:
AO color change alerts (green/red).
AO histogram state change alerts (rising to falling, falling to rising).
Usage Instructions:
Copy the script into TradingView’s Pine Script editor.
Customize inputs (e.g., MACD fast/slow lengths, signal smoothing) as needed.
Set up alerts in TradingView for AO color changes or histogram state changes.
The indicator displays in one pane, with the AO histogram replacing the MACD histogram, alongside the MACD and Signal lines.
Calculates AO as the difference between 5-period and 34-period SMAs of the hl2 price.
Plots the AO histogram with colors: green (#009688) when increasing, red (#F44336) when decreasing.
Includes alerts for color changes (green/red).
MACD:
Calculates MACD using user-defined fast (12) and slow (26) SMA lengths, with a signal line smoothed over 9 periods.
Plots the MACD line (blue, #2962FF) and Signal line (orange, #FF6D00).
The MACD histogram is replaced by the AO histogram, but alerts for histogram state changes (rising to falling, falling to rising) are based on AO.
Shorttitle:
Set to AO+MACD (7 characters), within the 10-character limit.
Plots:
AO histogram, MACD line, Signal line, and a zero line are plotted in a single pane.
Uses color.new for version 6 compatibility.
Alerts:
AO color change alerts (green/red).
AO histogram state change alerts (rising to falling, falling to rising).
Usage Instructions:
Copy the script into TradingView’s Pine Script editor.
Customize inputs (e.g., MACD fast/slow lengths, signal smoothing) as needed.
Set up alerts in TradingView for AO color changes or histogram state changes.
The indicator displays in one pane, with the AO histogram replacing the MACD histogram, alongside the MACD and Signal lines.
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.