OPEN-SOURCE SCRIPT
MJ Automatic Support and Resistance

MJ Automatic Support & Resistance
MJ Automatic Support & Resistance is a chart-based indicator designed to automatically identify and display key support and resistance levels using confirmed pivot highs and pivot lows.
The indicator recalculates based on the active chart timeframe, so the levels automatically update when switching between intraday, daily, or higher timeframes.
Key Features
. Automatically detects support and resistance levels
. Works across all chart timeframes
. Uses confirmed pivot highs and lows
. Separate color controls for support and resistance
. Separate line-thickness controls for support and resistance
. Adjustable pivot sensitivity
. Optional merging of nearby levels
. Adjustable maximum number of displayed levels
. Minimum-touch filter for stronger levels
. Solid, dashed, and dotted line options
. Adjustable line transparency
. Optional price labels
. Optional removal of broken levels
. Adjustable ATR-based breakout confirmation buffer
. Ability to show or hide support and resistance independently
How It Works
Resistance levels are created from confirmed pivot highs, while support levels are created from confirmed pivot lows.
When multiple pivots form near the same price, the indicator can merge them into one level using an ATR-based distance filter. The level price is then averaged as additional touches are detected.
Users can also require a minimum number of touches before a level becomes visible, helping reduce weaker or less-tested levels.
Important Note
Pivot-based levels require future candles to confirm. Because of this, a new support or resistance level will appear only after the selected pivot-strength period has passed.
A higher Pivot Strength generally produces fewer but stronger levels. A lower Pivot Strength produces more levels and reacts faster to short-term price structure.
Suggested Settings
For a balanced chart:
Pivot Strength: 5
Maximum Levels: 30–50
Merge Nearby Levels: Enabled
Merge Distance: 0.20 ATR
Minimum Touches: 1–2
Support Thickness: 2
Resistance Thickness: 2
Lower pivot-strength settings may be more suitable for short-term trading, while higher settings may be better suited for swing trading and higher-timeframe analysis.
Disclaimer
This indicator is intended for technical analysis and educational purposes only. Support and resistance levels are not guaranteed to hold. Traders should combine the indicator with proper risk management, price action, volume, market structure, and other forms of confirmation before making trading decisions
MJ Automatic Support & Resistance is a chart-based indicator designed to automatically identify and display key support and resistance levels using confirmed pivot highs and pivot lows.
The indicator recalculates based on the active chart timeframe, so the levels automatically update when switching between intraday, daily, or higher timeframes.
Key Features
. Automatically detects support and resistance levels
. Works across all chart timeframes
. Uses confirmed pivot highs and lows
. Separate color controls for support and resistance
. Separate line-thickness controls for support and resistance
. Adjustable pivot sensitivity
. Optional merging of nearby levels
. Adjustable maximum number of displayed levels
. Minimum-touch filter for stronger levels
. Solid, dashed, and dotted line options
. Adjustable line transparency
. Optional price labels
. Optional removal of broken levels
. Adjustable ATR-based breakout confirmation buffer
. Ability to show or hide support and resistance independently
How It Works
Resistance levels are created from confirmed pivot highs, while support levels are created from confirmed pivot lows.
When multiple pivots form near the same price, the indicator can merge them into one level using an ATR-based distance filter. The level price is then averaged as additional touches are detected.
Users can also require a minimum number of touches before a level becomes visible, helping reduce weaker or less-tested levels.
Important Note
Pivot-based levels require future candles to confirm. Because of this, a new support or resistance level will appear only after the selected pivot-strength period has passed.
A higher Pivot Strength generally produces fewer but stronger levels. A lower Pivot Strength produces more levels and reacts faster to short-term price structure.
Suggested Settings
For a balanced chart:
Pivot Strength: 5
Maximum Levels: 30–50
Merge Nearby Levels: Enabled
Merge Distance: 0.20 ATR
Minimum Touches: 1–2
Support Thickness: 2
Resistance Thickness: 2
Lower pivot-strength settings may be more suitable for short-term trading, while higher settings may be better suited for swing trading and higher-timeframe analysis.
Disclaimer
This indicator is intended for technical analysis and educational purposes only. Support and resistance levels are not guaranteed to hold. Traders should combine the indicator with proper risk management, price action, volume, market structure, and other forms of confirmation before making trading decisions
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.