Market Structure Target Tracker [MarkitTick]💡 An advanced, multi-faceted analytical suite designed for traders who rely on price action and logical trend progressions. By systematically identifying structural pivots in the market, this tool automatically maps out Break of Structure (BOS) and Change of Character (CHoCH) events. Rather than simply plotting support and resistance, it integrates a sophisticated risk-management framework directly onto the chart, calculating dynamic Entry, Stop Loss (SL), and multiple Take Profit (TP) levels based on market volatility.
Price action trading requires constant vigilance to identify local maxima and minima. This script relieves the trader of manual chart marking by perpetually analyzing rolling windows of price data. When an established swing high or low is breached, the indicator locks in the structural shift, evaluates higher timeframe momentum to filter out false breakouts, and establishes a forward-looking target zone.
✨ Originality and Utility
Most market structure indicators limit their functionality to placing historical labels on the chart. The originality of this script lies in its forward-looking, state-aware tracking mechanism. It operates not just as an indicator, but as a simulated trade management dashboard.
Once a structural break occurs, the indicator shifts into an active tracking state. It dynamically projects Entry and SL/TP bands anchored to the breakout, using Average True Range (ATR) to adapt to the asset's current volatility. Furthermore, it continuously evaluates the life-cycle of the structural break, monitoring price action to determine if the target is successfully hit or if the setup is invalidated by an opposing swing breach. This level of state persistence provides traders with an objective, real-time assessment of trade feasibility, risk-to-reward ratios, and trend duration.
🔬 Methodology and Concepts
The script is built upon four foundational technical concepts, woven together into a unified logic sequence:
• Pivot Detection
The core engine scans for Pivot Highs and Pivot Lows. A Pivot High is confirmed when a specific bar's high is strictly greater than the highs of a defined number of bars both preceding and following it. This creates a fractal representation of market turning points.
• Break of Structure (BOS)
A bullish structure break occurs when the closing price of a confirmed bar exceeds the most recent Pivot High. Conversely, a bearish break occurs when the close drops below the most recent Pivot Low. The script categorizes the first break in a new direction as a CHoCH, and subsequent continuous breaks as BOS.
• Higher Timeframe (HTF) Alignment
To prevent trading against the dominant macroeconomic trend, the script optionally queries the Relative Strength Index (RSI) from a higher timeframe. If this filter is engaged, bullish breakouts are ignored unless the HTF RSI indicates bullish momentum, adding a crucial layer of directional confirmation.
• Volatility-Adjusted Target Mapping
Upon a valid breakout, the script captures the current ATR. It then maps out a predefined trade setup. The Entry is plotted slightly past the breakout line, the Stop Loss is placed at a multiple of the ATR away from the entry, and up to three Take Profit levels are projected using independent ATR multipliers.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The indicator translates discretionary price action theory into a strict, rule-based algorithmic framework grounded in discrete mathematics and statistical dispersion.
• Local Extrema in Discrete Time Series
The pivot detection relies on the mathematical definition of local extrema within a bounded domain. For a given time series of high prices $H_t$, a local maximum is identified at time $t$ if $H_t \ge H_{t \pm k}$ for a defined neighborhood $k$ (the Swing Length). By anchoring structural logic to these extrema, the script removes the subjectivity of trendline drawing, relying strictly on empirical data points that define the boundaries of recent market equilibrium.
• Measurement of Dispersion via True Range
The risk management module utilizes the Average True Range. The True Range ( NYSE:TR $) is defined as the greatest of the following: the current high minus the current low, the absolute value of the current high minus the previous close, or the absolute value of the current low minus the previous close. The ATR is a smoothed moving average of this NYSE:TR $. In academic finance, variance and standard deviation are common measures of risk; however, ATR is particularly robust for trading applications as it accounts for overnight gaps and limits, providing a highly adaptive measurement of kinetic market energy to appropriately size stop-loss thresholds.
• Relative Momentum Standardization
The Higher Timeframe filter utilizes the Relative Strength Index. The RSI standardizes the velocity of price movement onto a 0-100 scale by comparing the exponential moving average of recent gains to recent losses. By enforcing a rule where NYSE:RSI > 50$ is required for bullish structural breaks, the algorithm mathematically demands that the higher-degree derivative of price (momentum) aligns with the lower-degree breakout, statistically reducing the probability of mean-reverting false breakouts.
🎨 Visual Guide
The script provides a rich, non-intrusive visual overlay to keep the trader informed of all active states and historical context.
• Structure Break Lines
Dashed Green Lines: Indicate historical and active Bullish breakouts.
Dashed Red Lines: Indicate historical and active Bearish breakouts.
Trend Labels: Triangles and markers (▲ BOS / ▼ CHoCH) appear at the midpoint of the break line to clearly annotate the structural shift.
• Trade Projection Lines
When a break is active, a cluster of dashed lines projects to the right of the current price action:
Blue Line (►): Proposed Entry level.
Red Line (✕): Stop Loss level based on ATR.
Green Lines (●, ★, ◆): Three tiered Take Profit targets based on escalating ATR multiples.
• The Heads-Up Dashboard
Located in the top right corner, this table is the operational nerve center. It displays:
Asset Ticker and Current Trend status.
HTF Direction and a visual block-bar representation of the HTF RSI.
Active BOS Level and Target Status (⏳ Pending or ✓ Hit).
Exact price coordinates for Entry, SL, and all TPs.
The active Risk-to-Reward (R:R) ratio for the first target.
Statistical tracking of Total BOS counts and the duration (in bars) of the active setup.
📖 How to Use
Traders can utilize this script as a complete ruleset for navigating trend continuations and reversals.
When observing the chart, wait for the script to print a new BOS or CHoCH label. This signifies that a confirmed candle has closed beyond a significant structural pivot. If the HTF filter is enabled, this break already has the backing of higher timeframe momentum.
Once the break prints, look to the dashed projection lines and the dashboard. The dashboard will display exact coordinates for a theoretical trade setup. You can use the blue Entry line to plan limit orders or market execution upon pullbacks. Set your structural stop-loss according to the red SL line, and place limit orders to secure profits at the green TP lines.
Monitor the Dashboard's "Tgt Status". If price action reverses heavily and crosses the opposing pivot point before reaching the target, the script will trigger its auto-invalidation sequence, clearing the active lines and returning to a neutral scanning state. This helps in dynamically cutting risk when a setup structurally fails.
⚙️ Inputs and Settings
The indicator is highly customizable, allowing adaptation to any asset or timeframe.
• BOS Group
Swing Length: Determines the lookback and lookforward period for pivot detection. Lower values react faster but produce more noise; higher values identify major macro swings.
• Visibility Group
Show BOS Line / Labels: Toggles the historical structural break drawings.
Auto-Invalidate: When enabled, the script will cancel an active setup if the opposing structural extreme is breached.
Color settings: Fully customize the hues for Bullish breaks, Bearish breaks, and Targets.
• SL/TP Group
Show Entry/SL/TP: Toggles the projection lines on the chart.
ATR Length: The lookback period for calculating market volatility.
Multipliers: Adjust the SL ATR Multiplier and the individual TP1, TP2, and TP3 multipliers to define your specific risk-to-reward parameters.
• HTF Group
HTF: Select the resolution for the higher timeframe filter (e.g., 240 for 4-hour, D for Daily).
HTF Filter: Toggle the momentum alignment requirement on or off.
HTF RSI Len: The period for the higher timeframe momentum oscillator.
• Alerts Group
The script features built-in webhook-ready JSON alerts that can notify external services the moment a BOS occurs or a target is successfully hit.
⚠️ 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.
Indicador Pine Script®






















