OPEN-SOURCE SCRIPT

Half Cup [LuxAlgo]

The Half Cup indicator detects and displays patterns with the shape of a Half Cup, initiating a channel. From this channel, breakouts are detected and highlighted with dots.

Users can control the shape of the Half Cup and the channel length through various settings.

Do note that the displayed half cups are displayed retrospectively, making them subject to backpainting.

🔶 USAGE

스냅샷

The idea behind the indicator is derived from the Cup & Handle pattern, which requires waiting for the pattern full completion.

Our Half Cup publication aims to find opportunities when the potential cup is only formed halfway.

스냅샷

In this example, a green dot shows the first breakout of the upper channel extremity. A few bars later, the price went under it, after which it returned above, triggering a second green dot. Both triggers were good opportunities in this case, and the price rose afterward.

The Half Cup pattern can be the start of a potential complete Cup & Handle (As in the example above, a complete Cup pattern (without the Handle) is shown, manually drawn with dashed lines).

스냅샷

Every green/red dot, whether on a bullish or bearish pattern, points to a breakout respectively above/below the channel.

스냅샷

Besides drawing patterns and the corresponding breakouts, the Half Cup indicator can also provide insights into trends and potential opportunities in the long run.

🔶 DETAILS

🔹 Validation

스냅샷

Several criteria must be fulfilled before a visible pattern on the chart is drawn.

Calculations are done beforehand to know where the Half Cup pattern would be positioned.

The pattern's bottom and top edges are checked for the number of bars whose closing price is outside the half-cup area. When the number of breakouts above/below is equal to or lower than the user-defined settings (Max % Breaks Top/Bottom), the pattern is drawn together with a brighter-colored channel next to it.

Dots highlighting the channel's breakout can be drawn from that moment until the end of both channel lines.

🔹 Positioning

스냅샷

Users can adjust the following settings to fit their needs:

  • % Broadness: Moves the Top/Bottom line (bullish or bearish) diagonally upwards/downwards.
  • Vertical Shift: Shifts the entire pattern up/down.
  • Channel Length: Sets the line length of the channel.


Note that adjusting the position of the pattern will change the validation; the script will be rerun to check if patterns are still valid or if new patterns can be drawn. Some patterns may disappear, while new ones may appear.

Before adjusting the position, the user can set Max % Breaks Top/Bottom at 100%. When the positioning is set, Max % Breaks Top/Bottom can be set as desired.

🔹 Updated Drawings

스냅샷

The Half Cup pattern is always drawn retrospectively (that is it is subject to backpainting), the channel is drawn from the bar from where the pattern is detected. Every breakout of the channel will remain visible as dots.

When a new swing high/low is found while the previous swing low/high remains the same, the pattern is updated to minimize clutter. The dots of earlier drawings will remain visible (to ensure no repainting occurs), but the color becomes faded, as such bright dots are associated with patterns that are visible on the chart, while faded dots are from removed/updated patterns.

🔶 SETTINGS

  • Swing Length: Period used for the swing detection, with higher values returning longer-term Swing Levels.


🔹 Validation

  • Max % Breaks Bottom: Allowed maximum amount of bars where the closing price is below the bottom of the Half Cup pattern against the total width of the pattern (bars).
  • Max % Breaks Top: Allowed maximum amount of bars where the closing price is above the top of the Half Cup pattern against the total width of the pattern (bars).


🔹 Positioning

  • % Broadness: Moves the Top/Bottom line (bullish or bearish) diagonally upwards/downwards.
  • Vertical Shift: Shifts the entire pattern up/down.
  • Channel Length: Sets the line length of the channel.
breakoutChart patternsCUPcupandhandlepatternhalfcupluxalgoParallel ChannelPivot points and levelssignalsTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
또한 다음에서도:

면책사항