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.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。