OPEN-SOURCE SCRIPT
מעודכן CNagda Anchor2Entry

CNagda Anchor2Entry Pine Script v6 overlay indicator pulls higher-timeframe (HTF) signal events to define anchor high/low levels and then projects visual entry labels on the lower-timeframe (LTF). It also draws auto-oriented Fibonacci retracement/extension levels for context, but it does not execute orders, stops, or targets—only visual guidance.
Inputs
Key inputs include Lookback Length for HTF scanning and a Signal Timeframe used with request.security to import HTF events onto the active chart.

Entry behavior can be set to “Confirm only” or “Wait candle,” trade side can be restricted to Buy/Sell/Both, and individual strategies (Buy WAIT/S1; Sell REV/S1/S2/S3) can be toggled.
HTF logic
The script defines WAIT/BUY setup and confirmation, SELL reversal on breaking the WAIT BUY low, and several volume/candle-based patterns (Sell S1/S2/S3, Buy S1).

It captures the associated highs/lows at those events with ta.valuewhen and imports them via request.security to form anchors (anc_hi/anc_lo) and “new trigger” booleans that gate label creation on the LTF.
Flip entries
When enabled, “Flip entries” generate contrarian labels based on breaking or confirming HTF anchors: crossing above anc_hi can trigger a flip-to-sell label, and crossing below anc_lo can trigger a flip-to-buy label.

The flip mode supports Immediate (on cross) or Confirm (on sustained break) to control how strict the trigger is.
Fibonacci drawing
User-specified Fib levels are parsed from a string, safely converted to floats, and drawn as dotted horizontal lines only when they fall inside an approximate visible viewport. Orientation (up or down) is decided automatically from pending signal direction and a simple context score (candle bias, trend, and price vs. mid), with efficient redraw/clear guards to avoid clutter.


Dynamic anchors
If HTF anchors are missing or too far from current price (checked with an ATR-based threshold), the script falls back to local swing highs/lows to keep the reference range relevant. This dynamic switch helps Fib levels and labels remain close to current market structure without manual intervention.
Signal labels
Labels are created only on confirmed bars to avoid repainting noise, with one “latest” label kept by deleting the previous one. The script places BUY/SELL labels for WAIT/CONFIRM, direct HTF patterns (Buy S1, Sell S1/S2/S3), and contrarian flip events, offset slightly from highs/lows with clear coloring and configurable sizes.
Visual context
Bars are softly colored (lime tint for bullish, orange tint for bearish) for quick context, and everything renders as an overlay on the price chart. Fib labels include a Δ readout (distance from current close), and line extension length, label sizes, and viewport padding are adjustable.
How to use
Set the Signal Timeframe and Lookback Length to establish which HTF structures and ranges will drive the anchors and entry conditions. Choose entry flow (Wait vs Confirm), enable Flip if contrarian triggers are desired, select the trade side, toggle strategies, and customize Fibonacci levels plus dynamic-anchor fallback for practical on-chart guidance.
Notes
This is a visual decision-support tool; it does not place trades, stops, or targets and should be validated on charts before live use. It is written for Pine Script v6 and relies heavily on request.security for HTF-to-LTF transfer of signals and anchors.
Inputs
Key inputs include Lookback Length for HTF scanning and a Signal Timeframe used with request.security to import HTF events onto the active chart.
Entry behavior can be set to “Confirm only” or “Wait candle,” trade side can be restricted to Buy/Sell/Both, and individual strategies (Buy WAIT/S1; Sell REV/S1/S2/S3) can be toggled.
HTF logic
The script defines WAIT/BUY setup and confirmation, SELL reversal on breaking the WAIT BUY low, and several volume/candle-based patterns (Sell S1/S2/S3, Buy S1).
It captures the associated highs/lows at those events with ta.valuewhen and imports them via request.security to form anchors (anc_hi/anc_lo) and “new trigger” booleans that gate label creation on the LTF.
Flip entries
When enabled, “Flip entries” generate contrarian labels based on breaking or confirming HTF anchors: crossing above anc_hi can trigger a flip-to-sell label, and crossing below anc_lo can trigger a flip-to-buy label.
The flip mode supports Immediate (on cross) or Confirm (on sustained break) to control how strict the trigger is.
Fibonacci drawing
User-specified Fib levels are parsed from a string, safely converted to floats, and drawn as dotted horizontal lines only when they fall inside an approximate visible viewport. Orientation (up or down) is decided automatically from pending signal direction and a simple context score (candle bias, trend, and price vs. mid), with efficient redraw/clear guards to avoid clutter.
Dynamic anchors
If HTF anchors are missing or too far from current price (checked with an ATR-based threshold), the script falls back to local swing highs/lows to keep the reference range relevant. This dynamic switch helps Fib levels and labels remain close to current market structure without manual intervention.
Signal labels
Labels are created only on confirmed bars to avoid repainting noise, with one “latest” label kept by deleting the previous one. The script places BUY/SELL labels for WAIT/CONFIRM, direct HTF patterns (Buy S1, Sell S1/S2/S3), and contrarian flip events, offset slightly from highs/lows with clear coloring and configurable sizes.
Visual context
Bars are softly colored (lime tint for bullish, orange tint for bearish) for quick context, and everything renders as an overlay on the price chart. Fib labels include a Δ readout (distance from current close), and line extension length, label sizes, and viewport padding are adjustable.
How to use
Set the Signal Timeframe and Lookback Length to establish which HTF structures and ranges will drive the anchors and entry conditions. Choose entry flow (Wait vs Confirm), enable Flip if contrarian triggers are desired, select the trade side, toggle strategies, and customize Fibonacci levels plus dynamic-anchor fallback for practical on-chart guidance.
Notes
This is a visual decision-support tool; it does not place trades, stops, or targets and should be validated on charts before live use. It is written for Pine Script v6 and relies heavily on request.security for HTF-to-LTF transfer of signals and anchors.
הערות שחרור
Add Some New Improvementהערות שחרור
Trendline Logic - Introduction and UsageTrendline Logic automatically identifies support and resistance trendlines on your chart and detects breakouts.
How it Works:
The indicator detects pivot points called Higher Lows and Lower Highs.
It connects these pivots to draw support (in green) and resistance (in red) trendlines on the chart.
These trendlines extend to the right (extend.right), meaning they are visible forward on the chart.
It notes when the price candle’s wick actually touches the trendline.
A breakout is considered valid only when at least 50% of the candle's body crosses to the other side of the trendline.
Once a breakout occurs, that trendline is automatically removed, and the indicator will create new trendlines based on new pivots.
Using this indicator, traders receive clear and accurate trendline breakout signals, helping in making better and easier trading decisions.
הערות שחרור
Added - Liquidate Area ZoneWhenever you are taking trendline based trades or trading with other logic and are unable to select your partial TP, this indicator is for that. I draw EMA + High Volume based liquidity zone line with color change, so you will be able to easily select the right trade or direction.
I have given you an example of this above.
הערות שחרור
🔥 Breaker Block System in CNagda Indicator - Complete Guide🎯 What are Breaker Blocks in Your Indicator
Your indicator features ICT-style Breaker Block detection - an advanced institutional trading concept that identifies failed Order Blocks that transform into powerful support/resistance zones. This system automatically detects these critical levels without manual analysis.
🌊 Liquidity System in CNagda Indicator - Complete Guide
🎯 What is Liquidity in Your Trading System
Your indicator features an advanced Liquidity Heatmap that visualizes institutional order flow and smart money positioning - giving you the same market insight that professional institutions use to time their entries and exits.
Core Liquidity Concept
Liquidity = Areas where large orders are resting, waiting to be executed. Your system identifies these zones and shows their intensity through visual density, helping you trade with institutional flow rather than against it.
🔧 How Your Liquidity Detection Works
Multi-Source Liquidity Identification
Your system detects liquidity from multiple sources:
Swing High/Low Liquidity
Above swing highs: Buy-side liquidity (retail stops + institutional sells)
Below swing lows: Sell-side liquidity (retail stops + institutional buys)
Touch tracking: Monitors how many times price tests these levels
Round Number Liquidity
Psychological levels: 100, 200, 500, 1000 etc. (customizable steps)
Institutional clustering: Big orders naturally cluster at round numbers
Multi-timeframe significance: Works across different timeframes
Volume-Weighted Liquidity
High volume zones: Where significant trading occurred
Volume + touch combination: Creates intensity scoring system
Time decay: Recent liquidity gets higher priority
Dynamic Intensity Calculation
Your system uses sophisticated scoring to rank liquidity zones:
Touch Weight: Number of times price interacted with level (default: 2.0x multiplier)
Volume Weight: Amount of volume at each level (default: 1.0x multiplier)
Time Decay: Reduces intensity over time (default: 0.95 per bar)
Final Score: (touches × touch_weight) + (volume × volume_weight) × time_decay
💡 Visual Liquidity Representation
Color-Coded Intensity System
Your heatmap uses dynamic coloring to show liquidity strength:
🔵 High Intensity (15+ score): Dark blue with thick lines - Major institutional interest
🟡 Medium Intensity (8-15 score): Orange zones - Moderate liquidity pools
🟣 Low Intensity (3-8 score): Purple areas - Minor liquidity zones
⚫ Very Low (<3 score): Gray - Minimal liquidity
Multi-Element Visualization
Background Zones: Transparent colored areas showing liquidity intensity
Horizontal Lines: Thickness varies with intensity (1-4 pixels wide)
Labels: Show exact intensity scores and touch counts
Line Styles: Solid for swing-based, dashed for round numbers
🎯 Trading Applications
Entry Enhancement with Main Strategies
Combine liquidity analysis with your S0-S3 signals:
High-Probability BUY Setups:
Your WAIT/BUY signal + High intensity support liquidity = Institutional-backed long
S1 pattern near major liquidity support = Smart money alignment
High-Probability SELL Setups:
Your REV/SELL signal + Heavy resistance liquidity = Institutional distribution zone
S2/S3 breakdown with liquidity below = Institutional accumulation target
Liquidity-Based Trade Management
Stop Loss Placement:
Beyond major liquidity levels: Don't place stops where institutions expect them
Use liquidity voids: Place stops in areas with minimal liquidity intensity
Target Selection:
Next liquidity pool: Target areas where institutions need to execute
Intensity-based targets: Higher intensity = stronger target magnetism
Partial profits: Take partials at medium intensity levels
Entry Timing:
Wait for liquidity interaction: Don't chase, wait for price to reach liquidity zones
Volume confirmation: Enter when volume spikes occur at high-intensity levels
Rejection patterns: Watch for institutional rejection at major liquidity levels
⚡ Advanced Liquidity Concepts
Buy-Side vs Sell-Side Liquidity
🟢 Buy-Side Liquidity (Above highs):
Retail stop losses from short positions
Institutional sell orders waiting to execute
Target for bearish moves: Price moves up to collect this liquidity then reverses down
🔴 Sell-Side Liquidity (Below lows):
Retail stop losses from long positions
Institutional buy orders accumulating
Target for bullish moves: Price moves down to collect this liquidity then reverses up
Liquidity Sweeps in Your System
Your system helps identify when institutional liquidity sweeps occur:
Quick spikes into high-intensity zones followed by reversal
Volume confirmation during sweep execution
Return to origin: Price often returns to pre-sweep levels after collection
Internal vs External Liquidity
External: Liquidity outside current trading range (your swing-based detection)
Internal: Liquidity within range (your round number and volume-based detection)
Strategic importance: External for trend changes, internal for range trading
🔥 Real Market Benefits
Institutional Alignment
Trade with smart money: Enter when institutions are likely entering
Avoid liquidity traps: Don't get caught in retail stop-hunting moves
Professional timing: Enter at levels institutions care about
Risk Reduction
Better stop placement: Avoid obvious liquidity clusters where stops get hunted
Trend confirmation: High liquidity in direction confirms institutional backing
False breakout protection: Understand when moves are just liquidity collection
Profit Optimization
Precise targets: Aim for next significant liquidity pools
Scaling strategies: Reduce size as you approach high-intensity resistance
Market timing: Wait for institutional liquidity interaction before acting
Your Liquidity Heatmap transforms abstract concepts like "support and resistance" into quantified institutional order flow analysis, giving you the same market insight that professional trading desks use to consistently profit from retail trader positioning.
🌊 Liquidity Dashboard (Position: Top-Right)
What It Shows
A live table displaying the most important liquidity zones currently active in the market:
Table Structure:
🌊 Liquidity Levels | Intensity | Touches
─────────────────────────────────────────
50,234.50 | 18.3 | 7T
49,876.20 | 12.1 | 4T
50,500.00 | 9.8 | 3T
49,650.75 | 6.4 | 2T
50,000.00 | 15.2 | 8T
Color-Coded Intelligence:
🟢 Green (15+ intensity): Major institutional liquidity - high priority levels
🟡 Orange (8-15 intensity): Moderate institutional interest - watch levels
⚫ Gray (<8 intensity): Minor liquidity pools - reference levels
הערות שחרור
added -- alert conditionהערות שחרור
minor changes - code and logic improvementסקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.