Pine Script (TradingView)
This is a TradingView Pine Script example for this indicator. Paste it into the TradingView Pine Editor, add it to your chart, and adjust inputs for your market and timeframe.
//@version=6
indicator("Awesome Oscillator", overlay=false)
ao = ta.sma(hl2, 5) - ta.sma(hl2, 34)
rising = ao > ao[1]
plothistogram(ao, "AO", color=rising ? color.green : color.red)
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
longSignal = ta.crossover(ao, 0)
shortSignal = ta.crossunder(ao, 0)
plotshape(longSignal, style=shape.triangleup, location=location.bottom, color=color.green, size=size.small)
plotshape(shortSignal, style=shape.triangledown, location=location.top, color=color.red, size=size.small)