All indicators

Cup Finder

Jun 20, 2021

Static chart image
SignalsDrawing ToolPatterns

The Cup Finder indicator identifies circular price patterns known as cups to assist in technical analysis by automatically detecting potential rounding bottoms or tops. It utilizes a mathematical approach to construct a parabolic channel and confirms the pattern based on the density of price action within that zone.

Usage

The Usage section describes how the script can be used to identify potential trend reversals or continuations. The script automatically scans historical bars within a user-defined lookback period to find price curves that fit a circular geometric shape.

  • Pattern Detection: The indicator draws a dashed line at the rim of the cup and a solid curved line following the detected price arc.
  • Validation: A cup is only displayed if a specific percentage of price bars (Contained Bar Rate %) falls within the calculated channel width. This ensures that the pattern is well-defined and not just a result of outlier price movements.
  • Breakout Identification: Users can select whether the breakout is triggered by the "Close" price or the "High/Low" extremes. This is particularly useful for verifying if a cup has successfully completed its formation and price has moved beyond the rim.

Details

The script calculates cups by determining a radius based on the distance between the current bar and a detected peak or trough. It converts price and time coordinates into a circular path using the Pythagorean theorem ($x^2 + y^2 = r^2$).

The "width" of the cup is normalized using the highest and lowest price levels over a 300-bar period, allowing the circular logic to scale correctly across different assets and timeframes. When a potential cup is identified, the script iterates through the bars within the radius to count how many bars physically reside within the calculated "Channel Width." If the density of these bars meets the "Contained Bar Rate %" threshold, the cup is plotted on the chart.

Settings

  • Number of Bars to search: Sets the maximum lookback period and maximum potential length of a cup.
  • Channel Width of the Cup: Adjusts the thickness of the detection zone based on a percentage of the recent price range.
  • Source for Breakout: Determines whether the script uses "Close" or "High/Low" prices to validate the pattern completion.
  • Contained Bar Rate %: The minimum percentage of bars that must be inside the channel for the cup to be considered valid.
  • Show Channels of Cups: When enabled, draws the upper and lower boundaries of the circular channel.
  • Don't Show Labels: Toggles the visibility of the information labels (Radius and Inclusion percentage).
  • Remove Old Lines/Labels: When enabled, only the most recent cup pattern will be displayed on the chart.
  • Colors: Customizes the visual output for bullish (bottoms) and bearish (tops) cup patterns.

FAQ

How do I interpret the "Included" percentage on the label? The "Included" percentage represents how well the price action fits the circular shape. A higher percentage indicates a more "perfect" or "smooth" cup formation, while a lower percentage suggests more volatile price action within the curve.

Can this indicator detect "Cup and Handle" patterns? The current version focuses specifically on finding the "Cup" portion of the pattern. You can use the detected cup as a foundation to manually identify subsequent handle formations.

How can I access the Cup Finder? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.