OPEN-SOURCE SCRIPT

Local Levels (Cascade + Filters)

217
Script Name: Local Levels (Cascade + Filters)

Short Description (for publication):

Local Levels is a powerful tool for visually identifying horizontal support and resistance levels (shelves) based on local swing highs and lows. The script automatically detects "cascades" of levels (as seen in the screenshot) and allows you to filter them by age and volume.

It is ideal for scalping and intraday trading, helping you quickly identify key zones where price might bounce or break out. The script includes built-in filters to weed out weak and "noisy" levels, as well as flexible signal settings for alerts.

List of Settings and Their Functions:

1. Structure Settings (Level Detection):

Pivot Strength (Bars Left) — Determines how many bars to the left are required to confirm a local extreme (the higher the value, the stronger the level).

Low Confirmation (Bars Right) — How many bars must pass after the pivot forms for the level to be considered confirmed.

Cascade History Depth (Max 60) — The maximum number of levels displayed on the chart at once.

2. Age Filter (Alert Filter):

Line Age Filter (From X and above) — Allows you to ignore "fresh" levels. You can set a threshold (e.g., 50+, 100+) to only receive signals on levels that have been around long enough and tested by time.

3. Volume Filter (Volume Filter):

Enable Volume Filter — Activates level filtering based on trading volume.

Volume Threshold (x Average) — Keeps only those levels where the volume at the formation bar was higher than the average by the specified multiplier. This filters out "empty" levels.

4. Signal Selection (Alert Management):

Signal on Break of GREEN levels — Enables/disables signals and labels (✕) when the price breaks below support levels.

Signal on Break of RED levels — Enables/disables signals and labels (✕) when the price breaks above resistance levels.

Strict Close Beyond Level (By Close) — If ON: the signal triggers only when the candle closes beyond the level. If OFF: the signal triggers on a simple touch of the level by the price (more sensitive).

5. Offset & Visibility (Visuals):

Shift All Lines Up (in %) — Moves all lines vertically up by a specified percentage. Useful when levels overlap the price.

Show GREEN levels / Show RED levels — Toggles the display of the corresponding lines on the chart. If turned off, the script will stop drawing and looking for those levels.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน