OPEN-SOURCE SCRIPT

Monthly Levels Pro

660
Monthly Levels Pro — Complete Guide
What It Does
Monthly Levels Pro is a TradingView overlay indicator that automatically plots the high and low of each previous month (and week) as horizontal lines on your chart. The idea is simple but powerful: the high and low of a previous month are significant price levels that traders watch. When price approaches them, they often act as support or resistance. This indicator tracks those levels, shows you how price has interacted with them, and gives you a dashboard showing how far away you currently are from each one.

Core Concepts
Monthly Levels
Every time a new month begins, the indicator saves the previous month's high and low. It stores up to 12 months of history. Each saved month is called a slot — PM1 is the most recent previous month, PM2 is two months ago, and so on up to PM12. The current developing month is called CM — its high and low update in real time as the month progresses.
Weekly Levels
The same concept applies on a weekly basis. PW1 is last week, PW2 is two weeks ago, and so on up to PW4. CW is the current developing week.

How Things Are Calculated
High & Low Tracking
On every bar, the indicator checks whether a new month (or week) has started. When it detects a new month, it saves the previous month's final high and low into arrays, then resets the current month tracker. Within a month, it continuously updates the running high and low using math.max and math.min.
VWAP
Each month and week also tracks a Volume Weighted Average Price. This is calculated by accumulating volume × HLC3 (the average of high, low, and close) and dividing by total volume over the period. This gives a volume-weighted mean price for the entire month or week.
50% Level
The midpoint between each period's high and low. Calculated as (high + low) / 2. Simple but often acts as a magnet for price.
Break Detection
The indicator watches every bar to see if price has crossed through a stored level. You can choose between two modes — wick-based (the default, where any wick through the level counts as a break) or close-based (requires the candle to actually close beyond the level). Each time a level is broken, a counter increments. The break price and time are recorded so a marker can be placed on the chart.
Touch Detection
Separately from breaks, the indicator counts how many times price has touched a level — meaning the wick reached it or exceeded it. A level with many touches but no breaks is considered strong.
Week Detection
New weeks are detected by comparing the day of week between bars. If today's day of week number is less than yesterday's (e.g. Monday after Friday), a new week has begun.

Settings Explained
General

Number of Previous Months — How many past months to draw on the chart. Range is 1 to 12.
Extend Lines to Next Month Only — When ON, lines stop at the start of the next month rather than extending to the right edge of the chart. Useful for keeping things tidy.
Auto-Fade Older Months — Makes older months progressively more transparent so recent levels stand out. PM1 is fully opaque; the oldest visible month fades to whatever the Max Fade % is set to.
Max Fade % — Controls how transparent the oldest month gets when Auto-Fade is ON.

Line Labels

Show Line Labels — Toggles text labels on each line.
Label Position — Where the label sits along the line. Left, Right, Center, or pinned to the current bar.
Bars From Current Bar — Only relevant when Label Position is set to Current Bar. Controls how many bars to the left of the current bar the label appears.
Label Size — Small, Normal, or Large text.
Smart Label Stacking — When two levels are very close in price, their labels would overlap. This setting shifts the lower label down slightly so both remain readable.
Stack Offset Threshold — How close two prices need to be (as a percentage) before the stacking kicks in.

Month Visibility
Individual toggles for CM (current month) and PM1 through PM12. Lets you show or hide specific months without changing the overall count.
Weekly High/Low

Show Weekly Levels — Master toggle for all weekly lines.
Number of Previous Weeks — How many past weeks to draw. 1 to 4.
Show Current Week — Toggles the developing current week's levels.
Extend Weekly Lines to Next Week Only — Same as the monthly equivalent but for weekly lines.
Show Weekly Labels — Toggles text labels on weekly lines.

Line Style & Width
Controls for line thickness (1–4) and style (Solid, Dashed, Dotted) — separately for current month, previous months, current week, previous weeks, 50% lines, and VWAP lines. You can also toggle whether 50% lines and VWAP lines appear at all.
Colors
Individual color pickers for every element — each month slot gets its own color, as do the current month high/low, current week, each previous week slot, 50% lines, VWAP lines, and label backgrounds.
Confluence

Show Confluence Zones — When two or more levels (from different months or weeks) are very close to each other in price, the indicator highlights that area with a colored zone box. Levels that agree across timeframes tend to be stronger.
Confluence Threshold (%) — How close two levels need to be to be considered confluent. At 0.08%, two levels within 0.08% of each other will be highlighted.
Confluence Zone Color — The fill color for the highlighted zone.

Price Scale Labels

Show Price Scale Labels — Plots invisible series that cause TradingView's right-hand price scale to show labeled tick marks at each level, color-coded to match the corresponding month.

Broken Levels

Enable Broken Level Colors — When price has crossed a level, the line color changes to the Broken color (default gray), making it easy to see which levels are still intact.
Require Close for Break — When ON, a level is only considered broken when price closes beyond it, not just wicks through.
Monthly/Weekly Broken Level Color — The color broken lines change to.
Show Break Bar Marker — Places a labeled marker on the chart at the exact bar where each break occurred, showing which level was broken and how many times.
Break Marker Background/Size/Offset — Styling controls for those markers.
Strong Level Min Touches — If a level has been touched this many times without breaking, its line becomes one pixel wider to indicate strength.
Highlight Holding Levels — Levels that have been tested multiple times without breaking get a special color (default gold) and a diamond icon ◆ in their label.
Holding Level Color — The color applied to holding levels.

Distance Dashboard
A table overlay on the chart showing the two nearest levels above and two nearest levels below the current price. For each level it shows the level name, price, distance as a percentage, distance in points, touch count, and break count. Icons indicate whether the level is active (▲▼), broken (⊘), holding (◆), or confluent (★).

Show Distance Dashboard — Master toggle.
Dashboard Position — Corner of the chart where the table appears.
Dashboard Text Size — Small or Normal.
Dashboard Background/Text Color — Appearance controls.
Include Weekly Levels in Dashboard — Whether weekly levels are included in the nearest-level search.

Alerts

Enable Proximity Alerts — Fires an alert when price comes within a set percentage of any level.
Proximity Alert Distance (%) — How close price needs to get to trigger a proximity alert.
Enable Level Crossed Alerts — Fires when price crosses through any level.
Enable Current Month New High/Low Alerts — Fires when the current month sets a new developing high or low.
Enable Reclaim Alerts — Fires when price closes back beyond a level it had previously broken through (a reclaim of a broken level).
Enable Weekly Crossed/Proximity Alerts — Same as the monthly versions but for weekly levels.
Cooldown Mode — Choose whether alert cooldowns are measured in minutes or bars.
Alert Cooldown (Minutes/Bars) — How much time or how many bars must pass before the same alert can fire again, preventing spam.


The Icons and What They Mean
IconMeaning▲ / ▼Level is active (not broken)⊘Level has been broken◆Level is "holding" — tested multiple times without breaking★Level is confluent with another nearby level(Nx)Level has been broken N times

How to Use It Effectively
Start with fewer months. Begin with 3–6 months visible. Too many levels creates clutter. PM1, PM2, and PM3 give you the most relevant recent structure.
Watch PM1 levels first. The most recent previous month's high and low are watched by the most traders and tend to be the most reactive levels on the chart.
Confluence is your strongest signal. When a monthly high lines up within 0.08% of a weekly high, that zone is likely to produce a significant reaction. These are the levels worth planning trades around.
Holding levels with the ◆ icon deserve respect. A level that price has tested multiple times and failed to break is telling you something. These tend to produce sharp rejections when touched again, or explosive moves when they finally do break.
Use the dashboard for quick trade planning. Before entering a trade, glance at the dashboard. It tells you immediately how far you are from the next meaningful level above and below — this helps you assess risk/reward without hunting through the chart manually.
Broken levels can flip. A broken monthly high often becomes support on a pullback (and vice versa for lows). The ⊘ icon makes these easy to spot. Watch for price to return to a broken level — if it holds, that's a potential long setup on a broken high or short setup on a broken low.
VWAP lines add context. The monthly VWAP shows where the average participant in that month is positioned. Price above the VWAP means bulls from that month are profitable on average. Below means they are underwater.
Use Auto-Fade to reduce visual noise. Turning on Auto-Fade keeps recent levels sharp and lets old ones recede into the background. This is especially helpful when showing many months.
Set proximity alerts on key levels. Rather than watching the chart, enable alerts for the closest levels from the dashboard. Set the proximity distance to 0.1–0.2% and let the indicator notify you when price approaches.

Recommended Starting Settings
For most traders on intraday or daily charts, a clean starting point is: 3 previous months, current month ON, 2 previous weeks, current week ON, Auto-Fade ON at 60%, Smart Label Stacking ON, Confluence ON at 0.08%, and the dashboard ON showing weekly levels. From there, adjust colors and line styles to match your chart theme.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.