Three Drives Pivot Scanner [Trishul]1. Description
The Three Drives pattern is a structural price formation made up of three sequential directional drive-legs, each separated by a corrective retracement. Each successive drive extends beyond the last within defined Fibonacci proportions, while each retracement holds within a defined range relative to the preceding move. The completed structure is traditionally read as an exhaustion pattern, with the completion of the third drive forming a Potential Reversal Zone (PRZ).
Three Drives Pivot Scanner detects Three Drives structures automatically using a pivot based detection system and, provides two concurrent methods:
Pivot Confirmed — waits for the complete six-point structure to be confirmed.
Live Projection — projects the PRZ while the third drive is still forming and identifies when price first trades into the projected zone.
2. Features
Pivot-Based Structural Detection
Structural swing highs and swing lows are identified using Pine Script's built-in pivot functions. The pivot length is user adjustable, allowing the detector to be tuned from more reactive short-term structures to broader, slower moving structures. Confirmed pivots are stored in an array and evaluated sequentially to determine whether the resulting swing structure satisfies the Three Drives geometric requirements.
pivot high = ta.pivothigh(high, pivLen, pivLen)
pivot low = ta.pivotlow(low, pivLen, pivLen)
// default pivot length is 5.
// shorter pivot length produces more patterns,
Method 1 — Pivot Confirmed
The Pivot Confirmed method requires all six pivot points (start. three drives , two retracements) to already be confirmed pivots before plotting. This is the most structural complete interpretation but by nature introduces delay inherent in pivot confirmation. A confirmed pattern is rendered as a polyline connecting all six pivot points.
Method 2 — Live Projection
The Live Projection method is designed to identify the potential completion of a Three Drives pattern before the final drive is confirmed.
Once the first five pivot points have been established, Trishul calculates the Fibonacci based Projected Reversal Zone ( PRZ) for the anticipated third drive and projects that zone forward. Instead of waiting for a validated swing high/low on the current bar, the script actively scans forward bar-by-bar to identify the moment price first intersects the PRZ. This continuous, intra-bar scanning ensures the PRZ is never ignored or bypassed, capturing the earliest possible structural touch. The developing pattern is rendered as a bull/bear colored polyline with numbered drive labels (1, 2, 3) and a dashed projected-zone box. Unlike the Pivot Confirmed method, the Live Projection method does not require the third drive to subsequently become a confirmed pivot before the potential completion is identified. Both methods are plotted by default so users can compare and contrast their behavior, with the option to turn either one off.
Pattern Time–Price Symmetry
When in Live Projection, Trishul validates the Three Drives pattern using both price and time symmetry. It measures the bar width between Drive 1 and Drive 2 as a reference interval. To pass validation, the time elapsed between Drive 2 and Drive 3 must reach the projected reversal zone (PRZ) within a window of 0.5× to 2.628× that reference interval. Moves occurring too early lack structural development, while those taking too long break temporal symmetry and are rejected.
Pattern Age Filter
A maximum pivot array size and configurable maximum pattern bar-width settings keep only structurally recent patterns on the chart rather than accumulating stale historical ones indefinitely. 3. Future Development
Trishul is a demonstration of how a pivot-based architecture can be applied to automated pattern recognition. The underlying framework can be further expanded to identify or construct a variety of price structures including trend lines, channels and multi-leg patterns. Future planned development will extend the framework into harmonic pattern detection systems (Gartley, Butterfly, Bat, Crab, and others).
4. Default Settings
Pivot Point length: 5
Retracement Ratio: 0.5 - 0.886
Extension Ratio: 1.13 - 1.618
Tolerance: 0.9 - 1.1
3rd Drive Time Multiplier: 0.5 - 2.628
Max Pattern Bar Width: 300 bars
日本語概要 (Japanese Summary)
Three Drives Pivot Scanner は、3つの連続する推進波(ドライブ)と2つの調整波(リトレースメント)からなる構造的な価格パターンを自動検出する高機能インジケーターです。各波動はフィボナッチ比率に基づいて厳格に評価され、パターンの完成時にトレンド転換の可能性が高い領域である Potential Reversal Zone (PRZ) を形成します。内蔵されたジグザグ機能とピボットポイントのアルゴリズムを用いることで、相場の重要な節目を正確に捉えながら、ユーザーの設定に合わせたピボット長や比率の柔軟なカスタマイズを可能にしています。
本スクリプトの最大の特徴は、アプローチの異なる2つの検出方法をリアルタイムに同時提供する点にあります。6つすべての構造ポイントが完全に確定してから綺麗なパターンを描写する保守的な「Pivot-Confirmed」と、最初の5つのポイントから最終レッグの到達点を先読みして価格がPRZに達した瞬間にリアルタイム検知する「Live Projection」を搭載しています。これにより、確定済みの信頼性を重視するトレーダーと、未確定の段階から一歩先んじて反転ゾーンを狙いたいトレーダーの両方のニーズに同時に応えるインジケーターとなっています。
中文概要(Chinese Summary)
Three Drives Pivot Scanner 是一款結構分析指標,能自動檢測由三個連續推進浪(Drive)與兩個修正浪(Retracement)所組成的結構性價格形態。各個波段皆依據斐波那契比率進行嚴格評估,並在第三個推進浪完成附近形成可能發生趨勢反轉的目標區域(Potential Reversal Zone, PRZ)。該指標內建 ZigZag 功能與轉折點(Pivot Points)演算法,能精確捕捉市場的關鍵拐點,同時允許用戶根據自身需求,靈活調整轉折點長度、回撤與擴展比率及容許誤差。
本腳本的核心優勢在於同步提供兩種互補的偵測模式。保守的「Pivot-Confirmed」模式會等待所有六個結構點完全確認後,才在圖表上繪製出完整的形態,有效過濾虛假訊號;而「Live Projection」模式則在前面五個結構點成形時,便提前推算最終浪的落點,並在價格首次觸及 PRZ 預測分區的瞬間實時觸發告警。這項設計讓重視訊號確認的穩健型交易者,與傾向在形態完成前搶先佈局反轉點的左側交易者,都能兼顧各自的策略需求。
Disclaimer:
This script is a research tool for market structure analysis and educational purposes only. It does not constitute financial advice. Trading involves risk.
Chỉ báo






















