OPEN-SOURCE SCRIPT
26 EMA Reversal Logic

This indicator identifies two distinct price behaviours on the daily charts of SPY, SPX, QQQ, or IXIC, using the 26-period EMA as a reference. It plots one signal per downtrend — either a yellow circle (bearish continuation) or a green circle (bullish reversal) — and locks further signals until price closes above the 26 EMA.
The yellow circles are when we close below the 26-day EMA and the next day we make a lower low.
The green circles are when we close below the 26-day EMA and the next day we actually open higher and that low is never revisited.
Symbol Restriction
Only works on: SPY, SPX, QQQ, IXIC
On any other symbol, the script will display an error and stop.
Timeframe Restriction
DAILY chart only — will show an error on any other timeframe.
Core Logic: Two-Candle Pattern Detection
Both signals start with the same Day 1 condition:
Day 1: The candle closes below the 26 EMA
From there, Day 2 determines the signal:
Yellow Circle (Bearish Continuation)
Plotted BELOW the Day 2 candle
Conditions:
Green Circle (Bullish Reversal / Failed Breakdown)
Plotted ABOVE the Day 2 candle
Conditions:
Day 1 closed below the 26 EMA
Day 2 opens higher than Day 1’s close → open > close[1]
Day 2’s low never revisits Day 1’s low → low >= low[1]Interpretation:
Buyers defend the prior low with a higher open — classic false breakdown.
Suggests a potential reversal higher.
One Signal Per Downtrend (Lock & Reset)
After either a yellow or green circle is plotted, no more circles appear
Prevents clutter — focuses on first meaningful reaction
Reset Rule:
Lock is released only when price closes above the 26 EMA
Best Used On
Daily timeframe
SPY, SPX, QQQ, IXIC only
With trend, volume, or broader market context
The yellow circles are when we close below the 26-day EMA and the next day we make a lower low.
The green circles are when we close below the 26-day EMA and the next day we actually open higher and that low is never revisited.
Symbol Restriction
Only works on: SPY, SPX, QQQ, IXIC
On any other symbol, the script will display an error and stop.
Timeframe Restriction
DAILY chart only — will show an error on any other timeframe.
Core Logic: Two-Candle Pattern Detection
Both signals start with the same Day 1 condition:
Day 1: The candle closes below the 26 EMA
From there, Day 2 determines the signal:
Yellow Circle (Bearish Continuation)
Plotted BELOW the Day 2 candle
Conditions:
- Day 1 closed below the 26 EMA
- Day 2 makes a lower low than Day 1’s low → low < low[1]Interpretation:
Price is weakening — pushing to new lows below the EMA.
Confirms downward momentum.
Green Circle (Bullish Reversal / Failed Breakdown)
Plotted ABOVE the Day 2 candle
Conditions:
Day 1 closed below the 26 EMA
Day 2 opens higher than Day 1’s close → open > close[1]
Day 2’s low never revisits Day 1’s low → low >= low[1]Interpretation:
Buyers defend the prior low with a higher open — classic false breakdown.
Suggests a potential reversal higher.
One Signal Per Downtrend (Lock & Reset)
After either a yellow or green circle is plotted, no more circles appear
Prevents clutter — focuses on first meaningful reaction
Reset Rule:
Lock is released only when price closes above the 26 EMA
Best Used On
Daily timeframe
SPY, SPX, QQQ, IXIC only
With trend, volume, or broader market context
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.