New AI Backtesting Assistant Launch!

Three Drive Pattern Detector

Aug 6, 2024

Static chart image
Dynamic Overlays
Patterns
Pivot Based (Retrospective)
Works on the Following Platforms
tradingviewSymbolTradingView
For free use on the TradingView platform
ninjatraderNinjaTrader
For free use on the NinjaTrader platform
metatrader4MetaTrader 4
For free use on the MetaTrader 4 platform
metatrader5MetaTrader 5
For free use on the MetaTrader 5 platform
thinkorswimThinkorswim
For free use on the Thinkorswim platform

The Three Drives Pattern Detector indicator focuses on detecting and displaying completed Three Drives patterns on the user chart. This harmonic pattern is characterized by successive higher highs / lower lows following specific ratios.

The script uses a multi-length swing detection approach, as well as adjusting ratios to ensure flexibility and a maximum number of visible Three Drives patterns.

USAGE

indicator image

The bullish/bearish Three Drives pattern is commonly interpreted as a reversal pattern and is characterized by three extensions (drives) and two intermediary retracements creating consecutive higher lows (for a bullish case) or lower highs (for a bearish case).

indicator image

The multi-length swing detection approach taken by the indicator allows for detecting shorter-term alongside medium/longer-term patterns simultaneously, allowing to increase in the amount of detected patterns.

indicator image

Users can set a Minimum Swing length (for example 2) and a Maximum Swing length (for example 100) which defines the range of the swing point detection length, higher values for these settings will detect longer-term Three-Drives patterns, while a larger range will allow for the detection of a larger number of patterns.

indicator image

Sometimes multiple dashed lines as the last segment can be observed. This means multiple Three Drives patterns sharing multiple swing points have formed, with only the last segment being different.

Retracement/Extension Ratios

indicator image

The Three Drives pattern often associates the retracement/extension to Fibonacci ratios of respectively 0.618/1.272.

Some sources specify a maximum retracement/extension level of 0.786/1.618, which means the retracement should be within the 0.618-0.786 range and the extension between 1.272-1.618.

Since finding a pattern where the retracement/extension is precisely at the 0.618/1.272 levels, or even between 0.618-0.786/1.272-1.618 is rare, the script allows users to adjust those ratios, which ensures more flexibility. Depending on the widening/tightening of the ratios, allowing users to find more patterns (but potentially less valid) or more valid (but fewer patterns).

indicator image

In the example above, "Show Ratios" is set to "Ratios With Margin", showing the ideal retracement/extension level together with the margin, while in the example below, "Show Ratios" is set to "Ratios", which shows only a line where the price should ideally reverse.

indicator image

While setting the ratios wider will result in more frequent but less valid patterns, it can also create good trading opportunities.

indicator image

Best Practices

The indicator doesn't include Stop Loss (SL) or Take Profit (TP) levels, however, the 1.618 Fibonacci Extension level of the last leg can commonly be used as stop loss.

Typical Take Profit areas include:

  • Starting point of the pattern
  • Each retracement level (2x)
  • The 0.618 retracement level of the complete pattern

indicator image

In the above bullish examples, the price was lower than the lowest point of the pattern. The price reversed and attained all TP levels without hitting the SL level.

indicator image

In the above bearish example, the price went above the highest point of the pattern but did not hit the SL level, after which two TP levels were hit. Then, the price quickly went up, just missing the SL level before it came back down again, hitting the last 2 TP levels.

indicator image

This example shows that other Fibonacci levels an also be effective when combined with the Three Drives pattern, even in the longer term.

DETAILS

Multi Length

The core of this publication is the multi-length swing detection. To ensure the maximum amount of Three Drives patterns are found, up to 99 different swing length periods can be used to detect swing points which are then tested for valid patterns.

indicator image

Using a wider variety of swing points also ensures that patterns visible only with specific Swing settings can be found on the same chart without the user needing to constantly adjust the Swing settings to find other patterns.

The user only needs to set the desired minimum and maximum Swing Length.

indicator image

In this case, swing detection using swing Lengths from 3 to 100 (97 different) are computed and evaluated for patterns. Three different patterns were found on the same chart, with swing lengths 3, 4, and 6.

Note: The Maximum Swing length should be equal to or higher than the Minimum Swing Length. If the maximum value is lower than the minimum, the script will automatically take the minimum value as the maximum to prevent errors.

Width Margin %

indicator image

Users can filter out patterns based on the duration of each extension/retracement segment. When the users want segments of the detected patterns to be of a similar duration, the width percentage should be set lower. When the focus is on detecting more patterns the width percentage can be set higher.

Retracement/Extension Settings

indicator image

  • Show Ratios, set to Ratios, show the ideal Fibonacci retracement/extension level, while Ratios With Margin (example below) show the additional margins for retracement/extension.
  • The upper and lower limits can be visualized while hovering over the calculated ratio label.
  • The dashed line shows an older pattern, where the last leg has been updated.

indicator image

Last Known Pattern

indicator image

The included dashboard highlights the date of the most recently detected pattern; the text will show "None" if no pattern is found.

Calculated Bars

The "Calculated Bars" setting makes use of the recently introduced calc_bars_count parameter, making it possible to effectively reduce the number of historical bars during the computation of the script, which significantly improves the loading speed of the script.

Users wishing to see the most recent patterns can set this setting to 1000 for example, where only the most recent 1000 bars are used to find patterns. If every bar must be used for pattern detection, set "Calculated bars" at 0.

SETTINGS

  • Minimum Swing Length: Minimum length used for the swing detection.
  • Maximum Swing Length: Maximum length used for the swing detection.
  • Retracement: Range of required ratios used for testing retracements.
  • Extension: Range of required ratios used for testing extensions.
  • Width Margin: Influences the symmetry of the pattern; with a higher number allowing for less symmetry.

Style

  • Text Size: Text size of the ratio labels.
  • Show Ratios: Show the ideal ratio, upper/lower limit of ratios, or none.

Dashboard

  • Show Dashboard: Toggle dashboard which shows the date of the last found pattern.
  • Location: Location of the dashboard on the chart.
  • Size: Text size.

Calculation

  • Calculated Bars: Allows the usage of fewer bars for performance/speed improvement.

Trading is risky and many will lose money in connection with trading activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other markets involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools for charting platforms, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content or tool we provide.

Charts used on this site are by TradingView in which the majority of our tools are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com. TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2025 LuxAlgo Global, LLC.