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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.