OPEN-SOURCE SCRIPT
Support & Resistance + Fibonacci Retracement

📌 Support & Resistance + Fibonacci Retracement
Overview
This indicator automatically detects the highest high and lowest low within a user-defined lookback period and draws clean support and resistance levels directly on your chart. Between these two key levels, it plots the five most widely followed Fibonacci retracement ratios — giving you a complete price structure map at a glance.
No manual drawing needed. Every time a new bar closes, the levels update automatically.
How It Works
The indicator scans back a configurable number of bars (default: 21) to find:
🔴 Resistance — the highest high of the period
🟢 Support — the lowest low of the period
It then divides that range into Fibonacci levels, calculated upward from support to resistance:
LevelDescription
0.236First minor retracement
0.382Common pullback zone
0.500Midpoint equilibrium
0.618Golden ratio — strongest retracement
0.786Deep retracement, last defense
Settings
General Settings
Lookback Period — How many bars back to scan for highs and lows. Higher values = broader structure, lower values = tighter, more reactive levels.
Show Lines — Toggle all drawn lines on or off.
Timeframe — Pull support/resistance data from a higher (or different) timeframe. Leave blank to use the current chart timeframe. Useful for multi-timeframe analysis without switching charts.
Fibonacci Levels
Each of the 5 levels can be individually toggled on/off and colored to match your chart theme.
Label & Appearance
Show or hide level names and price values next to each line.
Fully customizable text color and font size (Tiny → Huge).
Alerts
Two built-in alerts fire automatically:
🔔 Bullish crossover — Price crosses above the 0.236 level
🔔 Bearish crossunder — Price crosses below the 0.618 level
To activate: open the Alerts panel → select this indicator → set your preferred notification method.
How to Use
Trend Analysis
The 0.382 and 0.618 levels are commonly watched by technical analysts as potential reaction zones. How price behaves around these areas — whether it stalls, reverses, or breaks through — may provide context for your own analysis. Always combine with other tools and your personal trading plan.
Multi-Timeframe Analysis
Set the Timeframe input to a higher period (e.g., 1D or 1W) while viewing a lower timeframe chart. This lets you observe where broader structural levels are located without switching views.
Dynamic Lookback
Adjusting the lookback period changes how wide or narrow the detected range is. Shorter periods capture more recent price action; longer periods reflect a broader historical range. Choose a value that fits your analytical approach and the instrument you are studying.
Notes
⚠️ This indicator is for informational and educational purposes only. It does not constitute financial or investment advice. All trading decisions are solely your own responsibility.
Overview
This indicator automatically detects the highest high and lowest low within a user-defined lookback period and draws clean support and resistance levels directly on your chart. Between these two key levels, it plots the five most widely followed Fibonacci retracement ratios — giving you a complete price structure map at a glance.
No manual drawing needed. Every time a new bar closes, the levels update automatically.
How It Works
The indicator scans back a configurable number of bars (default: 21) to find:
🔴 Resistance — the highest high of the period
🟢 Support — the lowest low of the period
It then divides that range into Fibonacci levels, calculated upward from support to resistance:
LevelDescription
0.236First minor retracement
0.382Common pullback zone
0.500Midpoint equilibrium
0.618Golden ratio — strongest retracement
0.786Deep retracement, last defense
Settings
General Settings
Lookback Period — How many bars back to scan for highs and lows. Higher values = broader structure, lower values = tighter, more reactive levels.
Show Lines — Toggle all drawn lines on or off.
Timeframe — Pull support/resistance data from a higher (or different) timeframe. Leave blank to use the current chart timeframe. Useful for multi-timeframe analysis without switching charts.
Fibonacci Levels
Each of the 5 levels can be individually toggled on/off and colored to match your chart theme.
Label & Appearance
Show or hide level names and price values next to each line.
Fully customizable text color and font size (Tiny → Huge).
Alerts
Two built-in alerts fire automatically:
🔔 Bullish crossover — Price crosses above the 0.236 level
🔔 Bearish crossunder — Price crosses below the 0.618 level
To activate: open the Alerts panel → select this indicator → set your preferred notification method.
How to Use
Trend Analysis
The 0.382 and 0.618 levels are commonly watched by technical analysts as potential reaction zones. How price behaves around these areas — whether it stalls, reverses, or breaks through — may provide context for your own analysis. Always combine with other tools and your personal trading plan.
Multi-Timeframe Analysis
Set the Timeframe input to a higher period (e.g., 1D or 1W) while viewing a lower timeframe chart. This lets you observe where broader structural levels are located without switching views.
Dynamic Lookback
Adjusting the lookback period changes how wide or narrow the detected range is. Shorter periods capture more recent price action; longer periods reflect a broader historical range. Choose a value that fits your analytical approach and the instrument you are studying.
Notes
⚠️ This indicator is for informational and educational purposes only. It does not constitute financial or investment advice. All trading decisions are solely your own responsibility.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.