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
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。