Indicator

Breakout Pattern Setup [WillyAlgoTrader]📐 Breakout Pattern Setup is an overlay indicator that automatically detects converging price channels (wedges, triangles, pennants) by fitting trendlines to confirmed pivot points using a boundary-fit algorithm, then monitors for breakouts confirmed by a 5-factor strength scoring engine — with directional probability scoring while price is inside the channel, volume contraction verification, and automatic TP/SL placement based on the measured move (channel width projected from breakout). Once a breakout fires, the trade stays open until TP3 (full measured move) or SL is reached — with trailing to breakeven after TP1.
The core concept: converging channels compress volatility — when price breaks out of a narrowing range, the ensuing move tends to be proportional to the channel's maximum width. This indicator automates the entire workflow: detect pivots, fit upper and lower trendlines, verify convergence and volume contraction, score the breakout quality when it occurs, set targets based on the measured move, and track the trade to completion.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Manual channel drawing is subjective — two traders will draw different trendlines from the same pivots. A breakout without strength scoring treats strong and weak breaks equally. Targets without measured-move anchoring are arbitrary.
This indicator chains each component into a sequential pipeline:
Pivot detection → Boundary-fit algorithm (best trendline pairs) → Convergence + width + volume contraction verification → Channel visualization → Directional probability scoring → Breakout detection + 5-factor strength scoring → TP/SL from measured move → Trailing SL to breakeven after TP1 → Trade outcome tracking (win rate)
The pivot detection feeds raw swing points to the boundary-fit algorithm. The algorithm tests all pivot pair combinations and selects the lines with the most touches and least deviation — producing objective, reproducible trendlines. The convergence filter ensures only narrowing channels qualify (not parallel channels or expanding formations). Volume contraction confirms the volatility squeeze is genuine. The directional score gives real-time probability before the breakout occurs. The 5-factor strength score evaluates the breakout candle itself. And the measured-move TP/SL system manages the trade from entry through breakeven trail to final outcome.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Boundary-fit trendline algorithm.
The algorithm finds optimal upper and lower trendlines by exhaustive search over confirmed pivots:
Upper boundary: For every pair of pivot highs (A, B) within the lookback window:
— Project a line through A and B
— Check all other pivot highs: none may exceed the line by more than deviationMax × ATR (no overshoots beyond tolerance)
— Count how many pivot highs fall within touchTolerance × ATR of the line (touches)
— Keep the pair with the most touches
Lower boundary: Same process for pivot lows — no undershoot beyond tolerance, maximize touches.
A trendline is projected via: y = y1 + (y2 − y1) × (x − x1) / (x2 − x1). The touch tolerance (default 0.15× ATR) and deviation maximum (default 0.3× ATR) are both ATR-normalized, adapting to the instrument's volatility.
The scan runs on new pivots and every 10 bars (configurable interval), testing up to 15 recent pivots per side — producing the objectively best-fitting converging channel from available data.
2️⃣ Multi-criteria channel validation.
A detected channel must pass all five checks:
— 📏 Convergence : the channel is narrowing — current width < starting width. Convergence rate = 1 − (widthNow / widthStart) ≥ minConvergence (default 0.02 = at least 2% narrower)
— 📐 Width range : current width ≥ minChannelWidth × ATR (not too thin) AND < 10× ATR (not too wide)
— 📊 Volume contraction (when enabled): average volume inside the channel < 85% of average volume before the channel — confirms the volatility squeeze is accompanied by declining participation
— 📍 Price position : previous bar's close is inside the channel (not already broken out)
— ⚡ No inversion : upper boundary > lower boundary at the current bar
3️⃣ 5-factor breakout strength scoring (0–100).
When price closes beyond a channel boundary:
— 📏 Penetration depth (25%) : (close − boundary) / ATR, normalized to 0–1 (capped at 2× ATR). Deeper penetration = stronger commitment.
— 📊 Body ratio (15%) : candle body / candle range. Full-body candles (small wicks) indicate conviction. Doji/pin bars = weak.
— 📍 Body commitment (15%) : body midpoint beyond the boundary = 1.0, inside channel = 0.3. Full body commitment means the entire candle moved through, not just a wick.
— 📈 Volume confirmation (25%) : volume > SMA(20) × volumeSpikeMult = 1.0, otherwise 0.4. Above-average volume on the breakout bar confirms institutional participation.
— 💪 Momentum confirmation (20%) : RSI(14) > 50 for bullish (or < 50 for bearish) = 1.0, otherwise 0.4.
Classification: Strong (≥ 65), Medium (35–65), Weak (< 35). The strength is displayed on the breakout label and in the dashboard.
4️⃣ Directional probability scoring (0–100) while inside channel.
Before the breakout occurs, the indicator provides a real-time directional score:
— 📐 Channel slope bias (35%) : midline slope normalized by ATR — upward-sloping channels bias bullish, downward bias bearish
— 📊 RSI bias (35%) : (RSI − 50) / 50 — momentum direction
— 📍 Position in channel (30%) : (close − lower) / width — price near upper boundary biases bullish, near lower biases bearish
Score > 60% = bullish lean, < 40% = bearish lean, 40–60 = neutral. Displayed in the dashboard as "Bull Prob" — gives you a heads-up before the breakout direction is confirmed.
5️⃣ Measured-move TP/SL with trailing to breakeven.
On breakout:
— Target = breakout boundary + channel maximum width (the classic measured-move projection)
— TP1 = entry + fullMove / 3
— TP2 = entry + fullMove × 2/3
— TP3 = entry + fullMove (full measured move)
— SL = opposite channel boundary ± ATR padding (configurable, default 0)
After TP1 is hit, the SL moves to breakeven (entry price) — the entry label updates to show "(SL → BE)" and the original SL label dims. Trade stays open until TP3 (full measured move) or SL is reached. TP/SL labels show percentage distance from entry and update with ✓ / ✗ markers on hit. SL has priority on same-bar conflicts (SL checked before TPs).
6️⃣ Win/loss tracking with historical statistics.
The indicator tracks: total patterns detected, bull/bear breakout counts, wins (TP1 hit before SL), losses (SL hit before TP1), and win rate — all displayed in the dashboard. Two display modes: "All" (full history of all channels and trades) or "Last Only" (clean chart showing only the most recent pattern + trade, automatically cleaned up when a new pattern is detected).
7️⃣ Channel visualization with breakout color shift.
Before breakout: neutral channel lines (configurable color, default yellow) with optional fill. On bullish breakout: lines and fill shift to green. On bearish breakout: lines shift to red. Channel timeout (max width bars with no breakout) resets the scanner to look for new patterns.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Pivot detection: ta.pivothigh/ta.pivotlow with configurable lookback. Pivots stored in arrays (up to 60 recent, capped).
Step 2 — Boundary-fit scan: On new pivot or every 10 bars (if no active channel and no open trade): test all pairs of pivot highs for upper boundary, all pairs of pivot lows for lower boundary. Select best-fit lines by maximum touches.
Step 3 — Channel validation: Convergence rate ≥ minimum, width within range, volume contraction passes, price is inside, no inversion → channel activated.
Step 4 — Inside-channel monitoring: Directional probability score updated each bar. Channel lines extend. Background optional.
Step 5 — Breakout detection: Close beyond boundary + bar confirmed → 5-factor strength scoring → signal + TP/SL placement → channel lines recolored.
Step 6 — Trade tracking: TP1/TP2/TP3 and SL hit detection with SL priority. TP1 hit → trailing SL to breakeven. TP3 or SL → trade closed, channel reset, scanner resumes.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — it scans for converging channels automatically
2. Yellow channel lines appear when a valid pattern is detected
3. Dashboard shows "Active" + "Bull Prob" percentage
4. On breakout → "Long"/"Short" label + Entry/SL/TP1–TP3 lines appear
5. TP1 hit → SL moves to breakeven. TP3 → trade complete.
👁️ Reading the chart:
— 🟡 Channel lines = active converging pattern (pre-breakout)
— 🟢 Channel turns green = confirmed bullish breakout
— 🔴 Channel turns red = confirmed bearish breakout
— 🟢 "Long" / 🔴 "Short" label = confirmed breakout signal with strength
— 🔵 Blue line = entry, 🔴 red = SL, 🟢 green dashed = TP1/TP2/TP3
— ✓ on TP labels = target hit, ✗ on SL = stopped out
📊 Dashboard fields:
— Pattern: Active / Bull Break / Bear Break / Scanning
— Strength: Strong / Medium / Weak (5-factor score)
— Trade: Active / TP1 ✓ (BE) / TP2 ✓ / TP3 ✓ / SL Hit
— Bull Prob: directional probability (0–100%) while inside channel
— R:R (TP1): risk-to-reward ratio
— Touches: upper/lower boundary touch counts
— Vol Contraction: in-channel vs pre-channel volume ratio
— Convergence: narrowing rate percentage
— Patterns / Breaks / Win Rate: cumulative statistics
🔧 Tuning guide:
— No patterns found: decrease Min Touches (2), increase Max Channel Width (150+), decrease Min Convergence (0.01)
— Too many weak patterns: increase Min Touches (3), increase Min Channel Width ATR (0.7+)
— Weak breakouts: increase Volume Spike Mult (1.5+), enable Momentum Confirmation
— SL too tight: increase SL Padding (0.2–0.3 ATR)
— Want clean chart: set Pattern History to "Last Only"
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Pivot Detection Length (default 5): swing lookback
— Min Touches (default 2): pivots per boundary
— Max Channel Width (default 120 bars): lookback limit
— Min Convergence Rate (default 0.02): narrowing threshold
🔍 Filters:
— Volume Spike Mult (default 1.2): breakout bar volume requirement
— Volume Contraction (default On): require declining volume in channel
— Momentum Confirmation (default On): RSI alignment
🛡️ Risk:
— SL Padding (default 0 ATR): buffer beyond opposite boundary
— Label Offset (default 20 bars): right-side level label distance
🔧 Advanced:
— Touch Tolerance (default 0.15 ATR): pivot proximity to trendline
— Max Deviation (default 0.3 ATR): maximum pivot overshoot
— Min Channel Width (default 0.5 ATR): filter out thin channels
📐 Channel Lines:
— Show Channel Fill (default On), color and width configurable
🔔 Alerts
— 🟢 BUY / 🔴 SELL — breakout with strength, entry, SL, TP1–TP3
— 🟡 PATTERN DETECTED — new channel found
— 🎯 TP1 / TP2 / 🏆 TP3 HIT — trade progress
— 🛑 SL HIT — stopped out
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All breakout signals require barstate.isconfirmed. Channel detection runs on confirmed pivots (equal left/right lookback). The boundary-fit algorithm selects the best trendlines from historical pivots — the resulting lines are objective and reproducible.
— 📐 The boundary-fit algorithm tests all valid pivot pairs (up to 15 per side) and selects the combination with the most touches that satisfies the deviation constraint. This is an exhaustive search, not a linear regression — it produces the tightest-fitting boundary lines possible from the data.
— ⚖️ The measured-move target (channel width projected from breakout) is the classic technical analysis projection for converging patterns. TP1/TP2/TP3 divide this move into thirds: TP1 = 33%, TP2 = 67%, TP3 = 100% of the projected move.
— 📊 Volume contraction compares average volume inside the channel vs before the channel over the same number of bars. A ratio below 85% confirms genuine volatility compression.
— 🔒 Once a breakout fires, the trade stays open until TP3 or SL is reached — there is no intermediate invalidation. The channel remains active while the trade is open. Channels without a breakout timeout after the max channel width in bars.
— 📏 SL priority: on a bar where both SL and TP are touched, SL is checked first . After TP1, SL moves to breakeven (entry price).
— 🛠️ This is a pattern detection and breakout scoring tool , not an automated trading bot. It identifies converging channels, scores breakouts, and sets measured-move targets — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume features auto-adapt to instruments without volume data. Indicator

Flag Breakout Forecasts [AlgoAlpha]🟠 OVERVIEW
This indicator detects converging price channels — commonly called flags or wedges — directly on the chart using a zigzag-based pivot detection algorithm. It identifies three collinear pivot points on both the highs and the lows to confirm a valid channel, then monitors the channel in real time for a breakout.
Beyond just drawing the channel, the script assigns probabilistic forecasts to each active pattern. It uses the historical distribution of past breakout durations and directions to estimate the likelihood of an imminent breakout, whether that breakout will be bullish or bearish, and adjusts those estimates using live volume data accumulated inside the pattern.
A supplemental volume table and a net-volume gauge render alongside each detected pattern, giving traders a second lens into the supply-and-demand balance before a move resolves.
🟠 CONCEPTS
Zigzag — A filtered sequence of alternating swing highs and swing lows. Pivots are confirmed only after a user defined bars on each side, so shorter user defined values capture minor swings and larger values require more significant price moves.
Collinearity check — Given three pivot points, the script projects a straight line from the first to the third and measures how far the middle pivot deviates from it, expressed as a percentage of price. If the deviation falls below the tolerance threshold, the three pivots are treated as lying on the same trendline.
Converging channel — A pair of trendlines (one through swing highs, one through swing lows) where the gap between them narrows from left to right. This geometry distinguishes flags and symmetric wedges from parallel channels.
Early detection — When one trendline is confirmed but the other lacks a third pivot, the script uses the current running extreme (an unconfirmed potential pivot) as a temporary third point. The resulting line is drawn dashed and upgrades to solid when the pivot is confirmed.
Breakout confirmation — A break is logged after the close exits the projected channel boundary for two consecutive bars, or immediately when the breakout candle body extends well beyond the boundary and its body size is at least 3 standard deviations above the 20-bar mean body length.
Normal CDF approximation — Breakout duration probabilities are derived using the Abramowitz and Stegun rational approximation to the standard normal cumulative distribution function, applied to z-scores computed from the historical distribution of past breakout durations.
Net volume ratio — Bullish volume (up-close bars) minus bearish volume (down-close bars), divided by total volume, mapped to a −100 to +100 scale. Used to tilt the directional probability estimate away from the purely historical base rate.
🟠 FEATURES
Automatic channel detection — Channels are drawn the moment three collinear pivots are confirmed on each side with matching alignment and convergence.
• Solid lines for fully confirmed channels.
• Dashed lines for the side that is still waiting on a third confirmed pivot.
Probabilistic overlay label — Displayed above each active channel.
• P(break): probability that a breakout will occur soon, based on how the current pattern duration compares to historical durations.
• P(bull) / P(bear): directional probabilities derived from historical breakout directions and blended with live net volume.
Net volume gauge — A color-gradient vertical bar drawn to the right of the last candle, with a pointer showing whether up-close or down-close volume dominates the current pattern.
Volume statistics table — Shows bullish volume, bearish volume, net volume, total volume, ATR, and pattern duration for the most recent active pattern. Cell background intensity scales with volume magnitude.
Breakout signals — Arrow labels mark the breakout bar with the direction, total volume absorbed, and the number of bars the pattern lasted.
Background highlight — A subtle background color appears on the bar when a new pattern is first detected. To help users know the exact time the pattern was detected
🟠 HOW TO USE
Adjust len to match the swings you trade — lower values (3–5) for intraday patterns, higher values (10–20) for swing or position setups.
Tighten collinearity tolerance to 0.1–0.2% if you want only very clean trendline alignments; loosen it toward 1% if you want the indicator to catch more approximate formations.
Watch the dashed channel side — it signals an early, unconfirmed pattern. Treat it as a warning rather than a confirmed setup, and wait for it to turn solid before acting.
Check P(break) in the label — a reading above 70% means the current pattern has already lasted longer than most historical patterns, suggesting a resolution is statistically overdue.
Use P(bull) and P(bear) alongside the volume gauge — when P(bull) is elevated and the gauge leans bullish, the two signals agree on direction. Disagreement between them calls for extra caution.
Reference the volume table's net row — persistently positive net volume during a bearish-looking wedge can indicate absorption of selling pressure and a possible upside resolution.
Set alerts for "Pattern formed," "Bullish breakout," "Bearish breakout," and the strong-break variants to monitor multiple instruments without watching the chart continuously.
🟠 CONCLUSION
Flag Breakout Forecasts detects converging price channels using zigzag pivot collinearity and geometric validation, then layers on probabilistic duration and direction estimates derived from each instrument's own historical breakout data. The result is a self-calibrating pattern tool that combines structural chart analysis, volume profiling, and statistical inference in a single overlay. Indicator

Candle DNA Strand█ CANDLE DNA STRAND
A unique lower-panel indicator that visualizes candle structure as a stylized double-helix pattern. One strand represents body dominance (open-close range) while the other represents wick proportion (shadow-to-body ratio). The strands twist around a center axis with color encoding for bullish/bearish bias, revealing candle character patterns over time in an intuitive DNA-inspired format.
█ CONCEPT
Traditional candlestick analysis focuses on individual candle patterns. The Candle DNA Strand takes a different approach by decomposing every candle into two core metrics and plotting them as intertwined waves:
• Body Strand — Measures how much of each candle is "body" (the filled portion between open and close). High body ratios indicate conviction and directional commitment.
• Wick Strand — Measures how much of each candle is "shadow" (upper and lower wicks combined). High wick ratios indicate rejection, indecision, or failed attempts at direction.
These two strands are phase-offset by 180° to create the classic double-helix DNA appearance. As you scroll through the chart, you can visually identify periods of conviction (body-dominant) versus indecision (wick-dominant), and how candle character evolves over time.
█ HOW IT WORKS
The indicator calculates two normalized ratios for each candle:
Body Ratio = |Close - Open| / (High - Low)
Wick Ratio = (Upper Wick + Lower Wick) / (High - Low)
These ratios are smoothed and then modulated onto sine waves that twist around a center axis at the 50 level. The amplitude of each strand reflects the strength of that metric — larger bodies push the body strand further from center, and larger wicks push the wick strand further out.
The strands are color-coded by the current candle's bias:
• Bullish candles (close ≥ open) → Neon green tones
• Bearish candles (close < open) → Neon red tones
█ TRADE ZONES
The indicator includes an optional Trade Zone detection system based on candle character analysis:
◉ LONG ZONE (Green Background)
Triggers when:
• Average body ratio exceeds the Body Dominance Threshold (default 65%)
• Bullish momentum score > 40% (more bulls than bears in lookback period)
• Average wick ratio below the Wick Rejection Threshold (default 55%)
This identifies periods where price is moving up with conviction — strong bullish bodies with minimal rejection wicks.
◉ SHORT ZONE (Red Background)
Triggers when:
• Average body ratio exceeds the Body Dominance Threshold
• Bearish momentum score > 40% (more bears than bulls in lookback period)
• Average wick ratio below the Wick Rejection Threshold
This identifies periods where price is moving down with conviction — strong bearish bodies with minimal rejection wicks.
◉ CHOP/INDECISION
When the average wick ratio exceeds 60%, the market is showing high rejection and indecision. The DNA strands will show wick dominance during these periods.
Triangle markers appear at zone entry points:
• ▲ Green triangle below the helix = Long zone entry
• ▼ Red triangle above the helix = Short zone entry
█ VISUAL ELEMENTS
DNA Strands
Two intertwined lines representing body and wick ratios, twisting around the center axis with a configurable wavelength.
Base Pair Connectors
Vertical lines connecting the two strands at regular intervals, mimicking the "rungs" of a DNA ladder. These help visualize the spread between body and wick metrics.
Nucleotide Nodes
Small circular markers along each strand showing individual data points.
Fill Zone
Subtle gradient fill between the strands for visual depth. The fill color matches whichever strand is currently on top.
Info Label
Displays current values at the right edge of the chart:
• Current bias (BULL/BEAR)
• Body and Wick percentages
• Active trade zone (if any)
█ PATTERN DETECTION
The indicator automatically detects significant candle patterns based on DNA metrics:
DOJI — Body ratio < 15%
Very small body relative to total range. Indicates indecision.
MARUBOZU — Body ratio > 85%
Almost no wicks. Strong conviction candle with price closing near the high (bullish) or low (bearish).
HAMMER — Wick ratio > 60% with lower wick > 2× upper wick
Long lower shadow showing rejection of lower prices.
SHOOTING STAR — Wick ratio > 60% with upper wick > 2× lower wick
Long upper shadow showing rejection of higher prices.
█ SETTINGS
DNA Helix Settings
• Helix Wavelength — Number of bars for one complete DNA twist cycle (default: 20)
• Helix Amplitude — Vertical spread of the strands from center (default: 35)
• Show Base Pair Connectors — Toggle the connecting rungs (default: On)
• Connector Frequency — Draw a connector every N bars (default: 2)
• Data Smoothing — SMA length for smoothing ratios (default: 3)
• Strand Thickness — Line width for the DNA strands (default: 2)
Trade Zone Settings
• Show Trade Zones — Toggle background highlighting and entry signals (default: On)
• Zone Lookback — Bars to analyze for zone detection (default: 5)
• Body Dominance Threshold — Minimum avg body ratio for zone trigger (default: 0.65)
• Wick Rejection Threshold — Maximum avg wick ratio for zone trigger (default: 0.55)
Fluorescent Colors
• Bullish colors — Neon green and electric green variants
• Bearish colors — Neon red and hot pink variants
• Axis, connector, and zone colors are all customizable
Visual Settings
• Show Nucleotide Nodes — Toggle the small circles on strands (default: On)
• Show Info Labels — Toggle the right-side information label (default: On)
• Show DNA Analysis Table — Toggle detailed analysis table (default: Off)
█ ALERTS
Four alert conditions are available:
1. Long Zone Entry
"Entered LONG zone - strong bullish momentum with conviction candles"
2. Short Zone Entry
"Entered SHORT zone - strong bearish momentum with conviction candles"
3. Doji Pattern
"Doji detected - indecision"
4. Marubozu Pattern
"Marubozu detected - strong conviction"
█ INTERPRETATION GUIDE
Reading the DNA:
When body strand dominates (further from center):
• Market is moving with conviction
• Candles have strong bodies, minimal wicks
• Trend is likely to continue
When wick strand dominates (further from center):
• Market is showing rejection/indecision
• Candles have long shadows relative to bodies
• Potential reversal or consolidation
Strand crossovers:
• When strands cross, character is shifting
• Body crossing above wick → increasing conviction
• Wick crossing above body → increasing indecision
Color consistency:
• Long stretches of green → sustained bullish pressure
• Long stretches of red → sustained bearish pressure
• Alternating colors → choppy, mixed market
█ BEST PRACTICES
1. Use with price context — The DNA strand shows candle character, not direction. Combine with price action on the main chart.
2. Adjust wavelength to timeframe — Shorter wavelengths (10-15) for scalping, longer wavelengths (25-40) for swing trading.
3. Trade zones are filters, not signals — Use zone entries as confirmation for your existing strategy, not as standalone signals.
4. Watch for character shifts — When the dominant strand changes, market behavior is changing. This often precedes reversals.
5. Multiple timeframe analysis — Check DNA character on higher timeframes to understand the broader context.
█ CREDITS
Developed by Hash Capital Research
Pine Script™ v6
This indicator is provided for educational and informational purposes. Always conduct your own analysis and manage risk appropriately. Indicator

Indicator

Pattern Recognition Signals | ProjectSyndicatePattern Recognition Signals automatically identifies and validates high-probability, non-repainting Double Top and Double Bottom patterns. It filters for structural quality, calculates adaptive take-profit and stop-loss zones based on Average Daily Range (ADR), and presents a complete statistical breakdown on a non-intrusive dashboard to provide a quantifiable edge.
🧠 NRP Multi-Wave Detection — identifies classic Double (W/M) and Triple (W/M) patterns using a non-repainting pivot engine, ensuring signals are confirmed and stable.
🎯 ADR-Adaptive TP/SL Zones — automatically calculates and plots TP1, TP2, and SL zones based on a percentage of the 10-day ADR, allowing the strategy to dynamically adapt to any asset's volatility.
🎨 Direction-Matched Colors — Bullish pattern labels are colored green to match the TP zones, and Bearish labels are colored red to match the SL zone, providing instant visual confirmation of trade direction.
📊 Full Performance Dashboard — provides a complete statistical overview, including the real-time ADR10 value, total signals, win rates for TP1/TP2, and a log of the last 10 trade outcomes.
✅ Advanced Quality Control Filters — user-configurable inputs for Max Pattern Bars, Max Pattern Height (% of ADR10), and Min Bars Between Signals eliminate low-quality or excessively large patterns and prevent over-signaling.
🔔 Comprehensive Alerts — get a single, detailed alert per signal—including the symbol, timeframe, entry price, SL, TP1, and TP2—formatted for easy integration with automated trading systems.
🔧 Fully Customizable — control everything from pivot lengths and pattern quality filters to the colors and extension of all zones, labels, and dashboard elements.
🎯 Why this algo is unique: Standard ZigZag and pattern indicators are notorious for repainting and providing subjective signals with no statistical backing. This algorithm provides an objective, fully-gated, non-repainting signal engine. It doesn’t just draw a pattern; it builds a complete, quantifiable trading framework around it with adaptive risk management (ADR-based zones) and a dashboard to prove its historical performance on the chart you are trading.
🚀 Apply to Gold (XAUUSD), Forex, Crypto, and Indices on any M5/M10/M15/M30/H1. The ADR-based system and extensive quality filters allow it to adapt to anything from M5 scalping to H4 swing trading.
🎯 How to use this? Use the dashboard to understand the strategy's recent performance on the current asset/timeframe. Adjust the TP/SL and pattern filter percentages to match your risk tolerance. Consider taking trades that align with the higher-timeframe trend for higher probability setups.
⚠️ IMPORTANT NOTICE: This indicator is designed to identify statistically-backed pattern signals. It should NOT be used as a standalone signal for entering trades. Always use it in conjunction with your own trading strategy, price action analysis, and other technical indicators to confirm trade setups and manage risk. Indicator

Indicator

Quasimodo (QML) Pattern [UAlgo]Quasimodo (QML) Pattern is a market structure pattern detector that identifies Quasimodo formations using confirmed swing pivots and then visualizes the full structure directly on the chart. The Quasimodo concept is often described as a stop run and reversal model where price first violates a prior swing point, then breaks structure in the opposite direction. This script formalizes that idea into a strict pivot sequence and draws the key structural components so the pattern can be reviewed consistently.
The indicator maintains a rolling history of pivot highs and pivot lows, then checks the most recent four pivots for a valid Quasimodo sequence. When a bullish or bearish QML is confirmed, the script draws a connected structure, highlights the pattern area with a fill, plots a Market Structure Break reference line, and marks a QML zone derived from the left shoulder and the head. The most recent pattern zone is extended forward to keep it visible for potential retests.
This tool is intended to support structured analysis of reversal setups, with visual anchors that make it easy to locate left shoulder, reaction, head, and MSB points without manual drawing.
🔹 Features
1) Pivot Based Swing Engine
The script uses pivot highs and pivot lows to define swings. Left Bars and Right Bars control how many bars are required to confirm each pivot. This creates stable swing points and reduces noise compared to raw candle comparisons.
Confirmed pivots are stored as PivotPoint objects with price, bar index, and direction (high or low). The pivot history is capped to keep memory efficient while retaining enough context for detection.
2) Strict Four Pivot Pattern Validation
Detection uses the most recent four pivots, enforcing an alternating sequence so the structure follows a zig zag pattern. Only sequences that alternate high and low consistently are eligible for classification.
This avoids false detections where multiple highs or multiple lows occur in a row.
3) Bullish QML Detection Logic
The bullish model requires:
Left shoulder is a low
Reaction is a high
Head is a lower low than the left shoulder
MSB is a higher high than the reaction
This represents a liquidity grab below the prior swing low followed by a break above the reaction high, which is treated as the structure break confirmation.
4) Bearish QML Detection Logic
The bearish model requires:
Left shoulder is a high
Reaction is a low
Head is a higher high than the left shoulder
MSB is a lower low than the reaction
This represents a liquidity grab above the prior swing high followed by a break below the reaction low.
5) Full Pattern Visualization with Structural Labels
When a pattern is detected, the script draws:
Three visible connector lines linking left shoulder to reaction, reaction to head, and head to MSB
A filled highlight over the core structure area to emphasize the liquidity grab geometry
Point labels at left shoulder, head, and MSB for quick reading
A descriptive pattern label showing Bullish QML or Bearish QML
Visual styling, colors, and label sizing are user configurable.
6) MSB Break Reference Line
A dotted horizontal line is drawn from the reaction point to the MSB point at the reaction price level. This acts as a clear market structure break reference and helps validate that the break level was actually exceeded in the required direction.
7) QML Zone Projection
The script draws a QML zone box that spans the price range between the left shoulder and the head. This zone is extended forward in time so it remains visible for potential retests and reactions.
8) Efficient Execution and Update Behavior
Pattern checks run only when a new pivot is confirmed, reducing repeated evaluation. The script also extends the most recent QML zone and repositions the main label forward for better ongoing visibility.
🔹 Calculations
1) Pivot Detection
Pivot highs and pivot lows are confirmed using Left Bars and Right Bars:
float ph = ta.pivothigh(leftLen, rightLen)
float pl = ta.pivotlow(leftLen, rightLen)
When a pivot is confirmed, the bar index is aligned to the pivot location using the rightLen offset:
if not na(ph)
pivotArray.pushPivot(ph, bar_index , true)
if not na(pl)
pivotArray.pushPivot(pl, bar_index , false)
Each pivot is stored as:
price
index
isHigh flag
2) Alternating Sequence Requirement
The script evaluates the last four pivots p0 through p3 and requires strict alternation:
bool correctSequence =
(p0.isHigh != p1.isHigh) and (p1.isHigh != p2.isHigh) and (p2.isHigh != p3.isHigh)
This ensures the sequence forms a valid zig zag structure.
3) Bullish Quasimodo Conditions
Bullish QML is evaluated when p0 is a low:
if not p0.isHigh
if p2.price < p0.price and p3.price > p1.price
Quasimodo qml = Quasimodo.new(p0, p1, p2, p3, true)
Interpretation:
Head is a lower low relative to the left shoulder
MSB is a higher high relative to the reaction
This produces a sweep and reversal structure with confirmation
4) Bearish Quasimodo Conditions
Bearish QML is evaluated when p0 is a high:
if p0.isHigh
if p2.price > p0.price and p3.price < p1.price
Quasimodo qml = Quasimodo.new(p0, p1, p2, p3, false)
Interpretation:
Head is a higher high relative to the left shoulder
MSB is a lower low relative to the reaction
5) Pattern Drawing Components
When a pattern is confirmed, the script draws connecting lines:
line.new(LS.index, LS.price, R.index, R.price)
line.new(R.index, R.price, H.index, H.price)
line.new(H.index, H.price, MSB.index, MSB.price)
It also draws a horizontal MSB reference at the reaction price:
line.new(reaction.index, reaction.price, msb.index, msb.price, style=line.style_dotted)
A QML zone box is created using left shoulder and head prices and extended forward:
qml.qmlZone := box.new(LS.index, LS.price, bar_index + 10, H.price, bgcolor=color.new(col, 85))
On each bar, the most recent zone is extended further to remain visible:
box.set_right(lastQml.qmlZone, bar_index + 5)
label.set_x(lastQml.lbl, bar_index + 5)
6) Pivot History Management
To keep execution efficient, the pivot array is capped:
if pivots.size() > 50
pivots.shift()
Pattern checking is triggered only when a new pivot is found, which reduces redundant processing on bars where no structural update occurred. Indicator

Accumulation Zone Profiles [UAlgo]Accumulation Zone Profiles is an overlay indicator that detects low volatility accumulation phases and automatically builds a fixed range volume profile for each confirmed zone. The script uses a statistical volatility model based on log returns, identifies periods where volatility compresses into an unusually quiet regime, then verifies that price action remains sufficiently sideways before confirming the zone.
When a zone is confirmed, the indicator draws two complementary views:
A highlighted accumulation range on the chart
A fixed range volume profile drawn to the right of the zone, including Point of Control and Value Area levels
The intent is to turn consolidation into a structured map. Instead of treating ranges as vague rectangles, the script assigns a volume distribution to the range so you can see where the market accepted price, where it rejected price, and which levels are most likely to matter during expansion.
🔹 Features
1) Statistical Accumulation Detection Using Log Volatility
The detection engine starts from log returns r = ln(C / C ) and builds an EWMA based volatility estimate. Volatility is converted into log space and evaluated with a rolling distribution model. A z score determines whether the current volatility is unusually low relative to its own history.
Zones begin when the z score falls below a configurable entry threshold and they end after volatility recovers above an exit threshold for a configurable number of confirmation bars.
2) Sideways Quality Filter With Trend Score
Not every low volatility period is true accumulation. The script measures drift using a trend score defined as:
absolute sum of returns divided by sum of absolute returns
Lower values indicate more rotation and less directional drift. A maximum trend score filter ensures zones remain meaningfully sideways before a profile is created.
3) Non Repainting Option Using Confirmed Bars
When enabled, the system only updates on confirmed bars. This reduces repainting behavior and makes zone start and zone end decisions more stable for live trading workflows.
4) Fixed Range Volume Profile Per Zone
For each confirmed accumulation zone, the script builds a histogram of volume across a user selected number of price rows. Each bar’s volume is distributed into bins according to how much of that candle range overlaps each bin. This produces a true fixed range profile for the zone.
The profile is drawn to the right of the zone so it does not cover price action.
5) Point of Control and Value Area Levels
The highest volume row is treated as the Point of Control. Value Area High and Value Area Low are computed by expanding outward from POC until a target percent of total volume is captured. This creates a practical acceptance framework inside the zone.
Optional plotting allows:
Highlighting the POC row
Drawing VAH and VAL lines
Drawing zone boundary guides
Showing an information label that summarizes zone statistics
6) Tick Alignment For Clean Levels
If enabled, the zone range, bin step size, and derived levels are aligned to the instrument tick size. This produces cleaner price levels and reduces floating point noise in labels and lines.
7) Object Budget Management
Volume profiles use many boxes. The script computes an effective rows value based on the number of profiles you choose to keep, then limits total box usage so you are less likely to hit platform object limits. Older profiles are deleted automatically when new ones are created.
8) Alerts
Two alerts are available:
Accumulation Zone Started
Accumulation Zone Confirmed and Profile Created
This supports automation such as watchlist monitoring and breakout preparation.
🔹 Calculations
1) Log Return and EWMA Variance
The script defines log return as ln(C / C ) and uses an EWMA of squared returns as a variance proxy.
Alpha for EWMA:
f_alpha(int len) =>
2.0 / (len + 1.0)
Log return:
lr = math.log(close / close )
lr := na(close ) or close == 0.0 ? 0.0 : lr
EWMA variance and volatility:
alphaFast = f_alpha(fastLen)
var float ewmaVarR = na
ewmaVarR := na(ewmaVarR ) ? lr * lr : alphaFast * (lr * lr) + (1.0 - alphaFast) * ewmaVarR
vol = math.sqrt(math.max(ewmaVarR, 0.0))
2) Log Volatility Distribution and z Score
Volatility is transformed into log space to stabilize distribution behavior. The script maintains EWMA estimates of mean and second moment, then computes standard deviation and z score.
eps = 1e-10
logVol = math.log(vol + eps)
alphaDist = f_alpha(distLen)
var float m1 = na
var float m2 = na
m1 := na(m1 ) ? logVol : alphaDist * logVol + (1.0 - alphaDist) * m1
m2 := na(m2 ) ? logVol * logVol : alphaDist * (logVol * logVol) + (1.0 - alphaDist) * m2
sigma = math.sqrt(math.max(m2 - m1 * m1, eps))
z = (logVol - m1) / sigma
Interpretation:
Negative z means volatility is below its typical level
More negative z means stronger compression
3) Zone Start and Zone End Conditions
Entry and exit logic uses the z score relative to thresholds:
Start when z is less than or equal to minus Enter Threshold
End when z is greater than or equal to minus Exit Threshold for Exit Confirm Bars
lowNow = not na(z) and z <= -enterZ
highNow = not na(z) and z >= -exitZ
Exit confirmation counter:
zb.exitCount := highNow ? zb.exitCount + 1 : 0
bool exitByConfirm = zb.exitCount >= exitBars
A maximum zone duration also forces closure:
bool exitByMax = zb.barCount() >= maxZoneBars
If exit is triggered via confirmation bars, the script removes those last bars from the zone before profiling to avoid contaminating the accumulation range with the volatility recovery phase.
4) Sideways Drift Score Filter
During zone building, returns are accumulated:
sumR is the signed drift
sumAbsR is total movement magnitude
Trend score:
method driftScore(ZoneBuilder this) =>
math.abs(this.sumR) / math.max(this.sumAbsR, 1e-10)
A zone is accepted only if:
Bar count is at least Min Zone Bars
Drift score is less than or equal to Max Trend Score
5) Profile Range and Row Step
Once accepted, the profile range is built from the min low and max high of the zone. The range is optionally aligned to tick.
Step size equals range divided by rows, with optional tick alignment:
float stepRaw = (hi - lo) / rows
float step = stepRaw
if alignTick
step := math.max(syminfo.mintick, f_roundToTick(stepRaw))
6) Volume Histogram Construction
For each bar in the zone, volume is assigned into bins.
If the candle range is very small, volume goes to a single nearest bin.
Otherwise, volume is distributed proportionally by overlap between candle range and each bin range.
Core proportional distribution logic:
float overlap = math.max(0.0, math.min(bh, binHi) - math.max(bl, binLo))
if overlap > 0
float frac = overlap / br
array.set(binVol, b, array.get(binVol, b) + bv * frac)
This produces binVol, a per row volume distribution.
7) POC Calculation
POC is the index of the maximum bin volume. POC price is the center of that row.
if v > maxV
maxV := v
pocIdx := b
float poc = lo + (pocIdx + 0.5) * step
8) Value Area Computation
Value Area is derived by expanding outward from POC until the cumulative volume reaches Value Area percent of total volume.
Target volume:
float target = totV * (valueAreaPct / 100.0)
Expand left and right by choosing the side with higher next volume until the target is met. This creates a contiguous value area band.
VAL and VAH mapping to prices:
float valP = lo + left * step
float vahP = lo + (right + 1) * step
9) Rendering Logic
Zone highlight is drawn directly over the accumulation period using a box with configurable fill and border transparency.
The volume profile is drawn as a stack of boxes to the right of the zone. Each row width is proportional to row volume relative to max row volume. Transparency is mapped so high volume rows appear more prominent.
POC row can be highlighted using a dedicated color and transparency configuration.
VAH and VAL can be drawn as horizontal lines across the profile region, and optional boundary lines can mark the start and end of the detected zone.
10) Profile Retention and Cleanup
Profiles are stored in an array. When the number of stored profiles exceeds Keep Last Profiles, the oldest profile is deleted and all of its objects are removed. This keeps the chart responsive and prevents reaching the platform maximum object counts. Indicator

Automatic Trendline [Metrify]Metrify Automatic Trendlines is an auto-drawing support/resistance channel built around pivot clustering + scoring, not “connect two perfect points”. The script continuously collects swing pivots (high/low) over a configurable lookback window, then searches for the best single support line and the best single resistance line that behave like a human-drawn trendline: multiple interactions, controlled slope, limited break-throughs, and (most importantly) still relevant to the current price. (configurable in "Max Relevance Distance" input)
The fundamental problem with algorithmic trendlines is subjectivity. To solve this mathematically, we treat trendlines as a statistical regression problem with specific constraints. We do not use linear regression on all candles, instead, we use a brute-force iterative approach on specific "Pivot Points."
The logic operates on a simple premise: Generate every possible line between past swing points, validate them against price history, score them based on fit, and render only the winner.
The Calculation Engine (f_find_best_line)
This function contains the primary computational load. It performs a nested loop operation:
Outer Loop (newer): Iterates through recent pivots.
Inner Loop (older): Iterates through older pivots to form a candidate line segment.
For every pair of pivots (P1,P2), we calculate the slope (m) and the y-intercept concept. This gives us a tentative trendline equation:
y=mx+c
The Scoring Matrix
We assign a score to each candidate line based on weighted heuristics:
Touch Count (touches * 2.8): The primary driver. More touches = higher statistical significance.
Recency (recency * 1.2): Lines originating closer to the current price action are weighted higher.
Tightness (avgErr): We calculate the average distance of all touches from the line. A "tighter" fit (lower error) increases the score.
Penalties:
violations * 2.2: False breaks heavily penalize the score.
barBreakRatio * 2.0: If the line cuts through candle bodies (even if pivots are fine).
The line with the highest localBest score is returned as the dominant trendline.
What you can use it for?
This is a structure visualizer that tries to keep a clean, current S/R channel on screen with volatility-aware rules. It’s not a signal generator, it doesn’t predict breakouts, and it won’t always draw something, if the market is messy and no line survives the filters, it will show none instead of hallucinating geometry. If you need more lines (multiple concurrent channels), that’s a different design tradeoff (and usually becomes clutter + false confidence fast). Indicator

Cup & Handle (Zeiierman)█ Overview
Cup & Handle (Zeiierman) is a classic continuation-pattern scanner that detects both bullish Cup+Handle and bearish Inverted Cup+Handle structures using a compact pivot stream. It’s designed to highlight rounded reversals back to a “rim” level, followed by a smaller pullback (“handle”) before a potential continuation move.
⚪ What It Detects
A Cup & Handle (Bull) forms when price makes a rounded decline from a left rim, bottoms, then climbs back to a similar right rim. After returning to the rim, price forms a handle (a smaller pullback) that stays within an allowed retracement range. This pattern often precedes a bullish continuation attempt.
An Inverted Cup & Handle (Bear) is the mirrored version. Price makes a rounded rise to a left rim, tops, then declines back to a similar right rim. After returning to that rim, price forms a handle (a smaller bounce) that stays within the allowed retracement range. This pattern often precedes a bearish continuation attempt.
█ How It Works
⚪ 1) Pivot Extraction (Swing Compression)
The script first converts raw candles into a small set of meaningful swing pivots using ta.pivothigh() and ta.pivotlow() with Pivot span. A pivot is accepted only after it is confirmed by the lookback window, which helps reduce noise.
Key effect:
Higher Pivot span = fewer, stronger pivots (cleaner patterns)
Lower Pivot span = more pivots (more patterns, more noise)
⚪ 2) Pattern Framing (4-Point Structure)
When at least four pivots exist, the script maps them into a fixed sequence:
For a bull Cup+Handle sequence: High → Low → High → Low
These are treated as:
L = left rim pivot
B = cup bottom pivot
R = right rim pivot
H = handle pivot
For a bear inverted Cup+Handle sequence: Low → High → Low → High
Mapped similarly, but inverted.
This “4-pivot” structure is the minimum shape needed to define a cup and a handle without overfitting.
⚪ 3) Rim Similarity Filter (Cup Quality Control)
The script checks if the left rim and right rim are close enough to be considered a proper cup rim:
Rim similarity tolerance (%) controls this.
Lower tolerance = only very clean symmetric rims
Higher tolerance = allows uneven rims (more detections)
⚪ 4) Handle Depth Filter (Reject Weak or Messy Handles)
The handle is validated by measuring how deep it retraces relative to the cup depth:
Handle Retraction = |rim − handle| / |rim − bottom|
The handle must fall between:
Handle retrace min
Handle retrace max
This prevents:
tiny “non-handle” wiggles (too shallow)
deep pullbacks that break the structure (too deep)
█ How to Use
⚪ Interpreting a Bull Cup & Handle
Treat it like a continuation setup built around a key breakout level:
Cup forms
Handle forms
Breakout happens above this level
Once price returns to this breakout zone and the handle stays controlled, the structure may attempt to continue upward.
Common behaviors after a clean signal:
Push above the breakout level
Brief retest/acceptance near the breakout zone
Continuation toward the projected target if momentum holds
⚪ Interpreting a Bear Inverted Cup & Handle
Treat it like a bearish continuation/rollover setup built around the same breakout concept:
Cup forms (inverted)
Handle forms
Breakout happens below this level
Once price returns to this breakout zone and the handle stays controlled, the structure may attempt to continue downward.
Common behaviors after a clean signal:
Drop below the breakout level
Retest from underneath
Continuation toward the projected target if selling pressure persists
█ Settings
Pivot span – pivot sensitivity. Higher = smoother pivots, fewer signals. Lower = more pivots, more signals/noise.
Rim similarity tolerance (%) – rim quality filter. Lower = stricter symmetry, higher = more permissive detection.
Handle retrace min – minimum handle depth (filters weak handles).
Handle retrace max – maximum handle depth (filters messy/deep handles).
Invalidation (handle max retrace %) – “maximum tolerated damage” for handle move before the structure is considered broken.
Require breakout confirmation – only trigger when price closes beyond the rim in the expected direction.
Target multiplier (× cup depth) – scales how far the projection target is. Lower = closer targets; 1.0 = classic depth target.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indicator

Indicator

Zig Zag ++ SG (Premium)🔥 Zig Zag ++ SG
Professional Market Structure & Cycle Analyzer
Zig Zag ++ SG is an advanced, research-grade market structure indicator built on top of a refined ZigZag engine, designed for traders and investors who want to understand price cycles, not chase candles.
This is not a buy-sell arrow tool.
It is a decision-support system used to analyze trend strength, exhaustion, pullback depth, and cycle behavior across any market and timeframe.
🧠 What Makes Zig Zag ++ SG Different?
Most ZigZag indicators only draw lines.
Zig Zag ++ SG answers the real questions:
Is the trend getting stronger or weaker?
Are higher highs still meaningful?
How deep are pullbacks in percentage terms?
Which stocks recover fast vs stay weak?
Is this accumulation, distribution, or reversal?
It does this by combining:
Market Structure (HH / HL / LH / LL)
Consecutive structure counting
Gain & fall percentage per swing
Clean visual logic (no repaint confusion)
📌 Core Features
✅ 1. Automatic Market Structure Detection
Labels every major swing as:
HH – Higher High
HL – Higher Low
LH – Lower High
LL – Lower Low
This instantly shows whether the market is:
Trending
Consolidating
Distributing
Reversing
✅ 2. Consecutive Structure Count (ON by default)
Each structure type is counted sequentially:
HH (1), HH (2), HH (3)…
HL (1), HL (2)…
This reveals:
Trend maturity
Exhaustion zones
Early breakdown warnings
Example:
HH (4) = trend may be overextended
HL (3) = healthy trend continuation
✅ 3. Gain & Fall % on Every Swing (ON by default)
Every HH, HL, LH, LL shows:
Exact % move from the previous pivot
This allows you to:
Compare pullback depth across stocks
Identify leaders (shallow HLs)
Spot weak stocks (deep HLs / LHs)
Study cycle symmetry
Example label:
HL (2)
-6.4%
✅ 4. Clean, Readable Visual Design
🟩 Green labels → White text
🟥 Red labels → High-contrast white text
Optional background trend shading (OFF by default)
Works perfectly in dark & light mode
Designed for long chart study sessions, not flashy screenshots.
✅ 5. Safe Repaint Logic (Transparent by Design)
Uses ZigZag logic intentionally
No fake “non-repainting” claims
Ideal for analysis, research & planning
What you see is structurally correct
This indicator is for thinking traders, not signal chasers.
⚙️ Best Settings (Recommended)
🔹 Intraday Trading
Timeframe: 5m / 15m
Depth: 8–10
Deviation: 3–5
Backstep: 2
🔹 Swing Trading (Most Popular)
Timeframe: Daily
Depth: 12–15
Deviation: 5
Backstep: 2
🔹 Long-Term / Investing
Timeframe: Weekly
Depth: 15–20
Deviation: 5–8
Backstep: 3
💡 Tip:
Lower depth = more swings
Higher depth = cleaner, major cycles
📈 How to Use Zig Zag ++ SG (Practically)
🔹 Trend Strength
HH (3+) + HL (2–3)
→ Strong, healthy trend
🔹 Exhaustion Warning
HH (4+)
→ Risk of distribution or slowdown
🔹 Pullback Quality
HL −3% to −7%
→ Strong stock
HL −12% to −20%
→ Weak hands / fragile trend
🔹 Reversal Confirmation
LH followed by LL (2+)
→ Trend change likely
🧪 Who Is This Indicator For?
✅ Swing traders
✅ Positional traders
✅ Long-term investors
✅ Market structure students
✅ Stock researchers
✅ Anyone tired of noisy indicators
❌ Not for:
People wanting instant buy/sell arrows
Scalpers chasing 1-minute signals
“Magic indicator” seekers
💎 Why This Is Worth Purchasing
Built with Pine Script v6 best practices
Solves real market questions
Helps avoid:
Buying late
Selling early
Holding weak stocks too long
Encourages process-driven trading
One-time learning tool you’ll use for years
Most traders lose money not because of entries —
but because they misread structure and cycles.
Zig Zag ++ SG fixes that. Indicator

4 Bar Sequential Counter (9 to 13) [DotGain]4-Bar Sequential Counter (Seq4)
This indicator identifies potential trend exhaustion phases using a strict sequential count
based on the relationship between the current closing price and the closing price four bars earlier.
How it works
• A bullish sequence is counted as long as the current close remains below the close from 4 bars ago.
• A bearish sequence is counted as long as the current close remains above the close from 4 bars ago.
• The count resets immediately if the respective condition is no longer met.
• The sequence counts up to a maximum of 13 , after which it resets and a new sequence may begin.
Visualization
• Only counts from 9 to 13 are displayed on the chart.
• Bullish sequences are plotted below price bars.
• Bearish sequences are plotted above price bars.
• The minimalist design keeps the chart clean and focused on potentially relevant exhaustion zones.
Interpretation
• A count of 9 may indicate an early sign of market overextension.
• A count of 13 represents a more advanced sequence and a higher probability
of consolidation or corrective price action.
• This indicator is not a standalone trading system and should be used in combination
with trend analysis, volume, and support/resistance levels.
Alerts
• Bullish sequence at 9
• Bullish sequence at 13
• Bearish sequence at 9
• Bearish sequence at 13
Disclaimer
This "4-Bar Sequential Counter (9–13)" (Seq4) indicator is provided for informational and educational purposes only. It does not, and should not be construed as, financial, investment, or trading advice.
This indicator is an independent implementation of a sequential counting method and is not affiliated with, or endorsed by any trademarked trading concepts or methodologies.
The signals generated by this tool (Green and Red) are the result of a specific set of algorithmic conditions. They are not a direct recommendation to buy or sell any asset.
All trading and investing in financial markets involves a substantial risk of loss. You can lose all of your invested capital.
Past performance does not guarantee future results.
This indicator highlights sequential price exhaustion patterns and may generate false, lagging, or incomplete signals. Markets can remain unpredictable longer than you can remain solvent.
The creator DotGain assumes no liability for any financial losses or damages you may incur, directly or indirectly, as a result of using this indicator or the information it provides.
You are solely responsible for your own trading and investment decisions. Always conduct your own research (DYOR), validate signals with other methods, and consider your personal risk tolerance before entering any trade.
Indicator

Smart Candlestick Pattern Filter [MarkitTick]💡 This Script is a sophisticated technical analysis tool designed to identify, grade, and display over 40 distinct candlestick formations based on a proprietary strength and context filtering system. Unlike standard pattern finders that often clutter charts with conflicting signals, this script utilizes a hierarchy logic to display only the most significant pattern detected on any given candle, ensuring chart clarity and actionable data.
● Originality and Utility
The primary utility of this script lies in its filtering engine. Standard indicators often flag every minor Doji or Spinning Top, creating noise. This indicator categorizes patterns into five distinct levels of strength, ranging from simple indecision to very strong reversal or continuation signals.
Furthermore, it incorporates a Trend Context filter, which checks the relationship between price and a Simple Moving Average (SMA). This ensures that reversal patterns (like Hammers) are prioritized during downtrends, while continuation patterns are highlighted during established moves, reducing false positives.
● Methodology
The indicator evaluates price action using specific ratios between the Open, High, Low, and Close, alongside the body size relative to the total range. It assigns a strength score to each detected pattern.
• Pattern Strength Grading
Strength 1 (Indecision): Includes patterns like Doji, Spinning Tops, Dragonfly, and Gravestone Dojis. These signal a pause in momentum.
Strength 2 (Weak): Includes patterns like Hanging Man, Inverted Hammer, Belt Holds, and In-Neck lines. These suggest potential movement but often require confirmation.
Strength 3 (Moderate): Includes classic reversals like Hammers, Shooting Stars, Haramis, Dark Cloud Cover, and Piercing Lines.
Strength 4 (Strong): Includes major signals like Engulfing patterns, Morning/Evening Stars, and Marubozu candles.
Strength 5 (Very Strong): Reserved for rare, high-probability multi-candle formations like Three White Soldiers, Three Black Crows, Rising/Falling Three Methods, and Breakaway gaps.
The script calculates all potential patterns for the current bar and then compares their strength scores. Only the pattern with the highest strength is displayed. If the Show Trend Context option is enabled, the script further validates the pattern against the current market direction (determined by the SMA and slope) before plotting.
● How to Use
Traders can use this tool to identify potential entry and exit points based on the strength of the signal.
• Visual Signals
Patterns are labeled directly on the chart:
Green Labels/Text: Indicate Bullish patterns.
Red Labels/Text: Indicate Bearish patterns.
Gray/White Labels: Indicate Indecision or Weak patterns.
Hovering over any label provides the full name of the pattern and its strength rating (e.g., "Bullish Engulfing - Strength: Strong").
• Trading Logic
High Strength Signals (Levels 4-5): These can be used as primary triggers for trend reversals or strong continuations.
Moderate Signals (Level 3): Useful for adding confluence to existing analysis or anticipating a setup.
Indecision (Level 1): Often useful for taking profits or tightening stop-losses, as they indicate the current trend may be stalling.
● Settings
Show Only Strong Patterns: When enabled, filters out Strength 1, 2, and 3, showing only the most significant signals (Strength >= 4).
Max Patterns to Display: Limits the number of historical labels to prevent chart clutter.
Max Candles to Check Engulfing: Adjusts how far back the script looks to validate the size of an engulfing candle.
Trend Detection Period: Sets the length of the SMA used to determine the background trend context.
Show Only Trend-Appropriate Patterns: If checked, bullish reversals are only shown in downtrends, and bearish reversals in uptrends.
● Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicator

Strat Structure Engine Strat Structure Engine + Trapped Traders – PulseWire Public Library Description (Moderator-Optimized)
Overview:
The Strat Structure Engine + Trapped Traders script is a self-contained price action indicator that identifies high-probability market structure patterns using The Strat methodology. It integrates bar-based structure, volatility (ATR), and volume analysis to detect potential reversals, exhaustion points, and trapped trader scenarios directly on the chart. Unlike generic indicators, it grades signals for reliability and visual clarity, providing actionable insight for traders.
Originality and Purpose:
This script is original because it combines multiple structure-based patterns into a single, coherent system:
3-Bar → Failed 2 (3→F2) – A tiered scoring system evaluates the strength of a strict 3-bar structure followed by a Failed 2 bar.
2-Bar → Failed 2 (2→F2, A+ only) – Filters only the strongest 2-bar setups followed by a Failed 2 for high-confidence reversal signals.
Failed 2 → Failed 2 (Dragon’s Tail / F2→F2) – Detects consecutive Failed 2 bars in opposite directions, signaling trapped traders and quick reversals.
Each pattern is evaluated using objective criteria: bar range relative to ATR, Failed 2 close relative to the preceding structure, body-to-range ratio, and volume spikes compared to recent averages. The combination of multiple patterns with tiered scoring and volume confirmation is unique and cannot be reproduced by simply merging standard indicators.
Signal Evaluation and Scoring:
1. 3→F2 (Tiered Scoring)
Criteria:
3-bar range vs ATR
Failed 2 close relative to 3-bar midpoint
Body-to-range ratio
Volume vs recent SMA
Tier Grades: A+, A, B, —
Purpose: Helps traders prioritize high-confidence reversal setups while filtering out weaker signals.
2. 2→F2 (A+ Only)
Evaluates strict 2-bar structures followed by a Failed 2 bar.
Displays only the strongest A+ setups to reduce noise.
3. F2→F2 (Dragon’s Tail)
Detects consecutive Failed 2 bars in opposite directions.
Highlights trapped trader zones and potential rapid reversals.
Volume and Volatility Integration:
ATR normalization ensures bar ranges are contextualized to market volatility.
SMA volume averaging confirms unusual activity, filtering signals with low participation.
This ensures signals are structurally valid and contextually significant.
Chart and Visual Clarity:
Labels are color-coded (green for bullish, red for bearish) and include tier/score for easy interpretation.
Only confirmed patterns are labeled, avoiding clutter or ambiguous markings.
Works on standard candlestick charts (does not use Heikin Ashi, Renko, or Range bars), ensuring realistic and reliable signals.
Customization and Alerts:
Toggle each pattern on/off: 3→F2, 2→F2, F2→F2
Adjust ATR length and volume average period per instrument or timeframe.
Alerts available for all patterns for bar-close confirmation, enabling real-time monitoring or integration with trading systems.
Practical Trading Use:
Identify exhaustion points, trapped traders, and reversals.
Can be used alongside VWAP, liquidity zones, fair value gaps, and session extremes for enhanced entry and exit decisions.
Focus on A+ / A tier signals for execution; use B-tier signals for context or partial entries.
Designed for multiple instruments (equities, futures, Forex) and adaptable across timeframes.
Compliance and Risk Notes:
Signals are historical, not predictive.
Follow proper risk management and do not rely solely on indicator signals.
Past performance does not guarantee future results.
Does not use request.security() with lookahead; all signals are confirmed on bar close.
✅ Key Advantages:
Fully self-contained, original methodology.
Multi-pattern integration with tiered scoring for reliability.
Volume and ATR confirmation reduces noise and false signals.
Clean, uncluttered chart output that is easy to read and interpret.
This version explicitly addresses moderation points:
Originality: explains why the mashup is necessary and unique.
Usefulness: shows exactly how traders can use it.
Chart clarity: confirms labels are meaningful, non-redundant, and easy to read.
Signal realism: bars are confirmed, no lookahead used.
Indicator

Direction via Zone Break [by rukich]🟠 OVERVIEW
The indicator shows the direction of movement and zones: SSL, BSL, FVG.
Zones serve as support/resistance and as validation/invalidation of a movement reversal.
🟠 COMPONENTS
The direction of movement is built based on a three-candle swing high (BSL) and swing low (SSL) pattern. If swing high (BSL) and swing low (SSL) are formed, and then an internal swing high/low is formed (depending on the direction of movement), then in case the initial movement continues — for example, in an upward movement — the new swing low (SSL) will be the minimum before the update, i.e., the internal low, while the swing high (BSL) will be formed according to the three-candle pattern.
A change of direction is considered when a candle closes beyond the key swing high/low (BSL/SSL), depending on the direction of movement. For example, in an upward movement, a break occurs when a candle closes beyond the swing low (SSL). After that, the swing high (BSL) will be the nearest fractal (swing high), and the swing low (SSL) will be formed according to the three-candle pattern.
All the above logic also applies to downward movements.
Within each movement, there can be FVG zones, which can act as support/resistance or indicate weakness in the movement direction.
Note: if the movement is upward, only bullish FVG+ will be displayed; if the movement is downward, only bearish FVG- will be displayed.
Weakness of movement direction.
For example, consider an upward impulse with the nearest FVG+ zone. If the price closes beyond the lower boundary of the zone, it will be considered invalidated (inv. FVG-), which in turn indicates weakness in the movement direction and a possible local short, which may subsequently lead to a break of the entire movement.
🟠 HOW TO USE
There are only two visual settings in the configuration:
Show previous SSL/BSL – enables/disables the display of all previous SSL/BSL zones
Show Bullish/Bearish trend – enables/disables background shading between SSL and BSL for visual understanding of the movement direction
On the chart, the following are displayed:
Labels with current SSL/BSL
FVG+- / inv. FVG+- zones, for trading in the movement direction
In case the nearest FVG is invalidated, a label will appear with the text: Weak bullish/bearish & local short/long (this is not a signal, but only indicates the probability of a potential move based on the weakness of the nearest zone)
🟠 CONCLUSION
The indicator helps determine the current movement with zones for trading in the direction, and also indicates movement weakness through invalidation of the nearest zones. Indicator

Indicator

Simple Line📌 Understanding the Basic Concept
The trend reverses only when the price moves up or down by a fixed filter size.
It ignores normal volatility and noise, recognizing a trend change only when price moves beyond a specified threshold.
Trend direction is visually intuitive through line colors (green: uptrend, red: downtrend).
⚙️ Explanation of Settings
Auto Brick Size: Automatically determines the brick/filter size.
Fixed Brick Size: Manually set the size (e.g., 15, 30, 50, 100, etc.).
Volatility Length: The lookback period used for calculations (default: 14).
📈 Example of Identifying Buy Timing
When the line changes from gray or red to green, it signals the start of an uptrend.
This indicates that the price has moved upward by more than the required threshold.
📉 Example of Identifying Sell Timing
When the line changes from green to red, it suggests a possible downtrend reversal.
At this point, consider closing long positions or evaluating short entries.
🧪 Recommended Use Cases
Use as a trend filter to enhance the accuracy of existing strategies.
Can be used alone as a clean directional indicator without complex oscillators.
Works synergistically with trend-following strategies, breakout strategies, and more.
🔒 Notes & Cautions
More suitable for medium- to long-term trend trading than for fast scalping.
If the brick size is too small, the indicator may react to noise.
Sensitivity varies greatly depending on the selected brick size, so backtesting is essential to determine optimal values.
❗ The Trend Simple Line focuses solely on direction—remove the noise and focus purely on the trend.
초대 전용 스크립트
이 스크립트에 대한 접근이 제한되어 있습니다. 사용자는 즐겨찾기에 추가할 수 있지만 사용하려면 사용자의 권한이 필요합니다. 연락처 정보를 포함하여 액세스 요청에 대한 명확한 지침을 제공해 주세요.
이 비공개 초대 전용 스크립트는 스크립트 모더레이터의 검토를 거치지 않았으며, 하우스 룰 준수 여부는 확인되지 않았습니다. 트레이딩뷰는 스크립트의 작동 방식을 충분히 이해하고 작성자를 완전히 신뢰하지 않는 이상, 해당 스크립트에 비용을 지불하거나 사용하는 것을 권장하지 않습니다. 커뮤니티 스크립트에서 무료 오픈소스 대안을 찾아보실 수도 있습니다.
작성자 지시 사항
.
c9indicator
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니 Indicator

Analog Flow [KedArc Quant]Overview
AnalogFlow is an advanced analogue based market projection engine that reconstructs future price tendencies by matching current price behavior to historical analogues in the same instrument. Instead of using traditional indicators such as moving averages, RSI, or regression, AnalogFlow applies pattern vector similarity analysis - a data driven technique that identifies historically similar sequences and aggregates their subsequent movements into a smooth, forward looking curve.
Think of it as a market memory system:
If the current pattern looks like one we have seen before, how did price move afterward?
Why AnalogFlow Is Unique
1. Pattern centric - it does not rely on any standard indicator formula; it directly analyzes price movement vectors.
2. Adaptive - it learns from the same instrument's past behavior, making it self calibrating to volatility and regime shifts.
3. Non repainting - the projection is generated on the latest completed bar and remains fixed until new data is available.
4. Noise resistant - the EMA Blend engine smooths the projected trajectory, reducing random variance between analogues.
Inputs and Configuration
Pattern Bars
Number of bars in the reference pattern window: 40
Projection Bars
Number of bars forward to project: 30
Search Depth
Number of bars back to look for matching analogues: 600
Distance Metric
Comparison method: Euclidean, Manhattan, or Cosine (default Euclidean)
Matches
Number of top analogues to blend (1-5): Top 3
Build Mode
Projection type: Cumulative, MeanStep, or EMA Blend (default EMA Blend)
EMA Blend Length
Smoothness of the projected path: 15
Normalize Pattern
Enable Z score normalization for shape matching: true
Dissimilarity Mode
If true, finds inverse analogues for mean reversion analysis: false
Line Color and Width
Style settings for projection curve: Blue, width 2
How It Works with Past Data
1. The system builds a memory bank of patterns from the last N bars based on the scanDepth value.
2. It compares the latest Pattern Bars segment to each historical segment.
3. It selects the Top K most similar or dissimilar analogues.
4. For each analogue, it retrieves what happened after that pattern historically.
5. It averages or smooths those forward moves into a single composite forecast curve.
6. The forecast (blue line) is drawn ahead of the current candle using line.new with no repainting.
Output Explained
Blue Path
The weighted mean future trajectory based on historical analogues.
Smoother when EMA Blend mode is enabled.
Flat Section
Indicates low directional consensus or equilibrium across analogues.
Upward or Downward Slope
Represents historical tendency toward continuation or reversal following similar conditions.
Recommended Timeframes
Scalping / Short Term
1m - 5m : Short winLen (20-30), small ahead (10-15)
Swing Trading
15m - 1h : Balanced settings (winLen 40-60, ahead 20-30)
Positional / Multi Day
4h - 1D : Large windows (winLen 80-120, ahead 30-50)
Instrument Compatibility
Works seamlessly on:
Stocks and ETFs
Indices
Cryptocurrency
Commodities (Gold, Crude, etc.)
Futures and F&O (both intraday and positional)
Forex
No symbol specific calibration needed. It self adapts to volatility.
How Traders Can Use It
Forecast Context
Identify likely short term price path or drift direction.
Reversal Detection
Flip seekOpp to true for mean reversion pattern analysis.
Scenario Comparison
Observe whether the current regime tends to continue or stall.
Momentum Confirmation
Combine with trend tools such as EMA or MACD for directional bias.
Backtesting Support
Compare projected path versus realized price to evaluate reliability.
FAQ
Q1. Does AnalogFlow repaint?
No. It calculates only once per completed bar and projects forward. The future path remains static until a new bar closes.
Q2. Is it a neural network or AI model?
Not in the machine learning sense. It is a deterministic analogue matching engine using statistical distance metrics.
Q3. Why does the projection sometimes flatten?
That means similar historical setups had no clear consensus in direction (neutral expectation).
Q4. Can I use it for live trading signals?
AnalogFlow is not a signal generator. It provides probabilistic context for upcoming movement.
Q5. Does higher scanDepth improve accuracy?
Up to a point. More depth gives more analogues, but too much can dilute recency. Try 400 to 800.
Glossary
Analogue
A past pattern similar to the current price behavior.
Distance Metric
Mathematical formula for pattern similarity.
Step Vector
Difference between consecutive closing prices.
EMA Blend
Exponential smoothing of the projected path.
Cumulative Mode
Adds sequential historical deltas directly.
Z Score Normalization
Rescaling to mean 0 and variance 1 for shape comparison.
Summary
AnalogFlow converts the market's historical echoes into a structured, statistically weighted forward projection. It gives traders a contextual roadmap, not a signal, showing how similar past setups evolved and allowing better informed entries, exits, and scenario planning across all asset classes.
Disclaimer
This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and proper risk management when applying this strategy. Indicator

Indicator

Wolfe Waves [BigBeluga]🔵 OVERVIEW
The Wolfe Waves pattern was first introduced by Bill Wolfe , a trader and analyst in the 1980s–1990s who specialized in market geometry and natural rhythm cycles. Wolfe observed that price often forms symmetrical wave structures that anticipate equilibrium points where supply and demand meet. These formations, called Wolfe Waves , gained popularity as a reliable pattern for forecasting both short- and long-term reversals.
The Wolfe Waves indicator automatically detects these patterns in real time. It tracks sequences of five pivots (points 1 through 5) and connects them with wave lines. Users can select either Bullish or Bearish Wolfe Waves depending on their trading bias. When the pattern fails, the lines automatically turn red to highlight invalidation.
🔵 CONCEPTS
Five-Point Structure – Wolfe Waves are defined by five pivots (1–5), which together form the basis of the wave pattern.
Bullish Pattern – Occurs when price compresses downward into point 5, signaling a potential upside reversal.
Bearish Pattern – Occurs when price extends upward into point 5, forecasting a downside reversal.
Validation & Failure – The pattern is considered valid once all five pivots form; if price fails to respect the expected breakout, the indicator marks the structure as broken with red lines.
🔵 FEATURES
Automatic detection of Bullish and Bearish Wolfe Waves.
Labels each pivot (1–5) on the chart for clarity.
Draws connecting lines between pivots to visualize the wave structure.
Projects target/dashed lines (EPA/ETA) based on Wolfe Wave geometry.
Lines automatically turn red when the pattern is broken, giving immediate feedback.
Customizable color scheme for bullish (lime) and bearish (orange) waves.
Adjustable sensitivity for pivot detection.
🔵 HOW TO USE
Choose between Bullish or Bearish mode depending on your analysis.
Watch for the formation of all five pivots; the indicator labels them clearly.
Look for potential entries near point 5, with the expectation that price will travel toward the projected EPA line.
Use invalidation (lines turning red) as a risk management warning to exit failed setups.
Combine with momentum, volume, or higher-timeframe analysis to increase reliability.
🔵 CONCLUSION
The Wolfe Waves brings the classic Wolfe Wave theory into an automated PulseWire tool. Inspired by Bill Wolfe’s original concept of natural market cycles, this indicator detects, labels, and validates Wolfe Waves in real time. With automatic invalidation marking and customizable settings, it offers traders a structured way to harness one of the most well-known geometric reversal patterns. Indicator

Internal Pivot Pattern [LuxAlgo]The Internal Pivot Pattern indicator is a novel method allowing traders to detect pivots without excessive delay on the chart timeframe, by using the lower timeframe data from a candle.
It features custom colors for candles and zigzag lines to help identify trends. A dashboard showing the accuracy of the pattern is also included.
🔶 USAGE
We define a pivot as the occurrence where the middle candle over a specific interval (for example, the most recent 21 bars) is the highest (pivot high) or the lowest (pivot low). This method commonly allows for identifying swing highs/lows on a trader's chart; however, this pattern can only be identified after a specific number of bars has been formed, rendering this pattern useless for real-time detection of swing highs/lows.
This indicator uses a different approach, removing the need to wait for candles to form on the user chart; instead, we check the lower timeframe data of the current candle and evaluate for the presence of a pivot given the internal data, effectively providing pivot confirmation at the candle close.
An internal pivot low pattern is indicative of a potential uptrend, while an internal pivot high is indicative of a potential downtrend.
Candles are colored based on the last internal pivot detected, with blue candle colors indicating that the most recent internal pivot is a pivot low, indicating an uptrend, while an orange candle color indicates that the most recent internal pivot is a pivot high, indicating a downtrend.
🔹 Timeframes
The timeframe setting allows controlling the amount of lower timeframe data to consider for the internal pivot detection. This setting must be lower than the user's chart timeframe.
Using a timeframe significantly lower than the user chart timeframe will evaluate a larger amount of data for the pivot detection, making it less frequent, while using a timeframe closer to the chart timeframe can make the internal pivot detection more frequent, and more prone to false positives.
🔹 Accuracy Dashboard
The Accuracy Dashboard allows evaluating how accurate the detected patterns are as a percentage, with a pattern being judged accurate if subsequent patterns are detected higher or lower than a previous one.
For example, an internal pivot low is judged accurate if the following internal pivot is higher than it, indicating that higher highs have been made.
This dashboard can be useful to determine the timeframe setting to maximize the respective internal pivot accuracy.
🔶 SETTINGS
Timeframe: Timeframe for detecting internal swings
Accuracy Dashboard: Enable or disable the Accuracy Dashboard.
🔹 Style
Internal Pivot High: Color of the dot displayed upon the detection of an internal pivot high
Internal Pivot Low: Color of the dot displayed upon the detection of an internal pivot low
Zig-Zag: Color of the zig-zag segments connecting each internal pivot
Candles: Enable candle coloring, with control over the color of the candles highlighting the detected trend
Indicator
