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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。