OPEN-SOURCE SCRIPT

AO + MACD Combined

103
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.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。