אינדיקטור Pine Script®
נקודות פיבוט
CPR MTF StatusMulti-timeframe CPR (Central Pivot Range) dashboard that shows the trend bias across 6 standard timeframe pairs all from a single chart.
── TIMEFRAME PAIRS ──
Each row pairs a chart timeframe with its natural CPR anchor:
5m → 1H CPR
15m → 4H CPR
1H → Daily CPR
4H → Weekly CPR
D → Monthly CPR
W → Yearly CPR
── HOW STATUS IS DETERMINED ──
For each pair, the indicator computes the previous-period CPR and the current developing CPR, then compares their position:
▲▲ Strong Bull — developing CPR entirely above previous CPR (no overlap)
▲ Light Bull — bands overlap, but developing pivot is above previous pivot
— Neutral — pivots are equal
▼ Light Bear — bands overlap, but developing pivot is below previous pivot
▼▼ Strong Bear — developing CPR entirely below previous CPR (no overlap)
The previous CPR uses non-repainting data (prior completed period). The developing CPR repaints to reflect the current state — this is intentional for a live dashboard.
── TIMEFRAME VALIDITY ──
CPR calculations require the anchor timeframe to be strictly higher than the chart timeframe. When you're on a higher TF chart (e.g. Daily), lower anchor pairs (1H, 4H) cannot compute correctly because request.security can't aggregate full-period HLC from a lower timeframe.
The indicator automatically detects this and either hides invalid rows (default) or dims them with "n/a". A hint row appears when rows have been hidden, suggesting you switch to a lower chart timeframe to see all pairs.
── DISPLAY MODES ──
Full Mode (default):
Vertical table with Chart TF, CPR TF, and color-coded Status columns. Optionally shows previous and developing pivot values. The row matching your current chart timeframe is highlighted.
Compact Mode:
Single horizontal row of coloured cells — just the CPR label and a status arrow (e.g. "D▲▲"). Hover any cell for full detail. An optional summary cell at the end shows the net score.
── FEATURES ──
• Toggle individual timeframe rows on/off
• Customizable 5-level color scheme (strong/light bull/bear + neutral)
• Optional pivot value columns (prev + developing)
• Summary row with bull/neutral/bear count and tinted background
• Current chart TF row auto-highlighting
• Status line showing bull/bear TF counts
• Alerts: all 6 bullish, all 6 bearish, 5+ bullish, 5+ bearish
• Table position and text size settings
• Works on any symbol
── USAGE TIPS ──
• Best used on lower timeframe charts (5m or 15m) to see the most rows
• Pairs well with the Vector CPR Bands indicator for full CPR + band analysis
• When all or most timeframes align in one direction, it signals strong multi-timeframe confluence
אינדיקטור Pine Script®
Reverse ZigZagReverse ZigZag
A reimagined ZigZag indicator that processes price data from the most recent bar backwards, solving the biggest frustration with traditional ZigZag implementations: the inaccurate last leg.
━━━━━━━━━━━━━━━━━━━━━━━━
THE PROBLEM
Standard ZigZag indicators process bars left-to-right. This means the last leg is always "tentative" — it often anchors to the current bar instead of the actual swing extreme. If the true low was 3 bars ago but price has since bounced, the traditional ZigZag either misses it entirely or draws to the wrong bar. This makes the indicator unreliable precisely where it matters most: at the current price action.
THE SOLUTION
This indicator flips the logic. Instead of walking forward through history, it starts at the most recent bar and walks backwards. The result:
→ The last leg is always accurate — it finds the true extreme first, then works outward
→ No tentative or "pending" pivots — every swing point is drawn to the correct bar
→ No repainting — pivots don't shift around as new bars form
→ Clean, consistent results that match what your eyes see on the chart
━━━━━━━━━━━━━━━━━━━━━━━━
HOW IT WORKS
Phase 1 — Initialization
Starting from the current bar, the indicator walks left until it finds a price range that exceeds the deviation threshold. The more recent extreme becomes the first confirmed pivot.
Phase 2 — Backward Walk
From that first pivot, the algorithm continues left, tracking running highs and lows. When price reverses by more than the deviation %, a pivot is confirmed and the direction flips. This continues across the full lookback window.
Phase 3 — Drawing
Lines and labels are drawn between all confirmed pivots. Labels show the price and the magnitude of each swing move.
━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS
• Deviation % — Minimum reversal required to confirm a new pivot (default: 5%). Lower values capture smaller swings, higher values show only major structure.
• Lookback Bars — How far back to calculate (default: 500). Increase for longer history.
• Show Price Labels — Toggle pivot labels showing price and swing magnitude.
• Line Color / Width — Customize appearance.
• High/Low Pivot Colors — Separate colors for swing highs and lows.
━━━━━━━━━━━━━━━━━━━━━━━━
USE CASES
• Swing traders identifying reversal points and market structure
• Harmonic pattern recognition where accurate pivot placement is critical
• Elliott Wave analysis requiring precise swing labeling
• Support/resistance identification from confirmed swing levels
• Measuring swing magnitude to gauge momentum shifts
━━━━━━━━━━━━━━━━━━━━━━━━
NOTES
• The indicator recalculates on the last bar, so all drawing happens once per bar update — this is efficient and avoids the overhead of managing state across bars.
• Works on any timeframe and any instrument.
━━━━━━━━━━━━━━━━━━━━━━━━
אינדיקטור Pine Script®
Smart Money: Auto Order Blocks [identityKa]Overview
The Smart Money: Auto Order Blocks is a professional-grade volume and structural mapping tool designed for SMC (Smart Money Concepts) traders. Order Blocks represent areas where large financial institutions have accumulated significant buy or sell positions. Unlike basic pivot indicators that leave cluttered lines on the chart indefinitely, this script introduces a Smart Mitigation Engine that automatically tracks the validity of these institutional zones in real-time.
Core Mechanics & Detection
The algorithm uses pivot sensitivity to locate origin points of major market imbalances:
Bearish Order Blocks (Supply): Detected at the absolute high of a structural swing before a major downward move. The box is drawn from the wick's high to the highest candle body in that cluster, encapsulating the entire institutional sell zone.
Bullish Order Blocks (Demand): Detected at the absolute low of a structural swing before a major upward move. The box encapsulates the wick's low up to the lowest candle body.
The Smart Mitigation Engine
A fundamental rule of SMC is that once an Order Block is fully pierced and the price closes beyond it, the institutional orders within that zone are considered filled or "Mitigated."
This script constantly monitors the closing price. If a candle strictly closes above a Bearish OB, or strictly below a Bullish OB, the algorithm mathematically invalidates the zone.
Upon mitigation, the box is instantly deleted from the chart, ensuring that only "Fresh" and highly reactive unmitigated zones are visible to the trader. This keeps the workspace incredibly clean.
HUD Dashboard & AI Logic
The on-chart intelligence panel evaluates the proximity of the live price to the active Order Blocks:
Dangerous: Displayed actively whenever the current live price is trading inside the coordinates of an unmitigated Order Block. This serves as a warning that the price is in an institutional high-friction area where sharp rejections and high volatility are imminent.
LONG / SHORT: The engine tracks the macro bias based on the last mitigation event. If a Bearish OB was broken upwards (invalidated resistance), the macro bias shifts to LONG. If a Bullish OB was broken downwards, the bias shifts to SHORT.
How to Use It
This tool provides exceptional context for trade entries. When the AI Suggestion reads "LONG," traders should patiently wait for the price to pull back into a green Bullish OB zone. Once the price enters the zone (triggering the "Dangerous" state), traders can drop to a lower timeframe (e.g., 5-minute) to spot a micro-reversal pattern before executing a trade aligned with the macro trend.
אינדיקטור Pine Script®
Dynamic Trendlines & Breakouts [identityKa]Overview
The Dynamic Trendlines & Breakouts is an automated structural analysis tool designed to remove human subjectivity from drawing trendlines. By utilizing mathematical pivot extremes, the script identifies the dominant market geometry in real-time. More importantly, it incorporates a Smart Volume Filter to distinguish between genuine structural breakouts and low-volume retail traps (fakeouts).
Core Engine Mechanics
The indicator operates on two primary algorithmic pillars:
Dynamic Coordinate Mapping: The script calculates the most recent pivot highs and pivot lows based on a user-defined lookback sensitivity. It then draws precision-extended dashed lines connecting these coordinates, forming dynamic Resistance (Upper Line) and Support (Lower Line) boundaries.
Volume-Confirmed Breakouts: The script continuously monitors the closing price relative to these extended lines. However, a crossover is not enough. If the "Volume Confirmation" feature is active, the engine checks a 20-period Simple Moving Average of the volume. A Bullish "B" (Buy) or Bearish "S" (Sell) label is only printed if the breakout candle is accompanied by above-average institutional volume, significantly increasing the probability of trend continuation.
HUD Dashboard & AI Proximity Logic
The integrated on-chart panel tracks the last confirmed breakout state and utilizes an ATR-based proximity sensor to generate the AI Suggestion:
Dangerous: Displayed actively whenever the current price is within a 0.5 Average True Range (ATR) distance of either the upper or lower trendline. This alerts the trader that the price is actively testing a major structural boundary, making new entries highly risky until a clear bounce or volume-confirmed breakout occurs.
LONG / SHORT: Triggered when the last structural breakout was Bullish (LONG) or Bearish (SHORT), provided the price is safely trending away from the immediate resistance/support lines.
How to Use It
This tool is ideal for momentum and breakout traders. When the price approaches a trendline (AI Suggestion reads "Dangerous"), prepare for a setup. Do not front-run the breakout. Wait for the engine to print the "B" or "S" label, confirming that both the structural level has been breached and the volume supports the move. Once confirmed, trade in the direction of the new momentum.
אינדיקטור Pine Script®
Liquidity Magnet Zones [identityKa]Overview
The Liquidity Magnet Zones is an advanced Smart Money Concepts (SMC) indicator that identifies and manages unmitigated pools of liquidity. Institutional algorithms gravitate toward liquidity to fill large orders. This script mathematically plots these high-probability areas—Buy Side Liquidity (BSL) and Sell Side Liquidity (SSL)—and actively manages them, deleting zones the moment they are "swept" to keep the chart clean and relevant.
Core Mechanics: BSL & SSL Detection
The engine uses pivot point analysis to map market extremes:
Buy Side Liquidity (BSL): Formed at major structural highs. Retail traders typically place stop-losses (buy-to-cover orders) above these highs. The script identifies these unmitigated peaks and draws a dashed line projecting into the future.
Sell Side Liquidity (SSL): Formed at major structural lows. Retail traders place sell-stop orders below these lows. The script tracks these valleys as magnetic targets for price action.
Smart Mitigation (The Sweep Engine)
Unlike static drawing tools, this indicator constantly evaluates the live price against the drawn liquidity zones.
If a candlestick wick or body pierces a BSL or SSL line, the liquidity is considered "Swept" (mitigated).
The script instantly removes the line from the chart, triggering a real-time alert that institutional orders have likely been absorbed, opening the door for a structural reversal.
HUD Dashboard & Post-Sweep AI Logic
The integrated on-chart panel evaluates the structural bias based on the most recent liquidity event:
Dangerous: Displayed actively while the price is piercing and sweeping a liquidity line. This warns traders that extreme volatility is present as stop-losses trigger, making it highly risky to enter breakout trades.
SHORT: Triggered after BSL has been swept. SMC logic dictates that Smart Money forces price upward to trigger buy-stops, providing the necessary liquidity to execute large sell orders. Therefore, the post-sweep bias becomes Bearish (SHORT).
LONG: Triggered after SSL has been swept. Smart Money forces price downward to trigger sell-stops, allowing them to accumulate buy orders. The post-sweep bias becomes Bullish (LONG).
How to Use It
This tool is designed for reversal and mitigation trading, not breakout trading. Do not blindly place limit orders at BSL or SSL lines. Instead, wait for the price to hit the line (AI Suggestion reads "Dangerous"). Drop to a lower timeframe (e.g., 1m or 5m) and look for a Change of Character (CHoCH) confirming that Smart Money is indeed reversing the trend after engineering liquidity.
אינדיקטור Pine Script®
Auto Dynamic S/R Zones Pro [identityKa]Overview
The Auto Dynamic S/R Zones Pro is a structural Price Action utility that automatically identifies, draws, and manages Supply (Resistance) and Demand (Support) liquidity zones. Unlike traditional pivot indicators that draw single horizontal lines, this script constructs volumetric "boxes" to represent areas of historical institutional interest. Furthermore, it incorporates a Smart Mitigation Engine that automatically cleans the chart by deleting zones once they have been functionally broken or fully mitigated by price action.
Core Zone Calculation Methodology
The script utilizes historical pivot detection (ta.pivothigh and ta.pivotlow) based on a user-defined lookback/lookforward sensitivity. Once a structural extreme is found, the engine calculates the boundaries of the zone to capture the entire rejection area rather than just the wick tip:
Resistance Zones (Supply): The top of the box is anchored to the absolute high of the pivot candle. The bottom of the box is calculated using the maximum value between the open and close of that same candle (capturing the wick-to-body spread).
Support Zones (Demand): The bottom of the box is anchored to the absolute low of the pivot candle. The top of the box is calculated using the minimum value between the open and close (capturing the lower wick-to-body spread).
The Smart Mitigation Engine (Chart Cleanup)
To prevent chart clutter and outdated data, the script utilizes dynamic arrays to manage the drawn boxes.
The script continuously monitors the closing price relative to all active zones.
If a candlestick closes strictly above the upper boundary of a Resistance box, or strictly below the lower boundary of a Support box, the zone is mathematically considered "Mitigated" (broken).
Upon mitigation, the script instantly deletes the box and its associated label from the chart history, firing a breakout alert and leaving only fresh, untested zones visible.
HUD Dashboard & AI Logic
The integrated on-chart panel evaluates the immediate relationship between the current price and the active S/R arrays:
Dangerous: Triggered whenever the current closing price is actively printing inside the coordinates of any active Support or Resistance box. This indicates price is in a high-friction decision zone where rejections are highly probable.
LONG / SHORT: The engine tracks the most recent structural breakout. If the last mitigated zone was a Resistance, it adopts a "LONG" bias indicating bullish structure. If the last mitigated zone was a Support, it adopts a "SHORT" bias indicating bearish structure, provided the price is not currently stuck inside another zone.
How to Use It
This indicator simplifies top-down analysis. Traders can use a higher timeframe (e.g., 1H or 4H) to let the script automatically map out major untested supply and demand zones. When the price enters an active zone (triggering the "Dangerous" AI state), traders can drop to a lower timeframe to look for reversal patterns. Alternatively, traders can trade the momentum of the breakouts by setting alerts for when a zone is officially broken/mitigated.
אינדיקטור Pine Script®
Smart Pivot Reversals [identityKa]Overview
The Smart Pivot Reversals is a structural Price Action indicator designed to automatically detect and highlight market swing highs (Tops) and swing lows (Bottoms). Instead of relying on lagging moving averages to find reversals, this script uses raw bar-by-bar analysis to identify local structural extremes. To increase signal reliability, it includes optional, mathematically strict filters for macro-trend alignment and momentum exhaustion.
Underlying Concepts & Calculations
At its core, the indicator utilizes the standard ta.pivothigh and ta.pivotlow functions. The detection mechanism is entirely governed by two user-defined parameters:
Left Bars (Sensitivity): The number of preceding bars that must have a lower high (for a Top) or a higher low (for a Bottom). A smaller number detects micro-swings, while a larger number identifies major structural points.
Right Bars (Confirmation): The number of subsequent bars required to validate the pivot. Note on Visualization: The script uses a negative offset equal to the "Right Bars" value. This means the "TOP" or "BOTTOM" label is plotted exactly on the pivot candle historically, only after the confirmation bars have closed.
Smart Validation Filters (Optional Logic)
To filter out noise in ranging markets, traders can enable two concurrent mathematical filters:
Macro Trend Filter (EMA): When activated, the script calculates a standard Exponential Moving Average (default length 200). A pivot low (Bottom) is only validated if the closing price is strictly above the EMA (identifying pullbacks in an uptrend). A pivot high (Top) is only validated if the closing price is strictly below the EMA.
Momentum Strict Mode (RSI): When activated, the script checks the Relative Strength Index (default length 14) at the exact moment the pivot is confirmed. A Top is only valid if the RSI is in the Overbought zone (≥70). A Bottom is only valid if the RSI is in the Oversold zone (≤30).
HUD Dashboard & State Tracker
The script features a built-in, customizable on-chart panel that aggregates the last confirmed structural pivot and outputs an AI-style state suggestion:
LONG: Triggered and sustained when the last confirmed structure was a valid BOTTOM.
SHORT: Triggered and sustained when the last confirmed structure was a valid TOP.
Dangerous: Displayed during periods of transition or neutral states before a definitive structure is confirmed.
How to Use It
This tool is highly effective for traders utilizing Price Action methodologies, particularly on intraday charts (such as 15-minute or 1-hour timeframes). The printed Top/Bottom labels serve as excellent objective points for drawing support/resistance zones or trendlines. Traders can use the optional EMA and RSI filters to mechanically ignore counter-trend setups and only focus on high-probability reversal structures that align with the broader market context.
אינדיקטור Pine Script®
EdgeGate Premarket Breakout LevelsOverview
EdgeGate™ Premarket Breakout Levels is designed for traders who use a premarket breakout strategy and want a simple way to visualize the key levels that often drive early-session momentum.
The indicator automatically plots:
Premarket High
Premarket Low
Previous New York Session High
Previous New York Session Low
These levels help traders quickly identify potential breakout zones, liquidity areas, and key intraday structure without needing to manually mark sessions each day.
What the Indicator Shows
Premarket High / Low
During the premarket session (default 04:00–09:30 ET), the indicator continuously tracks the session range and plots:
Premarket High
Premarket Low
Once the premarket session closes, these levels become fixed and extend across the trading day.
These levels are commonly used by traders watching for premarket breakout setups after the opening bell.
Previous NY Session High / Low
The indicator also plots the previous regular New York session range (09:30–16:00 ET):
Prev NY High
Prev NY Low
These levels often act as important areas of:
support and resistance
liquidity sweeps
breakout continuation or rejection zones
How Traders Use These Levels
Traders using a premarket breakout strategy typically watch for:
Price consolidating below Premarket High before a breakout
Momentum moves through Premarket Low for downside continuation
Reactions at Previous NY Session High or Low
Liquidity sweeps before trend continuation
This indicator helps keep those reference levels clearly visible throughout the trading session.
Customization
Users can customize:
Premarket session times
Line colors
Line styles (solid, dashed, dotted)
Line thickness
This allows the levels to be styled to match individual chart layouts.
🟣 About EdgeGate™
EdgeGate™ builds tools around one principle:
Structure. Liquidity. Execution.
We focus on developing precision-based session and liquidity frameworks designed for intraday traders who care about context, not clutter.
This is Version 1.0.0 of the EdgeGate™ public toolkit — released free to the TradingView community.
More session tools and execution-focused models coming soon.
🟣 Version
EdgeGate™ Premarket Breakout Levels
Version: 1.0.0
Release Type: Initial Public Release
Status: Stable
Build Philosophy: Clean session structure only
Included in v1.0.0
Premarket High / Low tracking (ET)
Previous NY Session High / Low tracking (ET)
Live Premarket High / Low plotting during premarket
Locked Premarket levels after session close
Previous NY session High / Low displayed on current chart
Customizable line colors, widths, and styles
Session-based level framework designed for premarket breakout traders
🟣 Release Standard (EdgeGate™ Framework)
All EdgeGate™ public tools will follow a structured release format:
Version number
Release type (Major / Minor / Patch)
Documented feature set
Defined behavioral philosophy
Transparent future roadmap
🆓 Open Source
This script is released free and open-source for the community.
You’re welcome to modify, improve, and build upon it respectfully.
⚠️ Disclaimer
For educational purposes only.
Not financial advice.
אינדיקטור Pine Script®
Support and resistance lines - added manually// add support and resistance levels manually (major and minor)
// - plotted as lines
// paste one (or more values, comma delim)
// - major/minor support and resistance
// add a global correction (if required)
// - for ex: useful if using ES or SPX values and needing a correction for SPY equiv
אינדיקטור Pine Script®
Hammer Reversal StructureThe script combines:
Hammer / inverse hammer geometry
Recent support or resistance zone interaction
Sweep-and-reclaim behavior
Optional cluster shelf and prior range context
Volume confirmation
Optional EMA 9 / EMA 20 / VWAP confluence notes
This version is designed to reduce weak textbook-only signals by requiring the candle to form in a more meaningful location on the chart. It supports both Trend and Consolidation modes, includes configurable strictness, and offers debug tools such as candidate labels, gate tables, and plotted structure levels for review and tuning.
Signals shown:
H = Bull Hammer
IH = Bearish Inverse Hammer
Best used as a reversal-context tool, not as a standalone entry system.
אינדיקטור Pine Script®
Pivots Dashboard with Multi Time FramesThis code presents the Pivot Points Chart in a simplified table format by removing the chart lines.
אינדיקטור Pine Script®
trend line [odnac]Overview
This indicator automatically detects swing highs and swing lows, and draws trendlines connecting valid highs to highs and lows to lows. Lines automatically terminate when price breaks through them. Four pivot detection methods are supported.
Trendline Conditions
High Trendline (Descending Resistance): Drawn only when the current swing high is lower than the previous swing high
Low Trendline (Ascending Support): Drawn only when the current swing low is higher than the previous swing low
Wick Breach Filter: If any candle wick (high/low) between two pivot points touches or crosses the trendline, the line is not drawn
Breakout Detection: When the closing price crosses the trendline, the line is terminated at that bar
Pivot Detection Methods (4 modes)
Swing Confirm
Detects highs and lows based on left/right bar count, but only accepts pivot points that pass an additional bearish/bullish confirmation condition. Produces fewer but more reliable swing points with less noise.
Pivot High/Low
Uses raw ta.pivothigh / ta.pivotlow values directly. Any point that is higher or lower than the surrounding N bars on each side is recognized as a pivot.
Williams Fractal
Confirms a pivot when the center bar's high/low is greater or less than N bars on both sides. The default value of 2 produces the classic 5-bar fractal pattern.
Donchian
Uses the highest high and lowest low over N bars as pivot points. A simple and clean channel-based pivot detection method.
Settings
> Trendline Mode : Select pivot detection method
> Swing Left/Right Bars : Number of bars on each side for Swing Confirm mode
> Pivot Left/Right Bars : Number of bars on each side for Pivot High/Low mode
> Fractal Bars : Number of bars on each side for Williams Fractal
> Donchian Length : Lookback period for Donchian mode
> Show Labels : Toggle swing point labels on/off
> Show High/Low Trendlines : Toggle high/low trendlines on/off
> High/Low Line Color : Color of trendlines
Notes
Trendlines are drawn based on confirmed pivot points only, with no repainting
The wick breach filter may result in fewer lines being drawn. This is intentional — only clean, high-confidence trendlines are displayed
Each mode has its own independent parameters, so be sure to adjust settings individually when switching modes
אינדיקטור Pine Script®
Dynamic Support & Resistance [UAlgo]Dynamic Support & Resistance is a pivot driven structure indicator that detects recurring reaction prices and converts them into live support and resistance zones. The script does not treat every pivot as an isolated event. Instead, it groups nearby pivots into shared price areas, counts how many times the market has respected each area, and only promotes a level visually once it reaches the required minimum number of touches.
This creates a cleaner and more practical market structure map. When price reacts again near an existing zone, the level is updated rather than duplicated. As a result, the plotted areas represent repeated interaction and growing structural significance instead of a large collection of disconnected swing points.
Each active level is displayed as a channel centered on the level price. The size of that channel is based on the user selected tolerance percentage, so every level is shown as a reaction zone rather than a single exact line only. A center line and a text label are also added, which makes the structure easier to read in live chart conditions.
The script also includes a clear invalidation model. Support becomes invalid when price closes meaningfully below the zone by more than the selected break threshold. Resistance follows the opposite logic. Once invalidated, the level is removed from the active structure map, which keeps the chart focused on areas that are still relevant.
This makes the indicator useful for traders who want a simple but adaptive framework for mapping horizontal support and resistance. It works well for identifying repeated reaction zones, tracking the growth of structural importance through multiple touches, and recognizing when a level has finally lost validity.
🔹 Features
🔸 Pivot Based Structure Detection
The script starts from confirmed pivot highs and pivot lows. This means support and resistance zones are built from meaningful swing points rather than from arbitrary rolling highs and lows. As a result, the detected levels are more closely aligned with actual market turning areas.
🔸 Level Clustering Instead of Raw Pivot Plotting
A newly detected pivot is not always turned into a brand new level. The script first checks whether that pivot belongs to an existing active zone within the allowed tolerance. If it does, the existing level is updated. If it does not, a new level is created. This prevents unnecessary duplication and keeps the structure map organized.
🔸 Touch Counting and Strength Filtering
Every level tracks how many times price has reacted around it. A zone becomes visually important only after it reaches the required minimum number of touches. This helps filter out weak one time reactions and highlights price areas that have shown repeated acceptance or rejection.
🔸 Adaptive Reaction Zones
Each level is displayed as a channel rather than as a single price only. The channel width is calculated from the level price and the selected tolerance percentage. This makes the plotted area more realistic because support and resistance usually behave as zones rather than exact ticks.
🔸 Dynamic Price Recentering
When a new pivot is assigned to an existing level, the script updates the level price using an average based on the previous stored price and the new pivot. This gradually shifts the zone toward the center of actual reaction activity, which makes the level more representative over time.
🔸 Separate Support and Resistance Maps
Support and resistance are stored independently in their own arrays. This allows the script to manage bullish and bearish reaction zones separately while preserving clean logic for visualization, touch counting, invalidation, and cleanup.
🔸 Live Visual Rendering
Once a level becomes strong enough, the script draws:
a reaction channel,
a center line,
and a label showing the role and price.
This produces a chart friendly display that is easy to interpret during live trading or post analysis.
🔸 Invalidation by Closing Break
Levels are not removed by random intrabar noise alone. Instead, support is invalidated only when closing price moves below the level by more than the selected break percentage, and resistance is invalidated only when closing price moves above it by more than that threshold. This helps reduce premature removals.
🔸 Automatic Cleanup
Broken levels are removed from the active arrays after invalidation. This keeps the script efficient and prevents the internal structure store from filling with irrelevant levels.
🔸 Label Position Refresh
On the last bar, active labels are shifted slightly forward so they remain readable and do not sit directly on top of current candles. This small detail improves chart presentation significantly.
🔹 Calculations
1) Pivot Detection
float ph = ta.pivothigh(high, pivotLen, pivotLen)
float pl = ta.pivotlow(low, pivotLen, pivotLen)
int pIdx = bar_index - pivotLen
if not na(ph)
resistances.processPoint(ph, -1, pIdx)
if not na(pl)
supports.processPoint(pl, 1, pIdx)
This is the starting point of the script.
The code uses ta.pivothigh and ta.pivotlow to detect confirmed swing highs and swing lows. Because pivots are only confirmed after pivotLen bars on both sides, the actual pivot bar is not the current bar. That is why the script calculates:
pIdx = bar_index - pivotLen
This gives the real bar index where the pivot occurred.
Then the pivot is passed into the correct structure map:
pivot highs go into the resistance array,
pivot lows go into the support array.
So at this stage, the script is transforming raw swing points into candidate support or resistance events.
2) Grouping New Pivots Into Existing Levels
method processPoint(array levels, float price, int role, int idx) =>
bool found = false
for in levels
if lvl.active
float tolerance = lvl.price * zonePct
if math.abs(price - lvl.price) <= tolerance
lvl.price := (lvl.price * lvl.count + price) / (lvl.count + 1)
lvl.count += 1
lvl.updateVisuals()
found := true
break
if not found
SRLevel newLvl = SRLevel.new(price, 1, role, true, na, na, na, idx)
levels.push(newLvl)
This method decides whether a new pivot should strengthen an existing level or create a completely new one.
For every active level in the relevant array, the script calculates a tolerance band:
tolerance = lvl.price * zonePct
Then it checks whether the new pivot price is close enough to that level:
math.abs(price - lvl.price) <= tolerance
If the pivot falls inside the allowed zone, the script treats it as another touch of the same structure. It then updates the stored level price using an average weighted by the existing touch count:
lvl.price := (lvl.price * lvl.count + price) / (lvl.count + 1)
This is important. The level does not stay frozen forever. It gradually recenters as more pivots are absorbed into it. At the same time, the touch count increases, which strengthens the zone statistically.
If no active level is close enough, the script creates a fresh support or resistance level with an initial count of one.
So this method is the core clustering engine of the whole indicator.
3) Minimum Touch Logic and Zone Construction
method updateVisuals(SRLevel this) =>
if this.active and this.count >= minStrength
color c = this.role == 1 ? colSup : colRes
float tolerance = this.price * zonePct
float top = this.price + tolerance
float bot = this.price - tolerance
This is the first visual gate.
A level is drawn only if two conditions are true:
the level must still be active,
and its touch count must be greater than or equal to the minimum strength input.
That means weak single touch levels can exist internally, but they are not shown until they prove themselves.
Once the level qualifies, the script calculates the channel boundaries around the center price:
top = this.price + tolerance
bot = this.price - tolerance
So the plotted zone is always centered on the current level price and expands above and below it by the selected tolerance percentage.
This is what turns the raw pivot cluster into an actual support or resistance zone.
4) Drawing the Channel, Center Line, and Label
if na(this.bx)
this.bx := box.new(
left=this.start_idx,
top=top,
right=bar_index,
bottom=bot,
border_color=color.new(c, 0),
border_style=line.style_dotted,
bgcolor=color.new(c, 80),
extend=extend.right
)
else
this.bx.set_top(top)
this.bx.set_bottom(bot)
if na(this.ln)
this.ln := line.new(
x1=this.start_idx,
y1=this.price,
x2=bar_index,
y2=this.price,
color=c,
width=1,
extend=extend.right
)
else
this.ln.set_y1(this.price)
this.ln.set_y2(this.price)
Once a level is strong enough, the script renders its visual structure.
The box represents the full support or resistance channel from the starting pivot index to the current bar, and it is extended to the right so the zone remains visible into future bars.
The line is drawn exactly at the stored level price, which serves as the center of the zone. Because the price can shift slightly over time as new pivots are absorbed, the center line is updated dynamically as well.
So visually, each confirmed level contains:
a shaded reaction area,
a center reference line,
and an ongoing extension into the future.
This gives the user both a zone view and a central price reference at the same time.
5) Text Label Calculation
string txt = str.format("{0} - {1,number,#.##}", this.role == 1 ? "Support" : "Resistance", this.price)
if na(this.lbl)
this.lbl := label.new(
x=bar_index,
y=this.price,
text=txt,
style=label.style_label_left,
color=color.new(color.black, 100),
textcolor=colTxt,
size=size.small
)
else
this.lbl.set_xy(bar_index, this.price)
this.lbl.set_text(txt)
This snippet builds and updates the text label for each visible level.
The label text is generated from the level role and the current averaged level price. So if the level belongs to the bullish structure map, the label shows Support and the current price. If it belongs to the bearish structure map, it shows Resistance and the current price.
The label is then either created or updated at the latest bar.
This means the label always reflects the most current state of the zone instead of staying attached to an outdated price.
6) Invalidation Logic
method checkInvalidation(array levels, float currentPrice) =>
for in levels
if lvl.active
float threshold = lvl.price * breakPct
bool broken = false
if lvl.role == 1
if currentPrice < lvl.price - threshold
broken := true
else
if currentPrice > lvl.price + threshold
broken := true
if broken
lvl.active := false
lvl.updateVisuals()
This method decides when a level should stop being considered valid.
For every active level, the script calculates a break threshold based on the level price and the selected invalidation percentage:
threshold = lvl.price * breakPct
Then it applies directional logic.
For support:
price must close below the level by more than the threshold.
For resistance:
price must close above the level by more than the threshold.
This is important because it means the script does not remove zones on a tiny touch or minor overshoot. A meaningful closing break is required.
When that break happens, the level is marked inactive and its visuals are refreshed so the box, line, and label are deleted.
7) Visual Removal of Broken Levels
else if not this.active
if not na(this.bx)
this.bx.delete()
this.bx := na
if not na(this.ln)
this.ln.delete()
this.ln := na
if not na(this.lbl)
this.lbl.delete()
this.lbl := na
This is the part of updateVisuals that handles invalidated levels.
Once a level is no longer active, the script deletes all visual objects associated with it:
the channel box,
the center line,
and the text label.
This keeps the chart focused on only those support and resistance zones that are still valid. It also prevents broken levels from continuing to influence the user visually after the market has already moved through them.
8) Cleanup of Inactive Objects From Memory
method cleanup(array levels) =>
int n = levels.size()
if n > 0
for i = n - 1 to 0
SRLevel lvl = levels.get(i)
if not lvl.active
levels.remove(i)
Deleting a level visually is only one part of the process. The script also removes inactive levels from the calculation arrays.
This reverse loop is important because removing array elements while looping forward can shift indices and create logic errors. By iterating from the end toward zero, the script safely removes inactive items.
This keeps the internal storage efficient and prevents the structure engine from wasting time checking already broken zones on future bars.
9) Last Bar Label Position Update
if barstate.islast
for lvl in supports
if lvl.active and not na(lvl.lbl)
lvl.lbl.set_x(bar_index + 5)
for lvl in resistances
if lvl.active and not na(lvl.lbl)
lvl.lbl.set_x(bar_index + 5)
This small block improves readability on the chart.
On the last visible bar, the script shifts active labels slightly to the right of the current candle. That creates a cleaner presentation and reduces overlap between labels and price bars.
Although this does not change the structural logic of the indicator, it improves usability in live analysis and makes the levels easier to read at a glance.
10) Full Execution Flow
if not na(ph)
resistances.processPoint(ph, -1, pIdx)
if not na(pl)
supports.processPoint(pl, 1, pIdx)
supports.checkInvalidation(close)
resistances.checkInvalidation(close)
supports.cleanup()
resistances.cleanup()
This compact block summarizes how the script behaves on every bar.
First, it checks whether a new pivot high or pivot low has been confirmed.
Second, it sends that pivot into the correct level array.
Third, it checks whether any active support or resistance has been invalidated by the current closing price.
Finally, it removes inactive levels from memory.
So the script is constantly cycling through four steps:
detect,
cluster,
invalidate,
clean.
That is why the indicator remains dynamic. It is always updating the active structure map as the market evolves.
אינדיקטור Pine Script®
Hour Pivots.This is the Hour pivot indicator. This draws the pivot line from R1 to R5 and from S1 to S5 with a central pivot in the hourly Time frame. And though the chart time frame be chnaged it shows hourly pivots only. Be cautious and don't use blindly. Thanks and Regards
אינדיקטור Pine Script®
Luminous Pivot S&R Matrix [Pineify]Luminous Pivot S&R Matrix — Dynamic Support & Resistance Zones with ATR-Adaptive Width and Breakout Detection
The Luminous Pivot S&R Matrix is a dynamic support and resistance indicator that automatically identifies significant pivot highs and pivot lows, constructs ATR-adaptive zones around them, and monitors each zone in real time for breakout invalidation. Unlike static horizontal line tools that require manual placement, this indicator continuously scans price action for structurally significant turning points using a configurable lookback window, then wraps each pivot in a volatility-scaled zone whose width adapts to current market conditions via the Average True Range (ATR). When price closes beyond a zone's pivot level, the zone is automatically deactivated and visually dimmed, while a breakout signal is plotted — giving traders a fully automated, self-managing support and resistance framework that stays relevant as markets evolve.
Key Features
Automatic pivot detection using a configurable lookback length to identify both major and minor structural turning points in price
ATR-adaptive zone construction that dynamically scales the width of each support and resistance zone based on current market volatility
Real-time zone management with automatic extension of active zones to the current bar and visual invalidation when zones are broken
Breakout detection system that flags bullish breakouts (close above resistance) and bearish breakouts (close below support) with triangle markers and candle coloring
Memory management system that limits the number of displayed zones per side, automatically removing the oldest zones to keep charts clean and readable
Built-in alert conditions for both bullish and bearish breakouts, enabling automated notification workflows
How It Works
The indicator operates through a three-stage pipeline: pivot detection, zone construction, and dynamic zone management.
Stage 1: Pivot Detection
The indicator uses Pine Script's built-in ta.pivothigh() and ta.pivotlow() functions with a user-defined lookback length (default: 15 bars). A pivot high is confirmed when a bar's high is the highest value within the lookback window on both sides. Similarly, a pivot low is confirmed when a bar's low is the lowest value within that same window. Because confirmation requires bars to the right of the pivot, detected pivots are inherently lagged by the lookback length — this is by design, as it ensures only structurally validated turning points are plotted, filtering out noise and false signals.
Stage 2: ATR-Adaptive Zone Construction
Once a pivot is confirmed, the indicator constructs a zone around it. Rather than using a fixed-width band, the zone boundaries are calculated using the 14-period ATR value at the pivot bar, scaled by the user's ATR multiplier (default: 0.8). The zone extends from pivot price + (ATR × multiplier) / 2 to pivot price − (ATR × multiplier) / 2 . This means zones are naturally wider during volatile market conditions and narrower during calm periods, providing contextually appropriate support and resistance bands. A horizontal line is drawn at the exact pivot price, and a semi-transparent box fills the zone area.
Stage 3: Dynamic Zone Management & Breakout Detection
On every bar, the indicator iterates through all active zones. Active zones are extended rightward to the current bar, keeping them visually current. The indicator then checks whether price has closed beyond the zone's pivot level — above for resistance zones, below for support zones. When a breakout occurs, the zone is deactivated (marked inactive), its visual appearance is dimmed to gray with a dashed line style, and a breakout flag is raised. This flag triggers the plotted triangle signal and candle coloring for that bar.
Trading Ideas and Insights
Zone Bounce Entries — When price approaches an active support zone from above, look for bullish reversal candlestick patterns (hammer, engulfing) within the zone for potential long entries. The zone's ATR-based width provides a natural area for price to find buyers, and the wider the zone, the more volatility the market has been experiencing — suggesting a larger potential reaction.
Breakout Continuation Trades — When a bullish breakout signal fires (green triangle), it confirms that price has closed above a resistance pivot. Traders can use this as confirmation to enter long positions, especially when the breakout occurs on above-average volume. The invalidated zone often becomes new support on retests.
Zone Density Analysis — Areas where multiple support or resistance zones cluster together represent stronger structural levels. When several pivots form at similar price levels, the overlapping zones create a high-confluence area that is more likely to hold or produce significant breakouts when finally violated.
Failed Breakout Recognition — If price triggers a breakout signal but quickly reverses back into the zone on the next bar, this suggests a false breakout or stop hunt. Traders can watch for these failed breakouts as potential reversal signals in the opposite direction.
Trend Context — In a strong uptrend, you will observe support zones consistently holding while resistance zones are frequently broken (bullish breakout signals). In a downtrend, the opposite pattern emerges. Tracking the ratio of bullish to bearish breakouts provides a structural view of trend strength.
How Multiple Indicators Work Together
The Luminous Pivot S&R Matrix integrates three complementary analytical techniques into a unified support and resistance system:
Pivot point detection provides the structural price levels, ATR-based zone construction adds volatility context to those levels, and the real-time breakout detection system transforms static levels into dynamic, self-managing trading zones — together forming a complete support and resistance analysis framework.
The pivot detection engine serves as the foundation, identifying bars where price has demonstrably reversed direction. The configurable lookback length allows traders to tune the sensitivity — a shorter lookback (5-10) captures minor swing points suitable for intraday trading, while a longer lookback (15-30) identifies major structural levels appropriate for swing and position trading.
The ATR-adaptive zone construction addresses a fundamental limitation of traditional pivot-based indicators: a single price line rarely captures the full area where supply or demand exists. By expanding each pivot into a zone scaled by the ATR, the indicator acknowledges that support and resistance are areas , not exact prices. The ATR multiplier gives traders control over how much volatility context to incorporate — a lower multiplier (0.3-0.5) creates precision zones for tight stop placement, while a higher multiplier (1.0-1.5) creates wider zones that capture the full range of potential price reaction.
The breakout detection and zone lifecycle management system is what transforms this from a static level-drawing tool into a dynamic analytical framework. By automatically tracking whether each zone remains active or has been invalidated, the indicator eliminates the manual overhead of monitoring multiple levels. The visual differentiation between active zones (solid colored) and broken zones (gray dashed) provides instant context about which levels are still structurally relevant. The memory management system ensures that only the most recent zones remain on the chart, preventing visual clutter that accumulates with traditional pivot indicators.
Unique Aspects
Volatility-adaptive zone width — Unlike fixed-width pivot zones or percentage-based bands, the ATR scaling ensures zones automatically widen during volatile periods and narrow during calm periods, providing contextually appropriate support and resistance areas across all market conditions.
Self-managing zone lifecycle — Zones are not simply drawn and forgotten. Each zone is actively monitored, extended, and eventually invalidated when broken. The visual transition from active (colored, solid) to broken (gray, dashed) creates an intuitive map of which levels remain structurally significant.
Structural pivot validation — By requiring confirmation bars on both sides of a pivot, the indicator only plots levels where price has demonstrably reversed. This eliminates the noise of minor fluctuations and focuses attention on levels where genuine supply or demand has been observed.
Clean chart design with memory management — The configurable zone limit per side prevents the chart from becoming cluttered with historical levels. The oldest zones are automatically removed when new ones form, ensuring the chart always shows only the most relevant current levels.
Dual breakout signaling — Breakouts are communicated through three simultaneous channels: plotted triangle markers, candle color changes, and configurable alert conditions. This multi-channel approach ensures traders never miss a breakout event regardless of how they monitor their charts.
How to Use
Add the Luminous Pivot S&R Matrix to your chart. It overlays directly on the price chart, displaying colored zones at detected pivot levels.
Observe the colored zones — green zones represent support areas (pivot lows), and red zones represent resistance areas (pivot highs). Active zones have solid lines and colored fills; broken zones appear gray with dashed lines.
Watch for breakout signals — a green triangle below a bar indicates price has closed above a resistance zone (bullish breakout), while a red triangle above a bar indicates price has closed below a support zone (bearish breakout). Breakout candles are also colored accordingly.
Use active zones as potential entry areas — look for price reactions (bounces, rejections) when price approaches an active zone. Combine with candlestick patterns or other confirmation tools for higher-probability entries.
Monitor zone invalidation patterns — frequent resistance breakouts suggest bullish momentum, while frequent support breakdowns suggest bearish momentum. This provides a structural view of the prevailing trend.
Set up alerts using the built-in alert conditions ("Bullish Breakout" and "Bearish Breakout") to receive notifications when price breaks through an active zone, even when you are not watching the chart.
Combine with volume indicators, trend filters, or momentum oscillators for additional confirmation before executing trades based on zone reactions or breakout signals.
Customization
Pivot Lookback (default: 15) — Controls how many bars on each side are required to confirm a pivot. Increase for major structural levels suitable for higher timeframes (20-30); decrease for more frequent pivot detection on lower timeframes (5-10).
Zone ATR Multiplier (default: 0.8) — Scales the 14-period ATR to determine zone width. Increase for wider zones that capture more price reaction area (1.0-1.5); decrease for tighter, more precise zones (0.3-0.5).
Max Active Zones per side (default: 5) — Limits how many support and resistance zones are displayed simultaneously. Increase if you want to see more historical context (8-15); decrease for a cleaner chart with only the most recent levels (2-3).
Support / Resistance Colors — Customize the zone and signal colors to match your chart theme or personal preference.
Zone Transparency (default: 85) — Controls the opacity of zone box fills and borders. Lower values make zones more prominent; higher values keep them subtle and non-distracting.
Conclusion
The Luminous Pivot S&R Matrix provides a methodologically rigorous approach to automated support and resistance analysis by combining structural pivot detection with volatility-adaptive zone construction and real-time breakout monitoring. By treating support and resistance as dynamic zones rather than static lines, and by automatically managing the lifecycle of each zone from creation through invalidation, this indicator eliminates the manual overhead of traditional S/R analysis while providing richer contextual information. Whether you are a day trader looking for precise intraday bounce zones, a swing trader identifying key structural levels for position entries, or a position trader monitoring major support and resistance breaks for trend confirmation, the Luminous Pivot S&R Matrix delivers a clean, self-managing, and visually intuitive framework for understanding where the market's key structural boundaries lie — and when they are being broken.
אינדיקטור Pine Script®
Nadaraya-Watson Dynamic Envelopes [identityKa]Welcome to another premium-grade, free-to-use trading tool developed by identityKa.
The Nadaraya-Watson Dynamic Envelopes is a highly advanced, visually smooth overlay indicator designed to capture dynamic support and resistance zones. Instead of relying on traditional, jagged moving averages, this indicator utilizes a Gaussian-inspired smoothing technique (via an optimized ALMA mathematical engine) to wrap the price action in a flowing, highly responsive channel.
Whether you are a day trader looking for mean-reversion setups or a swing trader identifying macro tops and bottoms, this indicator provides crystal-clear visual guidance without cluttering your chart.
🔥 Key Features:
Dynamic Smoothing Engine: Creates non-jagged, flowing upper (resistance) and lower (support) bands that adapt to market volatility.
Mean Reversion Signals: Prints distinct triangle shapes (Red for Bearish, Green for Bullish) when the price action sharply interacts with the outer envelopes, highlighting high-probability reversal zones.
Smart HUD Dashboard: Includes a clean, fully customizable on-chart dashboard that displays the current engine status, price position relative to the midline, and a real-time AI Suggestion (LONG, SHORT, or Dangerous) based on the algorithmic state.
100% Customizable: Every aspect of the indicator, from bandwidth smoothness and multipliers to theme colors (featuring the signature identityKa neon palette) and dashboard positioning, can be adjusted in the settings menu.
💡 How to Trade with It:
Mean Reversion: Look for bullish (green) triangle signals when the price touches or pierces the lower green envelope for potential long entries. Conversely, look for bearish (red) triangle signals at the upper red envelope for short entries.
Trend Continuation: In strong trending markets, the midline (white) often acts as dynamic support/resistance.
Pro Tip: This indicator works best when combined with a primary trend filter (such as our Alpha SuperTrend Signal). Avoid taking reversal signals against a very strong macroeconomic trend unless confirmed by other Price Action concepts.
⚙️ Settings & Alerts:
The script comes with built-in alert conditions for both Support Bounces (Bullish) and Resistance Rejections (Bearish), allowing you to automate your workflow. All settings are globally accessible in English.
Elevate your chart quality. Trade with precision. Trade with identityKa.
אינדיקטור Pine Script®
Liquidity Sweep Rider Institutional HFT Grabber Liquidity Sweep Rider Strategy (Swing Pivot + Volume Filter)
Publication Description:
This is an open-source Pine Script v6 strategy that identifies potential liquidity sweep patterns around confirmed swing highs and lows.
It uses:
Pivot points (ta.pivothigh / ta.pivotlow) to mark historical swing levels where orders (such as stops or pending entries) often cluster.
A volume filter requiring above-average volume (SMA-based with multiplier) on the sweep candle to highlight stronger moves.
Classic sweep logic: price wicks beyond the level but closes back inside, suggesting a possible reversal after liquidity is taken.
Entry rules:
Long: after a downside sweep below a recent swing low (with volume condition).
Short: after an upside sweep above a recent swing high (with volume condition).
Features include:
Optional toggles to enable/disable long/short directions.
ATR-based stop-loss and take-profit (configurable multipliers and risk-reward ratio).
Visual plots for liquidity levels, entry signals, background highlights, and an info table.
Alert conditions for long/short triggers.
Important notes:
This is an educational/example script for backtesting and learning.
Past performance does not indicate future results. Trading involves significant risk of loss — use proper risk management and never risk more than you can afford to lose.
No guarantees of profitability are made. Always test thoroughly on demo accounts before live use.
Customize parameters (pivot lengths, volume multiplier, ATR settings) based on the instrument and timeframe you trade. Works on various markets/timeframes but performs differently depending on liquidity and volatility.
Feel free to fork/modify the code. Feedback and improvements are welcome!
(≈ 3–4 paragraphs, clear, educational, includes risk disclaimer, explains logic + usage without hype.)
אסטרטגיית Pine Script®
Ram - Fibonacci Pivot PointsFibonacci Pivot Points — Pine Script
Absolutely! Let's build this for TradingView. Here's a clean, professional Pine Script for Fibonacci Pivot Points:Created a file, read a fileCreated a file, read a fileFibonacci Pivot Points Pine Script for TradingViewfib_pivot_points.pinePresented fileDoneHere's a breakdown of what this script does:
📐 How the Levels are Calculated
LevelFormulaFib RatioPP(H + L + C) / 3—R1 / S1PP ± 0.382 × Range38.2%R2 / S2PP ± 0.618 × Range61.8%R3 / S3PP ± 1.000 × Range100%
⚙️ Key Features
Multi-timeframe — switch between Daily, Weekly, 4H, or 1H pivots
Fully customisable — toggle R3/S3, R2/S2, R1/S1 and change colours
Smart labels — show level name + exact price on the right side
Zone highlight — subtle background tint when price is between R1/S1
7 built-in alerts — get notified when price crosses any level
🚀 How to Add to TradingView
Open TradingView → Pine Editor (bottom panel)
Paste the script and click "Add to chart"
Open Settings to choose your pivot timeframe and toggle levels
💡 Trading Tips
PP is your neutral line — bias is bullish above, bearish below
R1/S1 are your first profit targets or reversal zones
R2/S2 are high-probability bounce areas on strong trending days
R3/S3 only reached on high-volatility or news-driven sessions — treat as extreme levels
אינדיקטור Pine Script®
Malaysian SnR Levels [UAlgo]Malaysian SnR Levels is a structure based support and resistance overlay that automatically plots three level types on the chart:
A-Levels, which act as resistance
V-Levels, which act as support
Gap Levels, which mark qualifying candle to candle price gaps
The script is built for traders who want clean horizontal reference levels that stay active until price decisively crosses through them. Instead of drawing every pivot forever, the indicator manages each level as a stateful object with freshness and activity tracking. A newly created level begins as fresh , becomes unfresh after its first wick interaction, and remains active until price fully crosses through it. Once broken, the level stops extending and is archived on the chart.
A major strength of this implementation is its optional multi timeframe workflow. You can leave the timeframe input empty to detect levels on the current chart, or select a higher timeframe to project higher timeframe A, V, and Gap levels onto a lower timeframe execution chart. This makes the script useful for both local chart structure and top down level mapping.
The result is a practical support and resistance engine focused on:
Pivot based resistance and support
Gap based structural levels
Fresh versus unfresh state tracking
Automatic break detection
Optional MTF level projection
🔹 Features
🔸 1) Automatic A-Levels and V-Levels
The script detects pivot highs and pivot lows and converts them into horizontal support and resistance levels:
A-Levels come from confirmed pivot highs and behave as resistance
V-Levels come from confirmed pivot lows and behave as support
These are built from pivot calculations on close , not on raw high and low extremes, which gives the levels a close based structural character.
🔸 2) Automatic Gap Levels
In addition to pivots, the script detects directional gap style levels when two consecutive candles move in the same direction and the open to prior close gap exceeds a minimum tick distance.
Bullish gap logic creates a gap level at the previous close.
Bearish gap logic also creates a gap level at the previous close.
This gives the indicator a third structural layer beyond classic pivot based support and resistance.
🔸 3) Fresh and Unfresh State Tracking
Every new level starts as fresh . A fresh level is considered untouched. Once price interacts with the level by wick, it becomes unfresh :
The line style changes to dashed
The width becomes thinner
The color shifts to the unfresh color theme
This helps traders quickly distinguish untouched levels from levels that have already been tested.
🔸 4) Active Until Full Break
A level stays active until price crosses through it. Once broken, the level:
Stops extending
Fixes its endpoint at the break time
Keeps the historical line visible
Stops updating as an active level
This is useful because old levels remain visible for review, while current active levels continue projecting forward.
🔸 5) Multi Timeframe Detection (Optional)
The script supports a selectable detection timeframe:
Leave it empty to use the current chart timeframe
Set it to a higher timeframe to project higher timeframe levels onto the current chart
This is especially useful when traders want to execute on a lower timeframe while respecting higher timeframe structure.
🔸 6) Minimum Gap Filter in Ticks
Gap levels are filtered by a configurable minimum distance in ticks. This avoids plotting tiny micro gaps and helps keep only more meaningful dislocations.
🔸 7) Duplicate Level Protection
Before adding a new level, the script checks whether an active level already exists near the same price. If another active level is within a small tick range, the new one is skipped.
This reduces clutter and prevents nearly identical levels from stacking on top of each other.
🔸 8) Separate Visibility Controls
Users can independently choose whether to display:
A-Levels
V-Levels
Gap Levels
This makes the tool adaptable for different workflows, such as only plotting pivot levels or only monitoring gap structure.
🔸 9) Full Visual Customization
The script provides separate color controls for:
Fresh A-Levels
Unfresh A-Levels
Fresh V-Levels
Unfresh V-Levels
Fresh Gap Levels
Unfresh Gap Levels
It also allows customization of:
Fresh line width
Unfresh line width
Label size
This makes it easy to fit the indicator into different chart styles.
🔸 10) Label Projection to the Right
Each active level includes a compact label showing its type:
A
V
Gap
The label is automatically pushed several time steps to the right of current price so it stays readable and aligned with the level.
🔸 11) Automatic Level Count Management
The script keeps the number of stored levels under control using a maximum active limit. When capacity is exceeded, it tries to remove an older inactive level first.
This helps maintain chart cleanliness and stay within TradingView object limits.
🔹 Calculations
1) Pivot Based A-Level and V-Level Detection
The script calculates pivots using close, not high or low:
float ph = ta.pivothigh(close, pivotLength, pivotLength)
float pl = ta.pivotlow(close, pivotLength, pivotLength)
Interpretation:
A-Level = confirmed close based pivot high
V-Level = confirmed close based pivot low
Because pivot confirmation requires bars on both sides, the level time is aligned to the true pivot bar using:
int ph_t = not na(ph) ? time : na
int pl_t = not na(pl) ? time : na
2) Gap Level Detection Logic
The script defines bullish and bearish gap conditions using consecutive candles in the same direction plus a minimum gap size measured in ticks.
Bullish gap:
bool bullishGap = prevBullish and isBullish and (open - close ) >= syminfo.mintick * minGapTicks
Bearish gap:
bool bearishGap = prevBearish and isBearish and (close - open) >= syminfo.mintick * minGapTicks
If either condition is true, the gap level is set at:
gap_price := close
So the reference price for the gap level is the previous candle’s close.
3) Multi Timeframe Data Selection
The script computes levels in a helper function and can either use:
Local chart data directly
Or higher timeframe data through request.security
= request.security(...)
If the timeframe input is empty, local values are used. Otherwise, the security values are used:
float ph = tf == "" ? loc_ph : sec_ph
This gives flexible MTF projection while keeping one consistent logic engine.
4) New Level Event Detection
To prevent the same pivot or gap from being added multiple times, the script checks whether the timestamp of the detected event changed:
bool new_ph = not na(ph_t) and ph_t != nz(ph_t )
bool new_pl = not na(pl_t) and pl_t != nz(pl_t )
bool new_gap = not na(gap_t) and gap_t != nz(gap_t )
This is an important implementation detail because it avoids a common Pine issue where na != na can propagate as na and block reliable detection.
5) Level Creation and Duplicate Protection
Before a new level is added, the script checks existing active levels and rejects duplicates that are too close:
if lvl.isActive and math.abs(lvl.price - p) < syminfo.mintick * 10
exists := true
This means levels within 10 ticks of an existing active level are treated as duplicates and not added.
6) Level Initialization
When a level is created, it starts as:
Fresh = true
Active = true
A line is drawn from the source time and extended to the right:
line.new(st, p, st + timeStep, p, xloc=xloc.bar_time, color=c, width=lineWidthFresh, extend=extend.right)
A label is also created and placed several time steps to the right:
label.new(cur_time + timeStep * 5, p, t, ...)
This keeps the label visually separated from the current candle.
7) Fresh to Unfresh Transition Logic
A level becomes unfresh when price first touches it by wick while the level is still active.
For A-Levels:
touchedWick := h >= this.price
For V-Levels:
touchedWick := l <= this.price
For Gap levels:
touchedWick := h >= this.price and l <= this.price
Once touched:
The level remains active
isFresh becomes false
The line becomes dashed
The width changes to the unfresh width
The line and label colors switch to the unfresh palette
This means a wick touch weakens the level visually, but does not break it.
8) Break / Deactivation Logic
A level becomes inactive only when price crosses through it, not merely when it is touched.
Cross up condition:
bool crossedUp = (o <= this.price and c > this.price) or (c_prev < this.price and c > this.price)
Cross down condition:
bool crossedDown = (o >= this.price and c < this.price) or (c_prev > this.price and c < this.price)
If either is true:
this.isActive := false
this.lvlLine.set_x2(curTime)
this.lvlLine.set_extend(extend.none)
this.lvlLabel.set_x(curTime)
Interpretation:
The level stops projecting and is fixed at the break time.
9) Time Step Handling
The script uses the current bar’s time distance to position and extend labels:
int timeStep = bar_index > 0 ? time - time : 60000
This is important because the script uses xloc.bar_time , so horizontal positioning is time based rather than bar index based.
10) Maximum Level Management
When the array exceeds the user defined maximum, the script tries to remove an inactive level first:
if this.size() > maxLevels
int removeIdx = 0
for i = 0 to this.size() - 1
SnRLevel lvl = this.get(i)
if not lvl.isActive
removeIdx := i
break
Then it deletes that level’s line and label.
Important implementation note:
If no inactive level is found, removeIdx remains 0, so the oldest level in the array is removed.
11) A-Level, V-Level, and Gap Interpretation
In this script:
A-Levels are close based pivot highs and function like resistance
V-Levels are close based pivot lows and function like support
Gap Levels are prior close reference levels from qualifying directional gaps
All three share the same lifecycle framework:
Fresh
Unfresh after wick touch
Inactive after a full cross through
אינדיקטור Pine Script®
Daily Key LevelsThis indicator plots four critical session-open price levels for futures and equities traders, focusing on the specific times when market liquidity and volatility typically shift.
The Levels
18:00 — Futures Session Open: The start of the CME electronic trading session. Often acts as a magnet or pivot for overnight price action.
08:30 — Pre-Market / News: Marks the price at the release of major US economic data (NFP, CPI, etc.). Defines the pre-market range.
09:30 — NYSE Cash Open: Primary reference for the day's directional bias. Frequently retested during the opening hour.
10:00 — Macro Level: Marks the end of opening volatility and the start of the London PM / NY AM trend expansion window.
Technical Implementation
The script uses request.security with 1-minute data to ensure accuracy on all timeframes. This indicator captures the precise opening price from 1m data and projects it forward regardless of the chart timeframe.
Features
Accurate on all timeframes
Automatic daily reset at the 18:00 futures session boundary
Line starts from the exact session candle
Per-level customisation: colour, width and style (Solid / Dashed / Dotted)
Optional time labels on each line
How to Use
Work with your own trading system by helping identifying:
Support / Resistance — Watch for price to react at these levels throughout the session.
Trend Bias — Price holding above the levels could suggest a bullish intraday bias; below is bearish.
אינדיקטור Pine Script®
3AK Inside Bar ScannerThis indicator automatically detects Inside Bar patterns and visually marks them on your chart so you don't have to manually scan for them.
More importantly, you can use this indicator to scan stocks with Inside Bar on tradingview.com/pine-screener/
What is an Inside Bar?
An Inside Bar is a candlestick pattern where the current candle's high is lower and the low is higher than the previous candle. In simple terms, the current candle is completely "hiding inside" the previous one.
This pattern signals a pause or consolidation in the market and is often followed by a strong breakout move. Traders watch for price to break:
- Above the outer bar's high → Bullish signal
- Below the outer bar's low → Bearish signal
---
What does this indicator do?
This indicator **automatically detects Inside Bar patterns** and visually marks them on your chart so you don't have to manually scan for them.
---
Key Features
Multi-Timeframe Support - Scan for Inside Bars on *any timeframe* regardless of what your chart is set to. For example, you can be on a 15-minute chart and still see where a Daily Inside Bar has formed. Especially useful when using the Pine Screener to screen across multiple symbols at once.
Inside Bar Lines -Draws horizontal lines at the **high and low of the outer bar**, giving you clear levels to watch for a breakout or breakdown.
Inside Bar Marker - Places a **triangle marker** below the candle where an Inside Bar is detected. Fully customizable color and size.
Historical Markers - Optionally show markers on **all past Inside Bars** in the chart history so you can study how previous setups played out.
Alerts - Built-in alert condition fires when a **new Inside Bar forms** — so you never miss a setup.
Refer to settings to configure the indicator according to your needs
---
How to use it with Pine Screener
Go to tradingview.com/pine-screener/ . This may be enabled for a paid version of Trading view. Please check if this is enabled for you or not.
Ensure that you have marked this indicator as “ Favorite ”. This is necessary for the indicator to show up in the indicator list of Pine Screener
Select the Watchlist on which you want to use this indicator
Select this indicator from the drop down list. This drop down list shows indicators which are marked as favourite.
Edit settings of this indicator to enable filters and lookback period you want to scan stocks for.
Select option “Scan based on settings” to True
Press Scan button
Disclaimer: This indicator is a screening tool designed to identify potential volatility contraction area. It should not be used as a standalone trading system. Always combine with proper risk management, additional analysis, and your own trading plan.
Please add comments below if you find any issue with the indicator
אינדיקטור Pine Script®
FVG Mitigation Intraday PRO Clean @darshaksscOverview
FVG Mitigation PRO Clean is a price-action indicator designed to identify Fair Value Gap (FVG) structures and highlight structured mitigation events in intraday markets.
The script detects three-candle imbalance gaps and visually marks them as zones on the chart. A signal is generated only when price returns to the zone and meets configurable confirmation conditions.
This indicator uses only raw price data (OHLC). No moving averages, oscillators, volume indicators, or external calculations are used.
How It Works
1) Fair Value Gap Detection
A bullish Fair Value Gap forms when the current candle’s low is above the high two candles back.
A bearish Fair Value Gap forms when the current candle’s high is below the low two candles back.
Minimum gap size filters are applied to reduce minor or insignificant imbalances.
2) Mitigation Logic
After a valid gap forms, the script monitors price interaction with the zone.
A mitigation signal can be generated when:
Price returns into the gap zone
Optional rejection candle conditions are met
Optional midpoint confirmation is satisfied
This structure-based approach helps focus on organized price reactions rather than random volatility.
3) Clean Visual Design
• Option to display only the nearest active zone
• Configurable limit on visible zones
• Automatic expiration of older zones
• Minimal signal labeling
• Movable dashboard (9 position options)
• Adjustable theme (Dark / Light)
The script is optimized to reduce chart clutter while maintaining structural clarity.
Dashboard Information
The movable dashboard displays:
• Current timeframe hint
• Visible zone mode
• Stored zone count
• Nearest active zone midpoint
• Active gap filters
• Confirmation settings
• Last detected mitigation event
Best Use Environment
This indicator is optimized for intraday timeframes such as:
• 5 minute
• 15 minute
• 30 minute
• 1 hour
Market behavior and signal frequency may vary depending on instrument and volatility conditions.
Notes
• This script does not use future bar data.
• Signals are based on completed bar conditions.
• Designed for educational and analytical purposes only.
• Not financial advice.
Users should apply proper risk management and independent analysis.
אינדיקטור Pine Script®






















