//@version=5
strategy("Awesome Oscillator - Eterna MCP",
shorttitle="AO",
overlay=false,
default_qty_type=strategy.percent_of_equity,
default_qty_value=100,
initial_capital=1000)
// ============================================
// PARAMETERS
// ============================================
fastLength = input.int(5, "Fast SMA Length", minval=1)
slowLength = input.int(34, "Slow SMA Length", minval=1)
leverageSize = input.float(5.0, "Leverage", minval=1, maxval=100)
positionSize = input.float(0.01, "Position Size", minval=0.001, maxval=1)
// ============================================
// AWESOME OSCILLATOR CALCULATION
// ============================================
// Median price
medianPrice = (high + low) / 2
// Fast and slow SMAs
fastSMA = ta.sma(medianPrice, fastLength)
slowSMA = ta.sma(medianPrice, slowLength)
// Awesome Oscillator
ao = fastSMA - slowSMA
// ============================================
// SIGNAL GENERATION
// ============================================
// Zero-line cross
bullishZeroCross = ta.crossover(ao, 0)
bearishZeroCross = ta.crossunder(ao, 0)
// Twin Peaks (divergence pattern)
// Bullish Twin Peaks: two lows below zero, second higher than first
twinPeakBullish = ao < 0 and ao > ao[2] and ao[2] < ao[4] and ao > 0[1]
// Bearish Twin Peaks: two highs above zero, second lower than first
twinPeakBearish = ao > 0 and ao < ao[2] and ao[2] > ao[4] and ao < 0[1]
// Saucer pattern (momentum shift)
// Bullish Saucer: three consecutive bars, middle lowest, last green
saucerBullish = ao > 0 and ao < ao[1] and ao[1] < ao[2] and ao > ao[1]
// Bearish Saucer: three consecutive bars, middle highest, last red
saucerBearish = ao < 0 and ao > ao[1] and ao[1] > ao[2] and ao < ao[1]
// Color change (early momentum signal)
aoGreen = ao > ao[1]
aoRed = ao < ao[1]
// Consecutive color bars
consecutiveGreen = aoGreen and aoGreen[1] and ao > 0
consecutiveRed = aoRed and aoRed[1] and ao < 0
// Combined entry signals
buySignal = bullishZeroCross or twinPeakBullish or (saucerBullish and consecutiveGreen)
sellSignal = bearishZeroCross or twinPeakBearish or (saucerBearish and consecutiveRed)
// ============================================
// STRATEGY LOGIC
// ============================================
if buySignal and strategy.position_size == 0
strategy.entry("Long", strategy.long)
alert('{"action":"buy","symbol":"' + syminfo.ticker + '","size":' + str.tostring(positionSize) + ',"leverage":' + str.tostring(leverageSize) + '}', alert.freq_once_per_bar_close)
if sellSignal and strategy.position_size == 0
strategy.entry("Short", strategy.short)
alert('{"action":"sell","symbol":"' + syminfo.ticker + '","size":' + str.tostring(positionSize) + ',"leverage":' + str.tostring(leverageSize) + '}', alert.freq_once_per_bar_close)
// Exit on opposite signal
if sellSignal and strategy.position_size > 0
strategy.close("Long")
if buySignal and strategy.position_size < 0
strategy.close("Short")
// ============================================
// PLOTTING
// ============================================
// Histogram with color coding
aoColor = ao > ao[1] ? color.green : color.red
plot(ao, "Awesome Oscillator", color=aoColor, style=plot.style_histogram, linewidth=3)
// Zero line
hline(0, "Zero Line", color=color.gray, linestyle=hline.style_solid, linewidth=2)
// Signals
plotshape(buySignal, "Buy", shape.triangleup, location.bottom, color.lime, size=size.normal)
plotshape(sellSignal, "Sell", shape.triangledown, location.top, color.red, size=size.normal)
// Pattern markers
plotshape(twinPeakBullish, "Twin Peak Buy", shape.diamond, location.bottom, color.aqua, size=size.small)
plotshape(twinPeakBearish, "Twin Peak Sell", shape.diamond, location.top, color.orange, size=size.small)
plotshape(saucerBullish, "Saucer Buy", shape.circle, location.bottom, color.green, size=size.tiny)
plotshape(saucerBearish, "Saucer Sell", shape.circle, location.top, color.maroon, size=size.tiny)
// Background zone
bgcolor(ao > 0 ? color.new(color.green, 98) : color.new(color.red, 98))
Overview
Awesome Oscillator - Eterna MCP generates long and short entries using three classic signal triggers: zero-line crossovers, twin peaks divergence patterns, and saucer setups backed by consecutive momentum bars. Positions close upon receiving an opposing signal. It plots the AO histogram and signal shapes in a separate pane. By default, there are no take-profit or stop-loss orders, relying entirely on signal reversals.
Awesome Oscillator calculation using median price SMAs
Triple setup detection including zero-line cross, twin peaks, and saucer patterns
Opposite-signal exit logic
Custom JSON alert generation for automated execution
Separate pane histogram with directional color coding
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Fast SMA Length
int
5
fastLength
Slow SMA Length
int
34
slowLength
Leverage
float
5.0
leverageSize
Position Size
float
0.01
positionSize
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
MACD + Divergences [Alorse] is a momentum strategy that calculates the MACD oscillator and identifies regular and hidden divergences using pivot high and low points. It filters trade signals with dual Exponential Moving Averages (EMA 150 and 600) to ensure tra
This overlay strategy combines a Cipher B WaveTrend oscillator with two optional moving averages on the price chart. It exposes WaveTrend channel and average lengths, overbought and oversold levels, buy, sell and gold dots, and regular or hidden divergence mar
Divergenced B004 is a Pine Script strategy that plots on the price chart and looks for divergences in the Squeeze Momentum Indicator. It shorts when a green-section squeeze value falls while price rises, and longs when a red-section squeeze value rises while p
This strategy executes long positions by combining a 200-period EMA trend filter, Stochastic RSI oversold crosses, and Williams Alligator retracements, supplemented by RSI divergence detection. It triggers long entries when the price trades above the 200 EMA w
This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr
8D Run is a Pine Script momentum strategy inspired by Linda Bradford Raschke. It tracks consecutive price closes relative to a 5-period Simple Moving Average (SMA). When price remains above the SMA for 8 or more bars and then dips below it, the strategy enters