OPEN-SOURCE SCRIPT

Double Tap Double Top/Bottom [Viprasol]

958
Double Tap — Double Top / Double Bottom [Viprasol]

═══════════════════════════════════════════════════════════
WHAT IT DOES
═══════════════════════════════════════════════════════════

Double Tap finds the two most reliable reversal patterns in classic technical analysis —
the Double Top (M) and Double Bottom (W) — draws them as they FORM, and on a confirmed
neckline break projects a complete trade map: Entry, Stop, and measured-move Target, then
tracks the outcome to ✓ or ✗. It keeps a history of recent patterns on the chart, not
just the latest one, so you can see how the tool reads structure over time.

═══════════════════════════════════════════════════════════
HOW THE PATTERN IS DETECTED
═══════════════════════════════════════════════════════════

1. Two confirmed swing highs (Double Top) or lows (Double Bottom) are found via a pivot
length you control.
2. The two extremes must match within a tolerance — a percentage of the pattern's height —
so the "double" is genuinely level, not a random pair of swings.
3. A valley (top) or peak (bottom) between them becomes the NECKLINE.
4. The pattern must span between your min and max width (bars) to filter noise.
5. While these conditions hold, the pattern is shown FORMING (a dotted preview). If price
breaks back past the twin extreme first, the setup is invalidated and the preview clears.
6. TRIGGER: a confirmed bar close through the neckline solidifies the pattern and prints
the trade levels.

Non-repainting: swings are confirmed pivots and the trigger evaluates on closed bars.

═══════════════════════════════════════════════════════════
THE TRADE MAP (drawn on every confirmed pattern)
═══════════════════════════════════════════════════════════

• ENTRY — the neckline-break close.
• STOP — beyond the higher top / lower bottom, padded by an ATR buffer.
• TARGET — the measured move: pattern height projected from the neckline (adjustable %).

On the chart: two peak markers with prices, a shaded pattern box, a dashed neckline, an
Entry line, and green/red TP/SL zones — all extending forward until price resolves them.
The pattern label then flips to ✓ (target hit) or ✗ (stop hit).

═══════════════════════════════════════════════════════════
FEATURES
═══════════════════════════════════════════════════════════

• Live "forming" preview so you see a pattern building before it triggers.
• Tracks multiple patterns across history (configurable how many to keep).
• Detect tops, bottoms, or both; full control of tolerance, pivot length, min/max width.
• Measured-move target (% of height) + ATR stop buffer.
• Dashboard: current status, active Entry / Target / Stop with % distance, and a running
hit rate (how often target was reached before stop, on the patterns shown).
• Alerts on Double Top / Double Bottom confirmation, plus a webhook-ready alert() message
(Text or JSON) carrying entry / stop / target.

═══════════════════════════════════════════════════════════
HOW TO USE
═══════════════════════════════════════════════════════════

1. Set Swing Length to the pattern size you want (larger = bigger, cleaner patterns).
2. Watch the dotted "forming" preview; act only on the confirmed neckline break.
3. Use the drawn Entry / Stop / Target as your plan; scale or exit at the target.
4. Tune Tolerance (how level the two extremes must be) to your market's character.
5. Set an alert on "Any alert() function call" for automation, or use the built-in
Double Top / Double Bottom conditions.

═══════════════════════════════════════════════════════════
HONEST LIMITATIONS
═══════════════════════════════════════════════════════════

• Pattern recognition is inherently subjective; this uses one consistent rule-based
definition — it won't catch every double a human would draw, and vice versa.
• The dashboard's hit rate is a simple tally of the patterns currently shown (target-before-
stop), not a full backtest — use it as a feel, not a performance guarantee.
• Swings confirm after the fact (pivot lookback), so patterns appear with a natural lag.
• This is a decision-support tool, not financial advice. Manage your own risk.

═══════════════════════════════════════════════════════════
CREDITS & ORIGINALITY
═══════════════════════════════════════════════════════════

The double top / double bottom is public, classic technical analysis; ATR is J. Welles
Wilder's public concept. Every line of Pine here — the pivot-pairing detection, the
tolerance/neckline/measured-move logic, the forming preview, the multi-pattern tracker,
and all visualization — is original Viprasol work written from scratch. No third-party
Pine code is reused.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。