def RSI8 = RSI(length = 8);
def RSI14 = RSI(length = 14);
def RSI19 = RSI(length = 19);
def MA9 = SimpleMovingAvg(close, 9);
def Up = if (RSI8 > RSI14 and RSI14 > RSI19 and close > MA9) then 1 else 0;
def Dn = if (RSI8 < RSI14 and RSI14 < RSI19 and close < MA9) then 1 else 0;
# Extended Signals (hold signal until opposite condition)
def BongoUp = if Up then 1 else
if Dn then 0 else BongoUp[1];
def BongoDn = if Dn then 1 else
if Up then 0 else BongoDn[1];
declare lower;
plot UpZone = if BongoUp then 1 else 0;
plot DnZone = if BongoDn then 1 else 0;
UpZone.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
UpZone.SetDefaultColor(Color.dark_GREEN);
UpZone.SetLineWeight(5);
UpZone.HideTitle();
UpZone.HideBubble();
DnZone.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
DnZone.SetDefaultColor(Color.dark_RED);
DnZone.SetLineWeight(5);
DnZone.HideTitle();
DnZone.HideBubble();
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(Color.GRAY);
ZeroLine.SetStyle(Curve.SHORT_DASH);
ZeroLine.HideTitle();
ZeroLine.HideBubble();
# Add background cloud effect (optional - can be disabled)
AddCloud(UpZone, 0, Color.DARK_GREEN, Color.CURRENT);
AddCloud(DnZone, 0, Color.DARK_RED, Color.CURRENT);