OPEN-SOURCE SCRIPT
Trident Swing Projector [MarkitTick]

💡 A structured swing-projection tool that automates Charles Lindsay's Trident quarter-swing method, turning a manual charting technique into a filtered, alert-ready framework for identifying retracement setups and projecting forward trade levels from a confirmed three-point swing structure.
✨ Originality and Utility
This script's value is not in reinventing pivot detection — left/right bar pivot confirmation is a known technique — but in the specific architecture built around it. The 25/50/75/100% level ladder projected from the retracement point follows the quarter-swing framework described by Charles Lindsay in his Trident work: a method of projecting Support/Resistance, Critical, and Equality points from a confirmed A-B-C swing. Everything surrounding that ladder — the pullback-depth gate, the dominant-trend filter, the ADX and higher-timeframe confluence layers, the configurable stop buffer, the armed-setup expiry, and the post-TP1 break-even handling — are MarkitTick design additions layered on top of Lindsay's original concept, not part of it.
The reason these pieces are combined rather than published separately is that a quarter-swing projection on its own is only as useful as the swing that produced it. A shallow, weak, or counter-trend retracement produces a projection ladder that is statistically less meaningful than one built from a decisive, trend-aligned impulse. The trend filter, pullback-depth window, ADX threshold, and HTF bias check all exist to answer one question before a projection is drawn: was this A-B leg significant enough to justify projecting from it? The trade-management layer (stop buffer, expiry, break-even) then exists to turn that projection into something that can be monitored and alerted on in real time, rather than only viewed as a static drawing. Each component is a gate or a consequence of the others; none of them functions as an independent indicator bolted on for its own sake.
The script is an indicator, not a strategy — it does not backtest or simulate equity. It identifies swing structures, projects levels from them, tracks whether those levels are subsequently reached, and reports all of this through a live dashboard and structured alert payloads.
🔬 Methodology and Concepts
● Confirmed Pivot Detection
Swing highs and lows are identified using a left/right bar-count pivot method: a candidate high or low is only confirmed once it has stood as the extreme point across both the bars to its left and the bars to its right, using the Pivot Left and Pivot Right settings. Because the check always references bars that have already closed, a pivot is never inferred from the currently forming bar — it is published exactly one bar after its right-side confirmation window completes. This is a deliberate implementation choice made to keep pivot detection non-repainting.
● The A-B-C Swing Structure
Once two consecutive confirmed pivots exist, the script watches for a third pivot that retraces into the prior leg:
If the Trend Filter is enabled, the A-B leg must also break the previous confirmed swing extreme in the same direction (B must exceed the prior swing high for a bullish setup, or undercut the prior swing low for a bearish one) before a retracement at C is allowed to qualify. This restricts setups to legs that are extending the dominant swing rather than forming inside a range.
● Leg Measurement and Smoothing
The A-B leg is measured either in raw price points or as a percentage move, depending on the Swing Unit setting. Before that leg size is used to derive projection levels, it can optionally be passed through one of five smoothing methods — SMA, RMA, WMA, HMA, or VWMA — set by Signal Smoothing and Smoothing Length. The smoothing is applied as a ratio between the smoothed and raw leg size and multiplied into the current leg, so that projection distances are influenced by the recent typical swing size on the instrument rather than reacting entirely to the size of a single leg. With Signal Smoothing set to None, the raw leg size is used unmodified.
● Quarter-Swing Level Projection
From point C, four levels are projected using fixed fractions of the A-B leg, applied in the direction of the new setup:
The Stop is placed at point C itself, with an optional buffer applied beyond it — either a fixed number of ticks or a fraction of the current ATR (ATR Length setting) — configured through Stop Buffer, Buffer Ticks, and Buffer ATR Fraction.
● Confluence Filters
Two independent filters can each block a setup from arming even after a valid A-B-C structure is found:
● Trade Management and State
Once a setup arms, it steps through a defined state sequence: Armed, Active (entry triggered), TP1 hit, TP2 hit, TP3 hit, Stopped, or Cancelled. Entry triggers when a confirmed close crosses the Entry level; a setup is cancelled if its Armed Expiry Bars limit is reached before entry, or if price closes back through point C first. If Stop to Breakeven after TP1 is enabled, the internally tracked stop moves to the entry price once TP1 is hit — this managed stop is reported in the dashboard and in alert payloads, but the stop line and label drawn on the chart intentionally remain at the original level, so the chart never displays a level implying a fill that did not actually occur at that price.
● Confirmation Lag Notice
Because pivot confirmation requires Pivot Right bars to elapse, and entry/cancellation logic checks a confirmed prior-bar close, every swing structure, entry trigger, and cancellation event appears with a built-in lag relative to the exact bar that produced it. This is a structural trade-off, not a defect: it is what keeps the A-B-C structure and its projected levels from repainting once drawn. Separately, TP1/TP2/TP3 target detection and the corresponding alerts monitor the current bar's high/low in real time rather than waiting for bar close, so a target can be marked and alerted as reached intrabar, before that bar has finished forming. This is standard behavior for real-time level-touch monitoring, but it means the exact moment a target fires can occur before the bar closes.
🎨 Visual Guide
📖 How to Use
⚙️ Inputs and Settings
● Core
● Filters
● Trade Tools
● Visuals and Dashboard
● Alerts
● Colors
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The projection ladder at the core of this script is drawn from the Trident method associated with Charles Lindsay, a framework built around measuring a swing's magnitude and projecting proportional fractions of it forward from a retracement point to derive Support/Resistance, Critical, and Equality levels. The underlying premise is that markets frequently move in self-similar proportional legs, so a retracement of a known size can be used to project plausible forward extension distances — the 50% "Critical" level and the 100% "Equality" level (a projected move matching the original leg) are the two most emphasized points in that framework, reflected here in TP1 and TP3 respectively.
The pullback-depth window applied to point C (23.6–78.6% by default) situates the acceptable retracement zone within a range commonly associated with Fibonacci retracement theory, without asserting that Fibonacci ratios themselves drive the projection math — the projection ladder here is a fixed 25/50/75/100% division of the leg, independent of the retracement percentage that qualified point C.
The ADX/DMI filter is grounded in Welles Wilder's directional movement framework, which measures trend strength by comparing the smoothed magnitude of directional price movement to overall volatility; applying a minimum threshold is a common approach to excluding range-bound conditions from directional setups, though ADX is a lagging, smoothed measure and does not itself predict continuation.
The higher-timeframe bias filter reflects multi-timeframe confluence theory: the idea that a directional bias visible on a longer aggregation of price is a useful, if imperfect, filter for shorter-timeframe setups, since it reduces (but does not eliminate) the chance of trading against the prevailing higher-timeframe trend.
The leg-smoothing step applies standard moving-average theory (simple, exponential-family, weighted, Hull, and volume-weighted variants) not to price directly, but to the derived leg-size series, an approach intended to make projected distances reflect a instrument's typical recent swing amplitude rather than the idiosyncrasies of a single leg.
⚠️ 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. We 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.
✨ Originality and Utility
This script's value is not in reinventing pivot detection — left/right bar pivot confirmation is a known technique — but in the specific architecture built around it. The 25/50/75/100% level ladder projected from the retracement point follows the quarter-swing framework described by Charles Lindsay in his Trident work: a method of projecting Support/Resistance, Critical, and Equality points from a confirmed A-B-C swing. Everything surrounding that ladder — the pullback-depth gate, the dominant-trend filter, the ADX and higher-timeframe confluence layers, the configurable stop buffer, the armed-setup expiry, and the post-TP1 break-even handling — are MarkitTick design additions layered on top of Lindsay's original concept, not part of it.
The reason these pieces are combined rather than published separately is that a quarter-swing projection on its own is only as useful as the swing that produced it. A shallow, weak, or counter-trend retracement produces a projection ladder that is statistically less meaningful than one built from a decisive, trend-aligned impulse. The trend filter, pullback-depth window, ADX threshold, and HTF bias check all exist to answer one question before a projection is drawn: was this A-B leg significant enough to justify projecting from it? The trade-management layer (stop buffer, expiry, break-even) then exists to turn that projection into something that can be monitored and alerted on in real time, rather than only viewed as a static drawing. Each component is a gate or a consequence of the others; none of them functions as an independent indicator bolted on for its own sake.
The script is an indicator, not a strategy — it does not backtest or simulate equity. It identifies swing structures, projects levels from them, tracks whether those levels are subsequently reached, and reports all of this through a live dashboard and structured alert payloads.
🔬 Methodology and Concepts
● Confirmed Pivot Detection
Swing highs and lows are identified using a left/right bar-count pivot method: a candidate high or low is only confirmed once it has stood as the extreme point across both the bars to its left and the bars to its right, using the Pivot Left and Pivot Right settings. Because the check always references bars that have already closed, a pivot is never inferred from the currently forming bar — it is published exactly one bar after its right-side confirmation window completes. This is a deliberate implementation choice made to keep pivot detection non-repainting.
● The A-B-C Swing Structure
Once two consecutive confirmed pivots exist, the script watches for a third pivot that retraces into the prior leg:
- Point A — the origin pivot (a confirmed swing low ahead of a bullish setup, or swing high ahead of a bearish one).
- Point B — the impulse pivot that follows A, defining the A-B leg.
- Point C — a new, opposing pivot that pulls back into the A-B leg by a percentage between the Min Pullback % and Max Pullback % settings (23.6–78.6% by default). Pullbacks shallower or deeper than this window are rejected and no setup is formed.
If the Trend Filter is enabled, the A-B leg must also break the previous confirmed swing extreme in the same direction (B must exceed the prior swing high for a bullish setup, or undercut the prior swing low for a bearish one) before a retracement at C is allowed to qualify. This restricts setups to legs that are extending the dominant swing rather than forming inside a range.
● Leg Measurement and Smoothing
The A-B leg is measured either in raw price points or as a percentage move, depending on the Swing Unit setting. Before that leg size is used to derive projection levels, it can optionally be passed through one of five smoothing methods — SMA, RMA, WMA, HMA, or VWMA — set by Signal Smoothing and Smoothing Length. The smoothing is applied as a ratio between the smoothed and raw leg size and multiplied into the current leg, so that projection distances are influenced by the recent typical swing size on the instrument rather than reacting entirely to the size of a single leg. With Signal Smoothing set to None, the raw leg size is used unmodified.
● Quarter-Swing Level Projection
From point C, four levels are projected using fixed fractions of the A-B leg, applied in the direction of the new setup:
- 25% of the leg → Entry level.
- 50% of the leg → TP1, labeled as the Critical level in Lindsay's terminology.
- 75% of the leg → TP2.
- 100% of the leg → TP3, the Equality target — a projected swing from C equal in size to the original A-B leg.
The Stop is placed at point C itself, with an optional buffer applied beyond it — either a fixed number of ticks or a fraction of the current ATR (ATR Length setting) — configured through Stop Buffer, Buffer Ticks, and Buffer ATR Fraction.
● Confluence Filters
Two independent filters can each block a setup from arming even after a valid A-B-C structure is found:
- ADX Filter — requires the DMI-derived ADX value (ADX Length setting) to be at or above the ADX Threshold before a setup is allowed to arm, intended to avoid projecting swing levels during weak-trend, low directional-strength conditions.
- HTF Confirmation — requests a higher timeframe's close (HTF Timeframe setting) and compares it against the prior higher-timeframe close to derive a simple directional bias. A setup is only allowed to arm if this bias agrees with the setup's direction. The higher-timeframe read uses a confirmed prior-bar close with lookahead correctly paired to that offset, so this filter does not draw on unconfirmed higher-timeframe data.
● Trade Management and State
Once a setup arms, it steps through a defined state sequence: Armed, Active (entry triggered), TP1 hit, TP2 hit, TP3 hit, Stopped, or Cancelled. Entry triggers when a confirmed close crosses the Entry level; a setup is cancelled if its Armed Expiry Bars limit is reached before entry, or if price closes back through point C first. If Stop to Breakeven after TP1 is enabled, the internally tracked stop moves to the entry price once TP1 is hit — this managed stop is reported in the dashboard and in alert payloads, but the stop line and label drawn on the chart intentionally remain at the original level, so the chart never displays a level implying a fill that did not actually occur at that price.
● Confirmation Lag Notice
Because pivot confirmation requires Pivot Right bars to elapse, and entry/cancellation logic checks a confirmed prior-bar close, every swing structure, entry trigger, and cancellation event appears with a built-in lag relative to the exact bar that produced it. This is a structural trade-off, not a defect: it is what keeps the A-B-C structure and its projected levels from repainting once drawn. Separately, TP1/TP2/TP3 target detection and the corresponding alerts monitor the current bar's high/low in real time rather than waiting for bar close, so a target can be marked and alerted as reached intrabar, before that bar has finished forming. This is standard behavior for real-time level-touch monitoring, but it means the exact moment a target fires can occur before the bar closes.
🎨 Visual Guide
- A · B · C labels — small grey markers placed at the three confirmed pivots that define the active setup, drawn once the pattern is confirmed (so they sit slightly in the past relative to the bar that produced them).
- Projected Leg — a dashed grey line running from point C forward to the TP3 price level, spanning a time distance matched to the original A-B leg's bar length. This shows the projection visually before price has necessarily reached it.
- Entry line and label — a dashed blue line at the 25% projection level, labeled with the exact price.
- Stop line and label — a solid line at point C (plus buffer, if configured), colored to match the Bearish color setting, labeled with the exact price. The label updates to show a hit confirmation and the resulting percentage move once the stop is reached, noting separately if the exit was a trend-failure stop or a break-even exit.
- TP1 / TP2 / TP3 lines and labels — dashed lines at the 50/75/100% levels, each labeled with price and the resulting reward-to-risk multiple. Each label updates to show a hit confirmation and percentage move once reached.
- BULL / BEAR entry marker — a small label placed at the bar where the Entry level is actually crossed, confirming the setup transitioned from Armed to Active.
- Dashboard table — a live panel (toggled and positioned via the Dashboard settings) showing direction, state, entry/stop/managed-stop/target prices, reward-to-risk bars for each target, pullback depth, A-B swing size, bars since entry, HTF bias, ADX condition, and active smoothing method.
- Non-standard chart warning — if the chart is displaying Heikin Ashi, Renko, Kagi, Point & Figure, Linebreak, or Range bars, a warning label appears directly on the chart, since projected price levels are not meaningful on synthetic bar types.
📖 How to Use
- Wait for a confirmed A-B-C structure to complete. The A and B markers appear once a swing has formed, and the C marker (with entry/stop/target lines) appears only once a pullback within the configured percentage window is confirmed.
- Treat the Entry line as the level the script is watching for a confirmed close through, not an instruction to enter immediately at C.
- Use the Stop line as the invalidation level for the setup — a confirmed close back through point C cancels an armed setup outright.
- Read TP1 (Critical), TP2, and TP3 (Equality) as sequential projection targets rather than a single expected outcome; the dashboard's reward-to-risk bars for each target update as price approaches or reaches them.
- Check the HTF Bias and ADX rows in the dashboard if those filters are enabled, to understand why a structurally valid A-B-C pattern may not have armed.
- Use the webhook alert payload's state and event fields to drive automation, rather than relying on price levels alone, since the payload also reports the managed (break-even) stop separately from the originally drawn stop.
⚙️ Inputs and Settings
● Core
- Pivot Left / Pivot Right — bar counts required on each side of a swing point before it is confirmed as a pivot. Larger values produce fewer, more significant, and later-confirmed pivots.
- Swing Unit — measures the A-B leg in raw price Points or as a Percent move, changing how leg size (and therefore all projected distances) is calculated.
● Filters
- Trend Filter — requires the A-B leg to break the prior confirmed swing extreme in the setup's direction.
- Min Pullback % / Max Pullback % — the acceptable retracement depth window for point C, as a percentage of the A-B leg.
- HTF Confirmation / HTF Timeframe — requires a higher-timeframe directional bias to agree with the setup direction before arming.
- ADX Filter / ADX Length / ADX Threshold — requires trend strength (via DMI/ADX) to clear a minimum threshold before arming.
- Signal Smoothing / Smoothing Length — applies SMA, RMA, WMA, HMA, or VWMA smoothing to the leg magnitude used for projections.
● Trade Tools
- Lock Signal — freezes the current signal and blocks any new setup from arming.
- Stop Buffer / Buffer Ticks / Buffer ATR Fraction / ATR Length — adds extra distance beyond point C when placing the stop, either as a fixed tick count or a fraction of ATR.
- Armed Expiry Bars — cancels an armed (not yet triggered) setup if the Entry level isn't closed through within this many bars.
- Stop to Breakeven after TP1 — moves the internally tracked (managed) stop to entry once TP1 is hit, reported in the dashboard and alerts without moving the drawn stop line.
● Visuals and Dashboard
- Trade Levels / A · B · C Markers / Projected Leg / Entry Markers — independent toggles for each chart element.
- Keep Last N Setups — limits how many historical setups' drawings remain on the chart, to stay within drawing object limits.
- Show Dashboard / Position — toggles and positions the live info panel.
● Alerts
- Long / Short / Close Long / Close Short / Info Action strings — customizable text values inserted into the "action" field of the JSON alert payload, for direct use in webhook automation.
● Colors
- Independent color controls for bullish/bearish/neutral tones, stop, entry, target, A·B·C markers, projected leg, label text, and dashboard header/body/text colors.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The projection ladder at the core of this script is drawn from the Trident method associated with Charles Lindsay, a framework built around measuring a swing's magnitude and projecting proportional fractions of it forward from a retracement point to derive Support/Resistance, Critical, and Equality levels. The underlying premise is that markets frequently move in self-similar proportional legs, so a retracement of a known size can be used to project plausible forward extension distances — the 50% "Critical" level and the 100% "Equality" level (a projected move matching the original leg) are the two most emphasized points in that framework, reflected here in TP1 and TP3 respectively.
The pullback-depth window applied to point C (23.6–78.6% by default) situates the acceptable retracement zone within a range commonly associated with Fibonacci retracement theory, without asserting that Fibonacci ratios themselves drive the projection math — the projection ladder here is a fixed 25/50/75/100% division of the leg, independent of the retracement percentage that qualified point C.
The ADX/DMI filter is grounded in Welles Wilder's directional movement framework, which measures trend strength by comparing the smoothed magnitude of directional price movement to overall volatility; applying a minimum threshold is a common approach to excluding range-bound conditions from directional setups, though ADX is a lagging, smoothed measure and does not itself predict continuation.
The higher-timeframe bias filter reflects multi-timeframe confluence theory: the idea that a directional bias visible on a longer aggregation of price is a useful, if imperfect, filter for shorter-timeframe setups, since it reduces (but does not eliminate) the chance of trading against the prevailing higher-timeframe trend.
The leg-smoothing step applies standard moving-average theory (simple, exponential-family, weighted, Hull, and volume-weighted variants) not to price directly, but to the derived leg-size series, an approach intended to make projected distances reflect a instrument's typical recent swing amplitude rather than the idiosyncrasies of a single leg.
⚠️ 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. We 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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
💡 Proprietary indicators. Original research. Built by analysts who trade.
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
💡 Proprietary indicators. Original research. Built by analysts who trade.
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
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.