OPEN-SOURCE SCRIPT

Daily Open Close Support & Resistance

266
Plots support and resistance built from the OPENS and CLOSES of recent daily bars — not from pivots. The idea: price areas where the market repeatedly opened or closed tend to act as support and resistance.

HOW IT WORKS
Every daily open and close in the lookback window (default 84 bars ≈ 4 months) is collected and then clustered. Opens/closes that fall within an ATR-scaled band merge into a single level, and the number that merge in becomes that level's strength. Stronger levels draw as heavier, more opaque lines and carry a ×count tag. Because the merge band scales with ATR, it auto-widens on volatile symbols and tightens on calm ones — no fixed dollar tolerance to tune.

AUTO-TIMEFRAME
Apply it on the daily chart and it reads native daily bars. Apply it on any intraday chart (3-min, 5-min, etc.) and it automatically pulls the daily opens/closes, so the same daily levels appear on your execution chart with no timeframe setting to change. The info table shows whether the current source is "native" or "pulled" so you can confirm at a glance.

ALERTS
Five conditions: price touching nearest support, nearest resistance, or any level (within an ATR-scaled tolerance), plus a close breaking through support or resistance. Touch alerts fire once on the transition, not on every following bar.

SETTINGS
Lookback (84 ≈ 4 months, 63 ≈ 3 months), merge distance in ATR, minimum cluster count to display, max levels per side, a near-price window to hide distant levels, touch tolerance, and full styling control. Optional toggles to also include daily highs and lows.

NOTE ON INTRADAY HISTORY
On a sub-daily chart the lookback only reaches as far back as the intraday history your TradingView plan loads, so the level set there may be shorter than on the daily chart. The daily chart always shows the full lookback. This is a chart-data limitation, not a script setting.

Repainting is avoided via lookahead_off and by referencing only completed higher-timeframe bars.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.