OPEN-SOURCE SCRIPT

Cup & Handle Visual Pattern

107
Cup & Handle – Visual Breakout Strategy (with Buy/Sell Signals)

Strategy Objective

This strategy helps traders visually identify and trade bullish Cup & Handle patterns by:

Drawing the Cup and Handle structure directly on the chart

Highlighting key support and resistance zones

Providing clear BUY and SELL signals

Assisting decision-making without repainting

🔧 Concept Behind the Strategy

The Cup & Handle is a bullish continuation pattern:

The Cup shows long consolidation and accumulation

The Handle shows short-term profit booking

A breakout above resistance signals trend continuation

This script approximates the pattern using price structure and volatility logic and draws it visually, instead of trying to mathematically force a perfect pattern.

🟠 Cup Formation Logic

The script finds the highest high and lowest low over a fixed lookback period

The depth of the cup must exceed a minimum percentage, ensuring a meaningful base

Two horizontal lines are drawn:

Top line → Cup resistance

Bottom line → Cup base (support)

📌 This creates a visible U-shaped price zone

⬜ Handle Formation Logic

After the cup forms, price must consolidate in a narrow range below resistance

A box is drawn on the chart showing the handle area

This represents short-term pullback before breakout

📌 The handle must:

Stay above the cup low

Stay below the cup resistance

🟢 BUY Signal Logic

A BUY signal is generated when:

Cup depth condition is valid

Handle consolidation is confirmed

Price breaks above cup resistance

📌 A green ▲ arrow appears below the breakout candle.

🔴 SELL Signal Logic

A SELL signal is generated when:

Price breaks below the handle support

📌 A red ▼ arrow appears above the breakdown candle.

🛑 Risk Management (Manual / Trader-Controlled)

This strategy is visual-assisted, not auto-exit based:

Stop Loss: Below handle low

Target:

Measure cup depth and project upward

Or trail using Supertrend / Moving Average

⏱️ Best Usage
Style Timeframe
Swing Trading 1H / Daily
Positional Daily / Weekly

Best suited for:

Strong trending stocks

Breakout candidates

Post-consolidation markets

⭐ Strengths of This Strategy

✔ Visual pattern drawing (easy to understand)
✔ Avoids over-complicated math
✔ Clear breakout levels
✔ Non-repainting logic
✔ Works as a decision-support tool

⚠️ Important Notes

Cup & Handle cannot be perfectly automated

This strategy assists, not replaces, trader judgment

Works best when combined with:

RSI above 50

Volume expansion

Market trend confirmation.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.