OPEN-SOURCE SCRIPT
4H S/R indicator by [GANG BANG CLOSED TRADING COMMUNITY]

What it does
Plots support and resistance zones derived from confirmed 4H pivots, combined with a psychological round-number grid ($100 / $50 / $25). Zones where both align are highlighted with an orange border — these are the strongest levels on the chart.
How it works
Confirmed 4H swing highs and lows are detected, then clustered: pivots closer than 0.5×ATR merge into a single zone, and the touch counter increments. Zone width is ±0.25×ATR, so zones widen in volatile markets and tighten in quiet ones.
Each zone carries a relevance score: touches (max +5), FLIP +2 (the zone acted as both support and resistance), round number inside +2 (+3 for a round hundred), fresh flip +3, minus 1 per 100 untouched 4H bars, minus 4 for a displacement break with no retest. Only the three highest-scoring zones on each side of price are drawn, which keeps the chart readable.
A break is registered only on a 4H close beyond the zone edge plus a 0.25×ATR buffer — wicks through a zone count as sweeps, not breaks. Zones that price cuts through three times in rapid succession without reacting are removed; zones with 3+ touches or a FLIP history are never deleted, only penalised.
How to use
This is a context tool, not an entry signal. It shows where a move has a reason to stall — combine it with your own entry method. Four alerts are available: support test, resistance test, zone with round number, and first retest after a role flip.
Labels
S — support (below price), R — resistance (above price), ×N — number of touches, FLIP — zone worked both ways, FRESH — role just changed, awaiting first retest, RN$ — round number inside the zone.
Notes and limitations
Zones appear only after a pivot is confirmed (about 6 4H bars), so there is a deliberate delay — in exchange, nothing repaints. Round-number steps are tuned for gold; other instruments need different values. Past level reactions do not guarantee future ones.
Settings (interface is in Russian)
Основные — Main · Круглые числа — Round numbers · Вид — Appearance · Актуальность зон — Zone relevance · Ширина зоны — Zone width · Слияние уровней — Level merging · Показывать зон сверху/снизу — Zones shown per side · Тянуть зоны от места рождения — Extend zones from origin
Plots support and resistance zones derived from confirmed 4H pivots, combined with a psychological round-number grid ($100 / $50 / $25). Zones where both align are highlighted with an orange border — these are the strongest levels on the chart.
How it works
Confirmed 4H swing highs and lows are detected, then clustered: pivots closer than 0.5×ATR merge into a single zone, and the touch counter increments. Zone width is ±0.25×ATR, so zones widen in volatile markets and tighten in quiet ones.
Each zone carries a relevance score: touches (max +5), FLIP +2 (the zone acted as both support and resistance), round number inside +2 (+3 for a round hundred), fresh flip +3, minus 1 per 100 untouched 4H bars, minus 4 for a displacement break with no retest. Only the three highest-scoring zones on each side of price are drawn, which keeps the chart readable.
A break is registered only on a 4H close beyond the zone edge plus a 0.25×ATR buffer — wicks through a zone count as sweeps, not breaks. Zones that price cuts through three times in rapid succession without reacting are removed; zones with 3+ touches or a FLIP history are never deleted, only penalised.
How to use
This is a context tool, not an entry signal. It shows where a move has a reason to stall — combine it with your own entry method. Four alerts are available: support test, resistance test, zone with round number, and first retest after a role flip.
Labels
S — support (below price), R — resistance (above price), ×N — number of touches, FLIP — zone worked both ways, FRESH — role just changed, awaiting first retest, RN$ — round number inside the zone.
Notes and limitations
Zones appear only after a pivot is confirmed (about 6 4H bars), so there is a deliberate delay — in exchange, nothing repaints. Round-number steps are tuned for gold; other instruments need different values. Past level reactions do not guarantee future ones.
Settings (interface is in Russian)
Основные — Main · Круглые числа — Round numbers · Вид — Appearance · Актуальность зон — Zone relevance · Ширина зоны — Zone width · Слияние уровней — Level merging · Показывать зон сверху/снизу — Zones shown per side · Тянуть зоны от места рождения — Extend zones from origin
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.