Cập nhật

Dynamic Trend-Based Fibonacci Extension Pro [MarkitTick]

1 978
💡 This advanced technical indicator implements a sophisticated, multi-layered framework for detecting and projecting Trend-Based Fibonacci Extensions through a dynamic lens. Unlike static tools, it automates the identification of high-probability A-B-C price structures across both local and higher timeframes, integrating volatility-adjusted swing detection with rigorous precision filters. It is designed for traders seeking a systematic approach to identifying institutional target zones, wave completion points, and high-quality retest opportunities with built-in risk-to-reward visualization.

This is the professional version of the free indicator Dynamic Trend-Based Fibonacci Extension

✨ Originality and Utility

The Dynamic Trend-Based Fibonacci Extension Pro stands apart from conventional charting tools by moving beyond simple point-and-click placement. Its primary originality lies in its adaptive nature and "state-aware" structure management:

Adaptive Volatility Filtering
Traditional ZigZag and Fibonacci tools often fail during periods of changing volatility. This script utilizes an ATR-based threshold mechanism to dynamically adjust pivot detection sensitivity. This ensures that swing points are confirmed based on the current market environment rather than arbitrary fixed percentages.

Retest Precision Engine
One of the most significant hurdles for traders is identifying when a broken structure remains valid for a retest. This script introduces a logic-gated "Retest Phase" that grays out invalidated structures and re-activates them only when specific high-conviction criteria are met, such as low-volume pullbacks or price rejection candles at Point C.

Higher Timeframe (HTF) Confluence
The indicator provides a dual-layer perspective by projecting HTF Fibonacci levels directly onto the current chart. This allows traders to identify "Nested Structures"—where a local bullish setup aligns with a major HTF extension zone—dramatically increasing the statistical probability of the trade.

Integrated Risk/Reward Visualizer
By calculating entry points at the breakout of Point B and placing stop-losses relative to Point C (with user-defined buffers), the script provides an immediate visual assessment of the trade's viability, including automated R:R ratio calculations.

ảnh chụp nhanh

🔬 Methodology and Concepts

The script operates through a sequential logic pipeline that ensures only structurally sound setups are displayed:

Pivot Point Identification
The core uses a lookback depth algorithm to identify local Highs and Lows. For a point to be considered a "ZigZagPoint," it must represent a significant deviation defined by either a fixed percentage or an ATR multiplier. This eliminates market noise and focuses on structural impulses.

The A-B-C Structural Logic
A bullish structure is defined as a sequence of a Low (A), a High (B), and a Higher-Low (C). Conversely, a bearish structure follows a High (A), a Low (B), and a Lower-High (C). The script validates that Point C has not breached the origin of Point A, ensuring a valid trend impulse exists.

Fibonacci Extension Calculus
Extensions are calculated by measuring the distance between Point A and Point B, then projecting that distance from Point C. The formula used is:
Target = PriceC + ((PriceB - PriceA) * Ratio)
For instruments with extreme price ranges, such as Cryptocurrencies, the script offers a Logarithmic Scale mode, which calculates extensions based on the natural logs of the prices to maintain geometric accuracy.

Validation Filters
  • Trend Filter: Point C must align with the direction of a 200-period EMA.
  • Momentum Filter: Utilizes the RSI to ensure Point C is occurring at an overbought/oversold extreme.
  • Volume Filter: Requires a volume spike at the pivot to confirm institutional participation.
  • Retracement Depth: Ensures the B-C move is between 38.2% and 88.6% of the A-B impulse to prevent shallow or over-extended setups.


🎨 Visual Guide

The visual output is highly organized to maintain chart clarity despite the complexity of the underlying data:

Primary Structure Lines
  • Solid Trendlines: Represent the A-B impulse move.
  • Dashed Trendlines: Represent the B-C retracement move.
  • Color Coding: Bullish structures appear in Emerald Green (#00E676), while Bearish structures appear in Sunset Red (#FF5252).


Fibonacci Extension Levels
  • 1.000 Level (Equality): Displayed as a dotted line, signifying where Wave C equals Wave A.
  • 1.272 Level: Often used as a harmonic reversal or "bull trap" zone.
  • 1.500 & 1.618 (Golden Zone): The area between these two levels is highlighted with a semi-transparent fill. This "Golden Zone" is the primary target for Wave 3 or Wave C extensions.
  • Elliott Wave Labels: Extension levels are automatically tagged with context, such as "Wave 3" or "Harmonic," to assist in wave counting.


Retest and Invalidation Visuals
  • Grayed Out: When price closes beyond Point C, the entire structure turns gray (#555555), indicating it is currently inactive.
  • Orange Retest: If price returns to Point C under normal conditions, the structure turns Orange (#FF9800).
  • Cyan Ideal Retest: If a retest occurs with low volume and a rejection candle (Pin Bar), the structure turns Cyan (#00BCD4), marking a high-probability entry.


Risk/Reward Zones
  • Entry Line: A Blue dashed line at the level of Point B.
  • Stop Loss Zone: A Red transparent box extending from Point C to the SL buffer.
  • Take Profit Zone: A Green transparent box extending to the 1.618 extension level.


Higher Timeframe (HTF) Elements
HTF structures are drawn with thicker lines (width 3) and use distinct colors (Cyan for Bullish, Orange for Bearish) to ensure they are not confused with local timeframe data. Labels are prefixed with "HTF" for immediate identification.

ảnh chụp nhanh

🔍 Deconstruction of the Underlying Scientific and Academic Framework

The indicator is built upon several pillars of quantitative finance and technical theory:

Phidias and the Golden Ratio
The mathematical foundation is rooted in the Fibonacci sequence and the limit of its ratios, approximately 1.618. In financial markets, this ratio is used to model the "growth" of a price impulse, based on the observation that market cycles often expand in proportions found in nature.

Volatility-Adjusted Thresholds (Statistical Deviation)
By using the Average True Range (ATR), the script applies the principles of statistical volatility. Instead of a linear threshold, it uses a non-linear filter that accounts for the standard "noise" of the asset. This is academically linked to the concept of the "Signal-to-Noise Ratio" in time-series analysis.

Volume-Price Agreement (VSA)
The retest logic incorporates elements of Volume Spread Analysis. The requirement for low volume during a retest of Point C is based on the theory that if an impulse is to continue, the counter-trend move should exhibit a lack of supply (in bullish cases) or a lack of demand (in bearish cases).

Logarithmic Growth Models
The inclusion of logarithmic extension calculations recognizes that price action in high-growth assets is often exponential rather than linear. By applying natural logarithms, the script treats price moves as percentage changes, which is the standard for long-term econometric modeling.

📖 How to Use

ảnh chụp nhanh

  1. Setup Detection: Allow the script to identify an A-B-C structure. Wait for the "A-B-C" labels to appear on your chart.
  2. Validation: Check the dashboard in the corner. Ensure the "Scale Mode" and "Detection" methods match your trading style.
  3. Entry Strategy:
    • Aggressive: Enter on the confirmation of Point C if the Volume and RSI filters pass.
    • Conservative: Enter on a breakout of Point B (the Blue Entry Line).
    • Retest: Wait for an "Ideal Retest" label (Cyan). This occurs when price touches Point C and forms a rejection candle on low volume.
  4. Targeting: Use the 1.000 level for initial scaling and the 1.618 "Golden Zone" for final profit-taking.
  5. Risk Management: Place your physical stop-loss at the Red SL line. If the structure grays out, the trade thesis is invalidated.


⚙️ Inputs and Settings

● ZigZag Detection
• Pivot Lookback Depth: Controls how many bars are required to confirm a high or low. Higher values find "major" trends; lower values find "scalping" setups.
• Use ATR-Based Threshold: Toggles between volatility-adjusted or fixed percentage swing detection.

● Retest Precision Filters
• Min Bars After Break: Prevents "instant" retests that are often just price volatility. Requires a gap between the break of C and the return to C.
• Low Volume on Retest: When enabled, the retest must occur on volume lower than the 20-bar average.
• Rejection Candle at C: Requires a Pin Bar or Engulfing candle to trigger an "Ideal Retest" status.

● Momentum & Trend Filters
• Enable RSI Filter: Filters for setups where Point C is at a momentum extreme.
• Enable Trend Baseline Filter: Uses a 200 EMA to ensure you are only trading in the direction of the long-term trend.

● Higher Timeframe
• Select Timeframe: Choose which HTF to pull data from (e.g., Daily for an Hourly chart). This displays the "Big Picture" extensions.

🔓 vs 🔒 Dynamic Trend-Based Fibonacci Extension (Pro vs. Free)

• Object-Oriented Optimization
Object-Oriented Optimization: The Pro version shifts from standard functional programming to advanced Object-Oriented Methods attached to User-Defined Types (UDTs). It also utilizes var-declared, pre-computed global arrays for Fibonacci ratios to drastically reduce per-bar memory allocation and processing overhead.

• Algorithmic Trade Validation
Algorithmic Trade Validation: Introduces institutional-grade confirmation layers, including a Trend Baseline Filter (EMA), RSI Momentum validation, and a Volume Spike identifier, ensuring structures are mathematically validated before generating signals.

• Precision Retest & Retracement Engine
Precision Retest & Retracement Engine: Upgrades basic structural invalidation with strict B-C retracement depth constraints (e.g., 0.382–0.886). It includes a dynamic Retest Engine that classifies pullbacks as "Ideal" or "Normal" using real-time volume analysis and wick-to-range candlestick rejection logic.

• Zero-Repaint MTF Integration
Zero-Repaint MTF Integration: Implements a Higher Timeframe (HTF) algorithmic overlay using strictly compliant request.security calls, anchored with [1] offsets and barmerge.lookahead_on to absolutely prevent repainting.

• Advanced Analytics UI
Advanced Analytics UI: Features a dynamic on-chart Dashboard Table for real-time statistical tracking, an algorithmic Anti-Overlap label engine to prevent visual clutter, and visual Risk/Reward (R:R) mapping for Entry, Stop Loss, and Take Profit zones.

• Institutional JSON Webhooks
Institutional JSON Webhooks: Alert payloads are engineered as strictly formatted JSON strings designed for automated execution (e.g., PineConnector, 3Commas), dynamically calculating and appending the precise Entry Price, Target Price (TP), and a buffered Invalidation Price (SL).

• Fibonacci Time Extensions
Fibonacci Time Extensions: Projects vertical time-based targets (e.g., 1.0, 1.618) derived from the A-B impulse duration to forecast temporal reversal zones alongside price targets.

⚠️ Disclaimer

All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
Phát hành các Ghi chú
Optimizing indicator performance and execution speed
Phát hành các Ghi chú
The updated version enhances the dashboard with a comprehensive layout featuring visual progress bars for trend bias and detailed metrics, alongside configurable alert actions for long and short positions. It optimizes internal structure management by fully leveraging object-oriented methods for cleaner code execution and improved efficiency. Additionally, the alert system now incorporates dynamic JSON payloads for precise integration with external trading tools, ensuring better data accuracy. These changes collectively improve the user interface readability, operational reliability, and external automation capabilities of the indicator.
Phát hành các Ghi chú
This release advances Dynamic Trend-Based Fibonacci Extension Pro from a structure-plotting tool into a complete, decision-grade trade framework. Structure validation is now context-aware: every setup is evaluated against the exact market conditions present at its formation pivot rather than at confirmation, and it must clear an expanded confluence layer covering trend baseline, momentum, momentum divergence, participation, volatility regime, higher-timeframe bias alignment, structural duration, and a minimum risk-to-reward gate — all consolidated into a single weighted 0–100 Quality Score with a user-defined acceptance threshold. Trade mechanics were rebuilt around selectable entry models and adaptive stop placement, with a full lifecycle engine that tracks each setup from pending through fill, staged target completion, invalidation, time-based expiry, and stop-out, each state emitting its own structured webhook alert including close-position and target-hit events. Visual and analytical output was extended with multi-structure confluence zones that highlight where extension targets from several setups (including higher-timeframe) converge, intelligent label de-collision, and a substantially expanded live dashboard exposing trade state, active levels, next target, regime, and alignment status. The engine was also hardened throughout for higher precision and lower computational load — refined swing detection with instrument-aware tolerance, corrected higher-timeframe time-axis mapping, consolidated data requests, and a single authoritative source for all trade-level calculations.
Phát hành các Ghi chú
Chart update only
Phát hành các Ghi chú
Nothing has been changed in the code; only a detailed description of the new features has been added.
Version Update Summary

New Feature: Trade Quality Score
  • A new confluence engine scores every A-B-C structure from 0-100 the moment it forms, blending trend alignment, momentum, volume, higher-timeframe agreement, market regime, and risk-to-reward into one weighted number.
  • Replaces simple pass/fail filtering with a graded read on setup strength.
  • Structures scoring below a chosen minimum can optionally be filtered out entirely.
  • Adds a "Quality Score" row to the dashboard, shown as a 0-100 progress bar.


How to Use: Trade Quality Score
  • The Quality Score bar fills further as more confluence factors align in favor of the active structure.
  • A higher score means trend, momentum, volume, HTF bias, market conditions, and reward-to-risk are more broadly in agreement — generally a stronger technical case.
  • A low score means the setup is only supported by one or two factors and relies more on price geometry alone.
  • This is a relative confluence gauge, not a guarantee of outcome — best used alongside the existing filters and price action context.


New Feature: Trade Lifecycle Tracking
  • Each structure now progresses through a visible lifecycle: Pending, Entered, TP1 Hit, TP2 Hit, TP3+ Hit, and Stopped.
  • Gives a running status of where the most recent setup stands in real time, not just static Fibonacci levels.
  • Adds a "Trade State" row with color coding, plus new "Entry," "Stop Loss," and "Next Target" rows to the dashboard.


How to Use: Trade Lifecycle Tracking
  • "Pending" means price hasn't reached the entry level yet; "Entered" means the trade is live.
  • "TP1/TP2/TP3+ Hit" show progressively deeper targets reached, so you can see how far the move has extended.
  • "Stopped" means the protective stop was hit and the idea is closed.
  • Coloring moves from neutral (Pending) to an entered color, to bullish as targets are hit, to bearish if stopped — an at-a-glance read of trade progress.
  • The Next Target row always shows the nearest remaining objective.


New Feature: Fibonacci Cluster Zones
  • Scans across active structures, including HTF structures when enabled, and highlights price bands where multiple extension levels stack closely together.
  • Surfaces areas where several independent Fibonacci projections agree on roughly the same price — typically stronger reaction zones than any single level alone.
  • Adds shaded boxes on the chart marking these zones, extending to the right.


How to Use: Fibonacci Cluster Zones
  • A shaded cluster box marks a price band where multiple extension levels from different structures land close together.
  • More stacked levels in a zone means more technical agreement at that price band, often treated as a higher-probability reaction area.
  • These zones supplement the individual Fibonacci levels already on the chart rather than replacing them.


New Feature: Additional Structure Validation Filters
  • Five new optional filters for finer control over which A-B-C structures are allowed to form: HTF Bias Alignment, RSI Momentum Divergence, Minimum Structure Duration, Minimum Risk:Reward Gate, and Market Regime Gate (choppy vs. trending conditions).
  • Adds a "Regime" row and an "HTF Align" row to the dashboard reflecting these conditions in real time.


How to Use: Additional Structure Validation Filters
  • The Regime row reflects current market conditions — trending readings show bullish coloring, choppier readings show bearish coloring.
  • The HTF Align row shows whether the latest structure agrees with the higher-timeframe bias: "Aligned" trades with the larger trend, "Against" flags a counter-trend structure.
  • These filters layer on top of the existing Trend, RSI, Volume, and Retracement filters, so any combination can be used.


New Feature: Flexible Entry Modes
  • Entry price is no longer fixed to Point B. Choose between a breakout entry at B, a limit entry inside the B-C retracement zone, or a limit entry at Point C.
  • Lets entry logic match different trading styles, from breakout to pullback entries.


How to Use: Flexible Entry Modes
  • "Breakout at B" is a stop-style entry for traders wanting confirmation before entering.
  • "Retrace Zone" is a limit-style entry partway back toward C for a better price on a pullback.
  • "Retest at C" enters at the structural origin of the move.


New Feature: ATR-Based Stop Loss Mode
  • Stop loss can now be a fixed percentage beyond Point C (as before) or a multiple of market volatility, so stops adapt automatically across instruments with different price ranges.


How to Use: ATR-Based Stop Loss Mode
  • Percent mode keeps a fixed percentage distance from Point C.
  • ATR mode scales the stop distance with volatility — wider on volatile instruments or timeframes, tighter on calmer ones.


New Feature: Time Stop Invalidation
  • Structures whose entry never triggers within a set multiple of the original swing duration are now automatically invalidated, preventing stale setups from sitting on the chart indefinitely.


How to Use: Time Stop Invalidation
  • A structure aging out is treated like an invalidated one — grayed out or removed depending on your display setting — and the Trade State shows it as Stopped.
  • Helps quickly distinguish setups that are still actionable from ones that simply went stale.


Refinements
  • Pivot detection now supports a tolerance for near-equal highs/lows, reducing missed swings on tick-quantized instruments.
  • Engulfing candle detection now correctly checks the prior candle's color, improving Ideal Retest accuracy.
  • Trend, RSI, and Volume filters now evaluate conditions at the actual pivot point instead of several bars later, for more accurate validation.
  • Take-profit labels now number strictly by price distance, so custom ratios land correctly in the target sequence.
  • Regime Score now draws from a rolling history instead of only the on-screen structures, giving a steadier bullish/bearish bias reading.
  • Stale drawings from revised swing points are now properly cleared before redrawing.
  • Close Long/Close Short alert actions now fire correctly on invalidation or time-stop.
  • Higher-timeframe data requests are consolidated for better chart efficiency.
  • Dashboard reorganized to fit the new Quality Score, Trade State, Entry, Stop Loss, Next Target, Regime, and HTF Align rows.

Phát hành các Ghi chú
Dynamic Trend-Based Fibonacci Extension Pro — Update Summary

A capability and accuracy release: live trade tracking on the chart, second-chance retests, a Signal Lock, full higher-timeframe alerting, and a deep correction pass on swing detection.

MAJOR NEW FEATURES

Signal Lock
  • One toggle freezes the current setup while a trade is still working — no new structure can replace it on the chart.
  • Releases itself automatically once the trade closes; no manual reset.

How to Use
  • The dashboard Lock row reads OFF when idle, Armed when on but protecting nothing, and ACTIVE when holding a live setup.
  • ACTIVE confirms the levels on screen belong to the trade you are already in.


Second-Chance Retests After a Stop
  • A stopped or expired structure can now revive when price returns to Point C — previously it was finished for good.
  • Visual Only redraws it while leaving the trade closed; New Trade resets it to pending, restores its levels and re-arms entry, target and stop alerts as a genuine second trade.
  • The number of revivals one structure may earn is user-adjustable.

How to Use
  • The Structure State row appends a revival counter — a counter means you are on a second or later attempt at the same level.
  • Labels reverting from hit status back to live prices is your cue that a new attempt has begun.
  • A high revival count warns that the level keeps being tested without resolving.


Live Trade Status on Chart Labels
  • Entry, stop and target labels now update in place as price interacts with them, instead of showing static prices.
  • Each target reached is marked hit and reports the move achieved from entry as a percentage.
  • A setup that ran out of time is now visually distinct from one genuinely stopped out.

How to Use
  • An entry label switching to hit status confirms the setup is live; until then the trade is pending.
  • Hit target labels show the percentage gained from entry — a running read on how much of the projection is captured.
  • On the dashboard, Expired means the setup never triggered in its window and is shown neutrally, not as a loss.


Full Higher-Timeframe Alert Coverage
  • Higher-timeframe structures now fire new-structure and Point C retest alerts, on equal footing with chart-timeframe structures.
  • Payloads now report the exact structure that triggered them, ending mismatched levels in notifications.


MINOR FEATURES
  • Multi-event alert payloads — every event on a shared bar is delivered in one notification, tagged with revival sequence and the full span of targets cleared.
  • Chart compatibility guards — the script stops with a clear explanation on synthetic chart types and on an invalid higher-timeframe selection, preventing silently wrong levels.
  • Persistent forward projection — level lines and labels stay projected ahead of price for the life of every structure; higher-timeframe labels sit further right so columns never collide.
  • Dashboard context header — the header now shows the active symbol and timeframe, making screenshots and multi-chart layouts self-identifying.


ACCURACY AND RELIABILITY
  • Swing detection rebuilt: a pivot confirms only once both surrounding windows are fully closed, removing swings accepted on incomplete information.
  • A warm-up guard prevents structures forming before enough history exists.
  • Higher-timeframe filter context is now sampled at the swing itself, so trend, momentum, volume, volatility and regime describe the moment the structure formed.
  • Higher-timeframe swing placement on the time axis corrected; unresolvable swings are skipped rather than misplaced.
  • Structures store their own pivot snapshot — a swing that later extends can no longer alter a structure already drawn and alerted.
  • Unchanged structures are no longer redrawn or re-announced on later bars.
  • Instruments without volume data no longer have every setup rejected by the volume filter.
  • The stop is always placed a meaningful distance beyond Point C, with a fallback when volatility data is unavailable.
  • A custom ratio matching a built-in level no longer duplicates a line, and custom levels take visual priority as intended.
  • Entry and stop alerts confirm on bar close for repaint-free delivery; target alerts still fire on first touch.
  • All forward projections are capped within platform drawing limits, preventing errors on long charts.


REFINEMENTS
  • Dashboard restyled: alternating row shading, defined outer frame, refreshed header colouring, improved padding.
  • Rows depending on an existing structure show a neutral placeholder instead of a misleading value when none exists.
  • Extension levels use a consistent line style with price-first target labels and alternating markers; the stop line is thicker for instant separation.
  • Golden Zone and Risk:Reward labels centred precisely on their spans.
  • Label anti-overlap controls retired — separation is now automatic, removing three settings from the panel.
  • Two unused colour settings removed.
  • Cluster zones and dashboard compute only on the current bar, lightening load on long histories and multi-chart layouts.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.