Gösterge

Gösterge

Adaptive Pressure Trail [JOAT]Adaptive Pressure Trail
Introduction
Adaptive Pressure Trail is an open-source overlay indicator that combines an HMA-based adaptive ratchet trail with a custom volume-weighted Money Flow Index to classify bars into bull pressure, bear pressure, and neutral states. The system uses a three-layer visual architecture — an outer volatility cloud, an inner ratchet band fill, and a core gradient pressure fill between the HMA baseline and candle mid-body — to create a clear, spatially organized picture of momentum and direction on any chart. Volatility squeeze detection identifies compression phases before potential breakouts, and high-confidence signals fire when a squeeze releases simultaneously with pressure alignment.
The core problem this indicator solves is that most trail-based systems are either too reactive (flipping constantly on noise) or too slow (missing meaningful moves). The HMA ratchet addresses this: the upper band only falls and the lower band only rises after a direction flip, preventing whipsaw while remaining responsive when momentum is genuine. Layering a volume-weighted MFI filter on top means a directional trail alone is not sufficient — volume-backed money flow must confirm the move before the indicator reports active pressure.
Core Concepts
1. HMA Adaptive Ratchet Trail
The trail baseline is computed using a Hull Moving Average, which provides low lag while remaining smooth. ATR-scaled upper and lower bands are applied around the HMA. The ratchet rule prevents band noise: the upper band can only move downward (or reset when price closes above it), and the lower band can only move upward (or reset when price closes below it). Direction flips when price closes through the active band. This creates a one-directional drift that is far more stable than a raw crossover trail:
The trail direction variable persists with var and updates each bar. Direction == 1 means the lower band is the active trail (bullish), direction == -1 means the upper band is the active trail (bearish).
2. Custom Volume-Weighted MFI
Rather than using a standard price-only momentum oscillator, the pressure engine uses a custom volume-weighted Money Flow Index. Positive flow is volume multiplied by HLC3 on bars where HLC3 increased; negative flow is volume multiplied by HLC3 on bars where HLC3 decreased. These are summed over the MFI length and converted to a 0-100 scale using the RSI formula. The result is smoothed with an HMA for responsiveness. This produces a momentum measure that is inherently volume-weighted — large-volume moves carry more influence than low-volume drift. The MFI is further smoothed to distinguish sustained pressure from transient spikes.
3. Pressure Regime Classification
Bull pressure is active when the trail direction is bullish AND the smoothed MFI is above the bull threshold. Bear pressure is active when the trail direction is bearish AND MFI is below the bear threshold. Neutral is everything else. This dual-condition structure means you need both directional commitment from the ratchet trail AND volume-backed momentum to enter a pressure state. Either condition alone is insufficient.
A rolling 50-bar history tracks what percentage of recent bars were in an active pressure state, producing a Pressure Strength percentage that indicates whether the current regime has been sustained or is a brief spike.
4. Squeeze Detection
Band width — the distance between the upper and lower ratchet bands — is compared to its own SMA. When band width drops below 72% of its recent average, the market is compressing. A squeeze start fires a golden diamond marker at the trail level. A squeeze release fires a larger circle marker. The high-confidence signal fires when a squeeze release coincides with an active pressure state, identifying the highest-probability setups where compressed volatility breaks out in a confirmed directional context.
5. Three-Layer Visual Architecture
The chart renders three nested visual layers:
Outer Cloud: The ATR envelope (cloudMult * ATR from HMA center) filled with a very transparent directional color — gives spatial context to where price is within the volatility range
Inner Band Fill: The ratchet upper and lower bands filled with medium transparency — shows the active directional channel
Core Pressure Fill: A gradient fill between the HMA baseline and the candle mid-body — transparent at the HMA, saturated at the body, colored by pressure state
The trail line itself uses three stacked plots at widths 10, 5, and 2 to create a neon glow shadow effect. Bar coloring uses color.from_gradient driven by MFI intensity, producing increasingly saturated candles as momentum builds.
Features
HMA Ratchet Trail with Triple-Layer Glow: Direction-persistent adaptive trail rendered as a neon glow (widths 10/5/2) using the bullish lime or bearish fuchsia color
Outer ATR Volatility Cloud: Wide ATR envelope filled directionally, providing spatial context at a glance
Inner Ratchet Band Fill: Gradient-filled active channel between upper and lower ratchet bands
Core Pressure Gradient: Background-to-body gradient between HMA and mid-body, colored by current pressure state
HMA Skeleton Reference: Subtle neutral line showing the raw HMA baseline beneath all fills
Volatility Squeeze Markers: Golden diamonds during compression, circle flash on breakout
High-Confidence Signal: Starred HC LONG / HC SHORT labels when squeeze releases into confirmed pressure alignment — the highest-quality setup the system produces
Volume Impulse Labels: When a strong directional candle exceeds the volume threshold, a label shows the volume ratio (e.g., 2.1x vol) at the bar
MFI Cross Markers: Small triangles on the trail when MFI crosses the 50 level, marking momentum regime shifts
TP Signals: Labeled plotshapes when MFI reaches overbought/oversold extremes in the trail direction
Pressure Strength Percentage: Rolling 50-bar % of time spent in active pressure — distinguishes sustained trends from brief spikes
Gradient Bar Coloring: color.from_gradient driven by MFI intensity — bars saturate as momentum builds and fade as it weakens
11-Row Dashboard: Pressure state, trail direction, MFI reading, pressure score, pressure strength %, volatility state, band width, trend bars, trail price, ATR
Input Parameters
Adaptive Trail:
Trail HMA Length: Period for the HMA baseline (default 21)
Trail ATR Multiplier: Width of inner ratchet bands (default 1.8)
Trail ATR Length: ATR lookback for band calculation (default 14)
Outer Cloud ATR Width: Outer envelope width multiplier (default 3.2)
Squeeze Reference Bars: SMA period for band-width baseline (default 20)
Pressure Filter:
MFI Length: Volume-weighted money flow lookback (default 14)
MFI Smoothing: HMA smoothing on raw MFI (default 7)
MFI Bull/Bear Thresholds: Activation levels for pressure states (default 62/38)
Signals:
TP Overbought/Oversold Levels: MFI levels that trigger TP signals (default 78/22)
Impulse Volume Multiplier: Volume multiple above SMA required for impulse label (default 1.3)
Visuals:
Toggles for entry signals, TP signals, glow, cloud, pressure fill, squeeze markers, and dashboard
Bull Color (default lime #a3e635), Bear Color (default fuchsia #e879f9), Neutral Color (default slate #94a3b8)
How to Use This Indicator
Primary Setup — Trend Following with Pressure Confirmation:
Look for the trail to flip direction (circle marker on trail). Wait for MFI to cross the bull or bear threshold, confirming the pressure state activates. Enter in the trail direction once the pressure fill color saturates. Trail your stop at the active trail line. Exit on a TP signal or when the pressure state deactivates.
High-Confidence Setup:
Wait for squeeze markers (golden diamonds) to appear, indicating compression. When the squeeze releases (larger circle flash) and the pressure state is simultaneously active, the HC LONG or HC SHORT label fires. These are the setups where compressed volatility breaks out with momentum behind it.
Filtering with Pressure Strength:
The dashboard Pressure Strength percentage tells you how sustained the current move has been. Values above 60% indicate a mature trend. Values below 30% indicate the pressure state is new or unstable. Adjust position sizing accordingly.
Reading Impulse Candles:
Volume impulse labels (e.g., "2.1x vol") mark bars where a strong directional move was accompanied by significantly elevated volume. These often mark the start or acceleration of a pressure phase and can serve as reference points for support/resistance.
APT dashboard showing bull pressure active, MFI at 71.2, P-Score 7.1/10, P-Strength at 64%, band width expanding after a squeeze release, and the trail at current price with ATR reference
Indicator Limitations
The ratchet trail requires a confirmed close through the active band to flip direction. On higher-timeframe charts with large candle bodies this can mean the flip is confirmed well after the actual turning point
The volume-weighted MFI requires volume data. On instruments with unreliable volume reporting (some forex pairs, synthetic indices) the pressure filter may be less meaningful than on equities or futures
Squeeze detection uses a 72% band-width threshold. In persistently low-volatility instruments this threshold may trigger too frequently; adjusting the Squeeze Reference Bars parameter can help
High-confidence signals require both a squeeze release and active pressure simultaneously. On trending markets with no compression phase, HC signals will be rare
MFI thresholds at 62/38 are defaults designed for balanced use; highly trending instruments may require raising the bull threshold and lowering the bear threshold to reduce false pressure activations
Originality Statement
This indicator is original in its combination of a ratchet-constrained HMA trail with a custom volume-weighted MFI, the three-layer nested visual system, and the squeeze-breakout confluence signal. While HMA trails and MFI oscillators exist independently, this publication is justified because:
The ratchet logic applied to HMA (rather than ATR midline or EMA) reduces lag while preventing the constant flipping common in standard trail indicators
The custom volume-weighted MFI differs from the standard MFI by using HLC3 as the price component with RSI-formula normalization, producing a smoother measure with better noise rejection
The three-layer nested fill architecture (outer cloud, inner band, core pressure gradient) provides a spatially organized visual system where the distance between layers communicates volatility context
Squeeze detection integrated with pressure confirmation for HC signals is a novel combination that identifies setups at the intersection of volatility compression and momentum alignment
The Pressure Strength rolling percentage provides a trend maturity measure not present in standard trail indicators
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Gösterge

Cadence Veil [JOAT]Cadence Veil /b]
Introduction
Cadence Veil is an advanced open-source regime classification indicator that fuses an H-Infinity adaptive filter, R-squared efficiency gating, dual-window chop scoring, and Kaufman adaptive efficiency into a unified five-state regime engine. The indicator classifies every bar into one of five market states — Expansion Bull, Expansion Bear, Compression, Whipsaw, or Dormant — using a hysteresis state machine that prevents rapid flip-flopping between regimes. It then overlays volatility envelope bands, a ZEMA bias ribbon, structural pivot tracking, regime shift boxes, and gradient visualization to create a complete market phase recognition system.
The core problem this indicator solves is regime misidentification. Most traders apply the same strategy regardless of market conditions — trend-following in chop, mean-reversion in trends, or trading during dormant periods when nothing meaningful is happening. Each of these mismatches leads to losses. Cadence Veil explicitly classifies the current regime so traders can select the appropriate strategy for the conditions. A compression regime calls for breakout preparation. An expansion regime calls for trend-following. A whipsaw regime calls for caution or sitting out entirely. A dormant regime means the market lacks the energy for any strategy to work reliably.
Core Concepts
1. H-Infinity Adaptive Filter
The centerline of the indicator uses an H-Infinity filter rather than a conventional moving average. H-Infinity filtering is a control theory technique designed to produce optimal estimates under worst-case noise conditions. Unlike a Kalman filter (which assumes Gaussian noise), the H-Infinity filter makes no assumptions about noise distribution, making it more robust in financial markets where price noise is decidedly non-Gaussian:
for i = 0 to hinfOrder - 1
float s = array.get(hinfState, i)
float e = array.get(hinfError, i) + hinfNoise
float g = e / (e + hinfDist)
array.set(hinfState, i, s + g * (close - s))
array.set(hinfError, i, (1.0 - g) * e)
The filter maintains internal state and error estimates that adapt each bar. The gain parameter (error divided by error plus disturbance) determines how much the filter trusts new data versus its existing estimate. Higher disturbance values make the filter more conservative (smoother); lower values make it more responsive. The filter order parameter controls how many state dimensions are tracked, with higher orders providing more sophisticated noise modeling.
2. R-Squared Efficiency Gate
R-squared measures how well price movement fits a linear regression line. A high R-squared (close to 1.0) means price is moving in a straight, efficient line — a strong trend. A low R-squared (close to 0) means price is moving randomly with no directional efficiency:
float r2Raw = math.pow(ta.correlation(close, bar_index, effLen), 2)
float r2Smooth = ta.sma(r2Raw, effSmooth)
The indicator uses an auto-calibrating threshold: the rolling mean of R-squared plus k standard deviations. This means the threshold adapts to the instrument's typical trending behavior. A hysteresis band prevents the gate from flickering — once open, R-squared must drop further to close the gate than it needed to rise to open it.
3. Dual-Window Chop Scoring
Chop is measured using the efficiency ratio concept: the net price movement divided by the total path length over a window. A perfectly straight move scores 0 (no chop); a move that goes nowhere despite lots of bar-to-bar movement scores 1 (maximum chop). The indicator uses two windows — a fast window (default 14 bars) for recent chop and a slow window (default 50 bars) for structural chop — and blends them:
f_chop(int len) =>
float netMove = math.abs(close - close )
float pathLen = math.sum(math.abs(close - close ), len)
pathLen == 0.0 ? 1.0 : 1.0 - (netMove / pathLen)
float chopBlend = (chopFastVal + chopSlowVal) / 2.0
The dual-window approach catches both short-term whipsaws and longer-term structural chop that a single window might miss.
4. Kaufman Efficiency Ratio
The Kaufman ER provides a third independent measure of trend quality. It compares the absolute net price change over N bars to the sum of all bar-to-bar changes over the same period. Values near 1.0 indicate efficient, directional movement; values near 0 indicate noisy, non-directional movement. This complements R-squared (which measures linearity) and chop score (which measures path efficiency) by measuring absolute directional efficiency.
5. Composite Trend Score and State Machine
The three measures are blended into a single composite trend score:
float trendScore = (kaufER * 0.35) + ((1.0 - chopBlend) * 0.35) + (r2Smooth * 0.30)
This score, combined with the H-Infinity filter slope and volatility ratio, feeds into a five-state machine with persistence requirements. A candidate state must hold for a configurable number of consecutive bars (default 3) before the regime officially transitions. This prevents single-bar noise from triggering false regime changes.
The five states are:
Expansion Bull: R-squared gate open, trend score above threshold, H-Infinity slope positive
Expansion Bear: R-squared gate open, trend score above threshold, H-Infinity slope negative
Compression: High chop score, low volatility ratio — market is coiling
Whipsaw: High volatility but also high chop — dangerous conditions with large moves in both directions
Dormant: None of the above conditions met — market lacks energy or direction
6. Volatility Envelope Bands
Adaptive bands are constructed around the H-Infinity line using ZEMA-smoothed ATR. The bands scale their width based on the current regime: narrower during compression (0.7x), wider during expansion (1.2x), and standard during normal conditions. This regime-adaptive scaling means the bands contract when the market is coiling (tightening the range for breakout detection) and expand when the market is trending (giving the trend room to breathe).
Features
Five-State Regime Classification: Clear categorical identification of the current market phase with color-coded rendering throughout the indicator
H-Infinity Core Line with Glow: The adaptive filter line renders with a gradient glow whose color and intensity reflect the current regime and trend score
Regime Shift Boxes: When the regime changes, a colored box is drawn that expands to encompass the price range of the new regime, providing a visual record of regime transitions
Regime Shift Labels: Labels at regime transitions show the new regime abbreviation and the trend score at the time of transition
ZEMA Bias Ribbon: A filled ribbon between the H-Infinity line and its ZEMA shows directional bias with bull/bear coloring
Structural Pivot Detection: Swing highs and lows are identified and labeled with regime context — pivots formed during expansion regimes are colored differently than those formed during compression
Structure Lines: Dashed horizontal lines at the most recent swing high and low provide support/resistance reference
Envelope Breach Detection: The dashboard reports whether price is inside the bands, above/below the inner band, or above/below the outer band
Composite Signal Strength: A 0-100 score measuring how aligned all subsystems are (R-squared gate, Kaufman ER, chop score, and ZEMA bias)
Regime History Tracking: The dashboard shows the last three regime states in sequence, revealing the pattern of market phase transitions
Gradient Background Zones: Background coloring shifts on a gradient from compression tones to the current regime color based on the trend score
Regime-Aware Bar Coloring: Candle colors reflect the current regime with momentum-based gradient intensity
14-Row Dashboard: Displays regime state, duration, trend score, signal strength, R-squared gate status, chop blend, Kaufman ER, volatility ratio, H-Infinity gain, ZEMA bias, swing levels, envelope position, and regime history
Input Parameters
H-Infinity Filter:
Filter Order: Number of state-space dimensions (default: 3, range: 1-8)
Process Noise: Expected noise level (default: 0.5)
Disturbance: External disruption parameter (default: 1.0)
Efficiency Gate:
R-Squared Length: Correlation calculation period (default: 30)
Smoothing: R-squared smoothing period (default: 10)
Threshold k: Standard deviations above mean for auto-threshold (default: 1.0)
Chop Detector:
Fast Window: Short-term chop measurement (default: 14)
Slow Window: Long-term chop measurement (default: 50)
State Engine:
Entry Persistence: Consecutive bars required for regime transition (default: 3)
Hysteresis Band: Width of the hysteresis zone to prevent flickering (default: 0.15)
Volatility Envelope:
Inner/Outer ATR Multipliers: Band distance from the core line (default: 1.2/2.4)
ATR Length: Period for ATR calculation (default: 14)
Visuals:
Toggles for envelope bands, ZEMA bias ribbon, structural pivots, structure lines, regime shift boxes, regime shift signals, background zones, bar coloring, and dashboard
How to Use This Indicator
Step 1: Identify the Current Regime
The dashboard's regime field and the background coloring immediately tell you the market phase. This is the most important piece of information — it determines which strategy to apply.
Step 2: Match Strategy to Regime
Expansion Bull/Bear: Use trend-following strategies. Enter pullbacks to the H-Infinity line or inner band in the direction of the expansion
Compression: Prepare for a breakout. Tighten stops, reduce position sizes, and watch for the regime to shift to expansion. The ZEMA bias may hint at the breakout direction
Whipsaw: Reduce exposure or sit out. This regime produces large moves in both directions that stop out trend-followers and mean-reversion traders alike
Dormant: No edge exists. Wait for the market to wake up
Step 3: Use Signal Strength for Conviction
The composite signal strength (0-100) tells you how aligned all subsystems are. A 75+ score during an expansion regime is high-conviction. A 25 score during expansion suggests the regime may be weakening.
Step 4: Monitor Regime Transitions
Regime shift boxes and labels mark exactly where transitions occurred. The most profitable trades often come at the transition from compression to expansion — the breakout from a coiled market.
Step 5: Read the Regime History
The history chain (e.g., "COMP > EXP+ > DORM") reveals the market's recent phase pattern. A sequence like "COMP > EXP+ > COMP > EXP+" suggests a market that trends in bursts between consolidation periods.
Cadence Veil showing a regime transition sequence: compression (purple box) resolving into expansion bull (green box), with the H-Infinity line glow intensifying, envelope bands widening, and the trend score rising in the dashboard
Indicator Limitations
The H-Infinity filter, while theoretically robust, has three parameters (order, noise, disturbance) that significantly affect behavior. Optimal settings vary across instruments and timeframes and may require experimentation
The persistence requirement for regime transitions (default 3 bars) creates a delay. Fast regime changes may be identified several bars after they begin. This is a deliberate trade-off for stability
The five-state classification is a simplification of continuous market behavior. Markets can exist in states that don't cleanly fit any category, and the boundaries between states are inherently fuzzy
R-squared, chop score, and Kaufman ER all use lookback windows. They describe what the market has been doing, not what it will do. A regime can change immediately after being classified
The whipsaw state is identified but no strategy is recommended for it because whipsaw conditions are inherently difficult to trade profitably. The indicator's value here is in warning you to reduce exposure
Volatility envelope bands adapt to the regime but still use ATR, which is backward-looking. Sudden volatility shifts (news events, gaps) may not be reflected in the bands for several bars
Originality Statement
This indicator is original in its application of control theory (H-Infinity filtering) to market regime classification and its synthesis of multiple independent efficiency measures into a unified state machine. While regime detection and adaptive filtering are established concepts, this indicator is justified because:
The H-Infinity filter is rarely used in technical analysis. Its worst-case noise optimization makes it theoretically more appropriate for financial markets than the more common Kalman filter, which assumes Gaussian noise
The triple-measure efficiency assessment (R-squared linearity + dual-window chop + Kaufman efficiency) provides more robust regime detection than any single measure. Each captures a different aspect of market behavior
The five-state classification with hysteresis persistence requirements produces stable, actionable regime labels rather than the flickering binary (trending/ranging) classifications common in simpler indicators
Regime-adaptive volatility envelope scaling automatically adjusts band behavior to the detected market phase, providing context-appropriate support/resistance levels
The composite signal strength score synthesizes all subsystems into a single conviction measure
Regime shift boxes provide a visual record of market phase transitions that aids in pattern recognition across longer timeframes
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Regime classifications are based on historical data analysis and do not predict future market phases. A market classified as "Expansion Bull" can reverse at any time. Compression does not guarantee a subsequent breakout, and the direction of any breakout is not predicted by the compression classification. Always use proper risk management and conduct your own analysis. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Gösterge

ABCD Harmonic Projection [WillyAlgoTrader]📐 ABCD Harmonic Projection is an overlay indicator that automatically detects ABCD harmonic patterns from ZigZag pivots, validates them against Fibonacci ratio constraints (BC/AB retracement + CD/AB extension), scores each pattern with a 4-factor quality engine (0–100), projects the D-point completion zone, and draws Target and Stop zones with Fibonacci extension and retracement levels — with full TP/SL outcome tracking and separate bull/bear win rate statistics.
The ABCD pattern is one of the foundational harmonic structures: four alternating swing points (A→B→C→D) where the BC leg retraces a Fibonacci portion of the AB leg, and the CD leg extends from C toward a projected D-point that is a Fibonacci ratio of the AB leg. When price reaches the D-point, the pattern completes — and a reversal or continuation move is expected. This indicator automates the entire detection-to-target workflow: find the swings, measure the ratios, validate the geometry, project the target, and track the outcome.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Manually identifying ABCD patterns requires eyeballing four pivot points, measuring two Fibonacci ratios, estimating the D-point projection, and drawing the target zone — across multiple instruments and timeframes. Most traders miss patterns or miscalculate ratios.
This indicator chains each step into an automated pipeline:
ZigZag pivot detection → 4-point ABCD extraction → BC/AB ratio validation → CD/AB extension calculation → D-point projection → 4-factor quality scoring → Target Zone + Stop Zone placement → Fibonacci extension/retracement overlay → TP/SL outcome tracking → Win rate statistics
The ZigZag engine ensures only confirmed alternating swings are used (no noise pivots). The ratio validation filters patterns to only those within Fibonacci-valid ranges. The quality scoring ranks patterns by how close they are to ideal geometry. The D-point projection gives a specific price target — not a vague area. And the Target/Stop zones provide precise trade management levels anchored to the pattern's own geometry.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ ZigZag pivot engine with direction management.
The indicator uses a directional ZigZag that enforces strict alternation: after a swing high, only a swing low is accepted (and vice versa). If price makes a higher high during an existing up-leg, the previous swing high is updated in place (not duplicated). This prevents the common problem of multiple consecutive highs being treated as separate pivots.
Pivots are detected using ta.pivothigh/ta.pivotlow with configurable lookback (default 8 bars). The ZigZag stores prices, bar indices, and directions in parallel arrays — providing the last 200 pivots for pattern scanning.
2️⃣ Fibonacci-validated ABCD pattern detection.
When a new pivot is confirmed and at least 4 pivots exist, the indicator extracts the most recent A, B, C points and validates:
— BC/AB retracement ratio : must be between minBcAbRatio (default 0.382) and maxBcAbRatio (default 0.886). Classic ABCD ratios are 0.382, 0.500, 0.618, 0.786, and 0.886. Patterns outside this range are rejected.
— ATR minimum swing filter : the AB leg must be at least 1× ATR in size — filtering out noise patterns during low-volatility bars.
— Minimum leg depth : AB must span at least 3 bars — ensuring the pattern has temporal structure, not just a single spike.
Pattern direction: if B > A → bullish ABCD (D projected above C). If B < A → bearish ABCD (D projected below C).
The D-point is projected from C using the average of the configurable CD/AB ratio range: projectedD = C + direction × |AB| × avgCdAbRatio.
3️⃣ 4-factor pattern quality scoring (0–100).
Each detected pattern receives a quality score from four dimensions:
— 📐 Fibonacci precision (45 pts) : how close BC/AB is to the nearest standard Fibonacci level (0.382, 0.500, 0.618, 0.786, 0.886, 1.000, 1.272, 1.618). Exact Fib ratio = full points. 0.05 away = partial. 0.18+ away = zero. This is the most heavily weighted factor because Fibonacci alignment is the core of harmonic pattern validity.
— ⏱️ Time symmetry (25 pts) : the ratio of estimated CD bars to AB bars. Perfect symmetry (CD bars = AB bars) = 25 points. Asymmetric patterns (one leg much longer) score lower.
— ⚖️ Price symmetry (20 pts) : BC retracement depth relative to 0.618 — deeper retests (closer to 0.618) score higher. Very shallow pullbacks (e.g., 0.236) receive fewer points.
— 📏 Leg maturity (10 pts) : AB leg length in bars — patterns with 8+ bars get full points, 5+ get 7, 3+ get 3. Single-bar spikes score zero.
Patterns below the Min Pattern Score threshold (default 40) are not displayed.
4️⃣ Fibonacci extension levels projected from C.
Four AB extension levels are drawn from point C in the direction of the pattern:
— 0.786 × |AB| — shallow completion
— 1.000 × |AB| — classic equal-leg ABCD
— 1.272 × |AB| — extended completion
— 1.618 × |AB| — maximum extension
The 1.0 level is drawn thicker (2px, less transparency) as it represents the ideal equal-leg completion. Each level includes a price label. Additionally, the measured BC/AB retracement ratio is displayed at the midpoint of the BC leg for reference.
5️⃣ Fibonacci retracement levels within C→D (partial TP targets).
For active patterns, three retracement levels are drawn between C and the projected D:
— 0.382 of CD range — first partial profit target
— 0.500 of CD range — mid-target
— 0.618 of CD range — aggressive partial take
These provide natural exit levels before the full D-point is reached — useful for scaling out of positions progressively.
6️⃣ Target Zone + Stop Zone with geometric sizing.
On each pattern:
— TARGET ZONE : a band around the projected D-point, sized at 10% of the CD range. For bullish patterns: the zone sits just below D. For bearish: just above D. This is where the pattern completion trade expects to reach profit.
— STOP ZONE : a band around point C, also sized at 10% of CD range. For bullish patterns: below C. For bearish: above C. If price returns past C, the pattern structure is broken.
Both zones extend rightward until price touches the target zone (tracked by touch bar), or the pattern resolves (TP/SL hit). Zones use distinct colors: green for target, red for stop.
7️⃣ TP/SL outcome tracking with separate bull/bear statistics.
Each active pattern monitors:
— TP hit : price reaches the projected D-point (high ≥ D for bull, low ≤ D for bear)
— SL hit : price returns past C against the pattern direction (low ≤ C for bull, high ≥ C for bear)
— Simultaneous TP+SL on the same bar → resolved as loss (conservative)
On TP hit: R:R is calculated as |entry to TP| / |entry to SL| and accumulated. The dashboard shows separate bull and bear win rates with average R:R on wins.
8️⃣ Active-only display mode.
When "Show Active Only" is enabled (default), completed patterns (TP or SL already hit) are hidden — only the current live pattern remains on the chart. When disabled, up to maxPatterns historical patterns are shown for context. This prevents chart clutter while maintaining full statistical tracking.
9️⃣ One-active-pattern constraint.
The indicator only allows one active pattern at a time. When an active pattern exists (status = 0), no new patterns are detected. This prevents overlapping projections and conflicting zones. A new pattern can only be detected after the current one resolves (TP or SL).
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — ZigZag: Directional pivot detection with alternation enforcement. Higher highs update existing swing (no duplicate). Lower lows same. Pivots stored in parallel arrays.
Step 2 — Pattern extraction: On each new confirmed pivot: extract A (3rd-to-last), B (2nd-to-last), C (latest). Compute AB length, BC length, BC/AB ratio.
Step 3 — Validation: BC/AB within Fibonacci range? AB ≥ ATR? AB ≥ 3 bars? No active pattern already?
Step 4 — Scoring: 4 factors: Fibonacci precision (45), time symmetry (25), price symmetry (20), leg maturity (10). Score ≥ minScore → pattern accepted.
Step 5 — Projection: D = C + direction × |AB| × avgCdAbRatio. Bars capped at maxBarsProjection.
Step 6 — Drawing: On barstate.islast: delete-and-redraw all visible patterns. AB and BC legs as solid lines. CD projection as dotted. A/B/C/D labels. Score label. Target/Stop zones as boxes. Fib extension and retracement levels as dashed lines with price labels.
Step 7 — Evaluation: Each bar: check all active patterns for TP/SL hits. Update status, accumulate win/loss stats, record R:R.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — ABCD patterns appear automatically as colored leg lines with A/B/C/D labels
2. Yellow dotted line from C = projected path to D
3. Green "TARGET ZONE" box = where price should reach (take profit)
4. Red "STOP ZONE" box = where the pattern is invalidated (stop loss)
5. Blue dashed lines = Fibonacci extension levels (0.786, 1.0, 1.272, 1.618)
6. Blue dotted lines = partial TP targets (0.382, 0.5, 0.618 of CD)
7. "Long"/"Short" label = confirmed entry signal
👁️ Reading the chart:
— 🟢 Green legs + labels = bullish ABCD (D above C, expecting up-move)
— 🔴 Red legs + labels = bearish ABCD (D below C, expecting down-move)
— 🟡 Dotted projection line = expected path C → D
— 🟢 "TARGET ZONE" box = profit target area around projected D
— 🔴 "STOP ZONE" box = invalidation area around C
— 🔵 Dashed lines = Fib extension levels from C (0.786/1.0/1.272/1.618 of AB)
— 🔵 Dotted lines = CD retracement levels (partial TPs: 0.382/0.5/0.618)
— Score label (e.g., "72%") = pattern quality
📊 Dashboard fields:
— Patterns: active / total count
— Last Signal: direction + status (Active/TP ✓/SL ✗) + score
— Bull W/L: wins/losses and win rate for bullish patterns
— Bear W/L: wins/losses and win rate for bearish patterns
— Avg R:R: average reward-to-risk on winning bull/bear trades
— ATR: current value for reference
— Timeframe, version
🔧 Tuning guide:
— Too many patterns: increase ZigZag Length (12–21), increase Min Score (60+), enable ATR filter
— Too few patterns: decrease ZigZag Length (5–8), decrease Min Score (30), widen BC/AB ratio range
— Patterns too small: increase ATR filter or ZigZag Length
— Want only perfect geometry: narrow BC/AB to 0.500–0.786, set CD/AB to 0.9–1.1, Min Score 70+
— Extended patterns: set Max CD/AB to 1.618 or higher
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— ZigZag Length (default 8): pivot detection lookback
— Pivot Sources : configurable high/low sources
📐 Pattern:
— Min/Max BC/AB Ratio (default 0.382/0.886): Fibonacci retracement range
— Min/Max CD/AB Ratio (default 0.786/1.618): extension range for D projection
— Min Pattern Score (default 40): quality threshold
— ATR Filter (default On): minimum swing size
— Max Patterns (default 3): display limit
— Active Only (default On): hide completed patterns
🎨 Visual:
— Buy/Sell signals, D projection, Fib levels, TP/SL zones, A/B/C/D labels, score (all toggleable)
— Auto / Dark / Light theme
🔧 Advanced:
— Max Bars for D Projection (default 200): limits distant projections
🔔 Alerts
— 🟢 LONG ABCD / 🔴 SHORT ABCD — entry, TP, SL, score, pattern type
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed and newPivot (confirmed ZigZag pivot). Patterns are detected after the pivot bar closes. Drawings are rendered on barstate.islast using delete-and-redraw — previous bar's pattern state is final.
— 📐 The ZigZag enforces strict alternation : high → low → high → low. If price makes a higher high during an existing up-swing, the previous high is updated in place — no duplicate pivots are created. This is essential for correct A/B/C/D extraction.
— ⚖️ Only one active pattern is allowed at a time. New patterns are blocked until the current one resolves (TP or SL). This prevents conflicting signals and overlapping zones.
— 📊 The quality score is heavily weighted toward Fibonacci precision (45 out of 100 points). A pattern with BC/AB exactly at 0.618 scores much higher than one at 0.450. This reflects the harmonic principle that Fibonacci alignment is the primary measure of pattern validity.
— 🔒 Simultaneous TP+SL on the same bar is resolved as a loss (conservative) . This prevents ambiguous outcomes from inflating win rates.
— 📏 The D-point projection uses the average of the min/max CD/AB ratio range — not the exact 1.0 (equal legs). With default settings (0.786–1.618), the projected D is at 1.202× AB from C — between classic and extended. Adjust the CD/AB range to target specific completion types.
— 🛠️ This is a harmonic pattern detection and projection tool , not an automated trading bot. It identifies ABCD geometry, projects D-point targets, and provides structured trade zones — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Gösterge

V16E - Entry SystemUNDER TESTING
V16E - Entry System Description
================================
V16E is a 15 minute entry timing indicator designed to work alongside V16. Where V16 tells you a stock is worth trading on the daily chart, V16E tells you the precise moment to pull the trigger on the lower timeframe.
HOW IT WORKS
------------
V16E combines three indicators into a single score out of 100. Every bar the score updates in real time in the bottom right corner of the pane, so you can watch it build before a signal fires and anticipate entries before the arrow appears.
STOCHASTIC - 40 points - the primary trigger
---------------------------------------------
The Stochastic oscillator is the engine of V16E. It measures where price closed relative to its recent range and reacts faster than RSI on lower timeframes. A signal only fires when Stochastic crosses at or near an extreme - below 20 for longs, above 80 for shorts. The closer to the extreme the crossover happens, the more points it scores. The indicator also measures acceleration - how fast %K is moving after the cross. A sharp fast recovery scores more than a slow drift.
RSI - 30 points - momentum weight
-----------------------------------
RSI never blocks a signal in V16E. Instead it weights how strong the signal is. RSI deep in oversold territory (below 30) on a long signal scores the maximum. RSI in neutral territory still contributes but less. The indicator also checks the RSI signal line (a 9 EMA of RSI) for crossovers and measures the slope of RSI - a steep rise scores more than a flat one. A pullback setup where RSI dipped below 50 and is now recovering back above it scores the highest on the signal line component.
RVOL AND DELTA - 20 points - pressure confirmation
----------------------------------------------------
RVOL measures whether volume is above or below average. High relative volume means more participants are behind the move - making the signal more reliable. Delta measures where the candle closed within its own range, showing whether buyers or sellers won that specific bar. Delta is checked over a user adjustable lookback window to confirm sustained buying or selling pressure rather than a single noisy candle.
SIGNAL STRENGTH - ARROW SIZES
------------------------------
When the score is high enough and a crossover fires, an arrow appears in the pane:
- Large bright arrow = score 70 or above = strong signal
- Medium arrow = score 45 to 69 = moderate signal
- Small arrow = score below 45 = weak signal, use caution
KEY FEATURES
------------
Timeframe Lock
You can set V16E to calculate its score on the 1M, 3M, 5M, 15M, 30M or 60M timeframe regardless of what chart you have open. The visual RSI and Stochastic lines always follow the chart you are on, but the score always reflects the timeframe you chose in settings.
Session Filter
Toggleable option that blocks signals in the first N minutes of the trading session. Default is off because many strong entries happen in the first 45 minutes.
Consecutive Bar Confirmation
The signal must still be valid one bar after the crossover fires. This filters out fake crossovers that immediately reverse.
Daily ADX Bonus
Optional toggle that pulls the daily ADX directly into V16E. When the daily trend is strong and aligned with the entry direction, up to 10 bonus points are added to the score. Default is off.
Divergence Detection
Optional RSI divergence labels in the pane, off by default.
SCORING BREAKDOWN
-----------------
Indicator Component Max Points
--------- --------- ----------
Stochastic Zone (cross at extreme) 30
Stochastic Acceleration (K speed) 10
RSI Zone 16
RSI Signal line + 50 cross 8
RSI Slope (steepness) 6
RVOL Volume confirmation 10
Delta Candle pressure 10
Daily ADX Optional bonus +10
----------------------------------------------------------
Total 100 (110 with bonus)
Score Colours:
80 - 100 = Bright green (strong)
60 - 79 = Green (good)
40 - 59 = Yellow (moderate)
20 - 39 = Orange (weak)
0 - 19 = Red (no signal)
HOW TO USE IT WITH V16
-----------------------
Step 1 - Check V16 on the daily chart. Is the score 60 or above with a clear direction?
Step 2 - Open V16E on the same stock. Set the timeframe to 15M in settings.
Step 3 - Watch the score build in real time. When Stochastic approaches the extreme zone, RSI momentum is moving in the right direction and delta is confirming, the score climbs.
Step 4 - When the arrow fires with a score above 70, that is your entry.
SETTINGS REFERENCE
------------------
Timeframe Settings
Calculation Timeframe Current / 1M / 3M / 5M / 15M / 30M / 60M
RSI Settings
RSI Length Default 9 (optimised for 15M)
RSI Signal EMA Default 9
RSI Slope Lookback Default 3 bars
Stochastic Settings
%K Length Default 14
%K Smoothing Default 3
%D Smoothing Default 3
Overbought Level Default 80
Oversold Level Default 20
Near Extreme Zone Default 5 points
Acceleration Lookback Default 2 bars
Delta Settings
Delta Lookback Default 3 bars (adjustable 1-9)
Delta Threshold % Default 20%
Min Confirmed Bars Default 2
Session Filter
Enable Session Filter Default OFF
Block First N Minutes Default 45 minutes
Daily ADX Filter
Enable Daily ADX Bonus Default OFF
Daily ADX Length Default 14
Daily ADX Smooth Default 14
Daily ADX Threshold Default 25
VERSION HISTORY
---------------
V16E - Initial build combining RSI, Stochastic and Delta
- Added RVOL as volume confirmation
- Added timeframe lock (visuals follow chart, score follows setting)
- Added session filter (toggleable, default off)
- Added stochastic acceleration scoring
- Added RSI slope scoring
- Added consecutive bar confirmation
- Added daily ADX bonus (toggleable, default off)
- Added score table bottom right of pane
- Added divergence detection (optional, default off)
Gösterge

Gösterge

Divergence Constellation [JOAT]Divergence Constellation
Introduction
The Divergence Constellation is an advanced open-source multi-oscillator divergence detection system that combines RSI, MACD, TSI, and Stochastic analysis with sophisticated pivot detection and confluence scoring. This indicator identifies both regular and hidden divergences across multiple oscillators simultaneously, creating a constellation of divergence signals that reveal potential reversals and trend continuations with high probability.
Unlike single-oscillator divergence tools, the Divergence Constellation provides multi-dimensional divergence analysis through composite oscillator calculation, four-oscillator confluence scoring, regular and hidden divergence detection, and chart projection. The indicator is designed for traders who understand that divergences confirmed across multiple oscillators provide significantly higher probability setups than single-oscillator divergences.
Why This Indicator Exists
This indicator addresses the need for systematic multi-oscillator divergence analysis. By combining four distinct oscillators with confluence scoring, it reveals:
Regular Bullish Divergence: Price makes lower low, oscillators make higher low (reversal up signal)
Regular Bearish Divergence: Price makes higher high, oscillators make lower high (reversal down signal)
Hidden Bullish Divergence: Price makes higher low, oscillators make lower low (trend continuation up)
Hidden Bearish Divergence: Price makes lower high, oscillators make higher high (trend continuation down)
Confluence Scoring: Counts how many oscillators confirm the divergence (1-4 score)
Composite Oscillator: Unified oscillator combining all four components
Chart Projection: Divergence lines drawn on both oscillator pane and main chart
Core Components Explained
1. Four-Oscillator System
The indicator calculates four distinct oscillators, each providing unique momentum perspective:
RSI (Relative Strength Index):
Measures momentum by comparing average gains to average losses
Zero-centered (subtracts 50) for composite integration
Sensitive to overbought/oversold conditions
Default period: 14
MACD (Moving Average Convergence Divergence):
Measures relationship between two exponential moving averages
Histogram shows momentum acceleration/deceleration
Responsive to trend changes
Default periods: 12, 26, 9
TSI (True Strength Index):
Double-smoothed momentum indicator
Filters noise while preserving trend direction
Excellent for divergence detection
Default periods: 25, 13
Stochastic:
Compares close to recent high-low range
Zero-centered (subtracts 50) for composite integration
Identifies overbought/oversold extremes
Default periods: 14, 3
2. Composite Oscillator Calculation
All four oscillators are combined into a unified composite:
Composite = (RSI + MACD + TSI + Stochastic) / 4
This composite oscillator provides a balanced view of momentum across all four methodologies. Divergences are detected on the composite, then confirmed by checking individual oscillators.
3. Pivot Detection System
The indicator uses sophisticated pivot detection to identify divergence points:
Pivot Left/Right: Number of bars on each side for pivot confirmation (default: 5)
Price Pivots: Identifies swing highs and lows in price
Oscillator Pivots: Identifies swing highs and lows in each oscillator
Lookback Range: Min (5) to Max (60) bars for comparing pivots
Pivots must be confirmed (bars on both sides) before divergence analysis begins.
4. Regular Divergence Detection
Regular divergences signal potential reversals:
Regular Bullish Divergence:
Price makes lower low (current pivot low < previous pivot low)
Composite oscillator makes higher low (current pivot low > previous pivot low)
Indicates weakening downward momentum - potential reversal up
Best at oversold levels (composite < -20)
Regular Bearish Divergence:
Price makes higher high (current pivot high > previous pivot high)
Composite oscillator makes lower high (current pivot high < previous pivot high)
Indicates weakening upward momentum - potential reversal down
Best at overbought levels (composite > 20)
5. Hidden Divergence Detection
Hidden divergences signal trend continuation:
Hidden Bullish Divergence:
Price makes higher low (current pivot low > previous pivot low)
Composite oscillator makes lower low (current pivot low < previous pivot low)
Indicates strong underlying bullish momentum - trend continuation up
Confirms uptrend strength
Hidden Bearish Divergence:
Price makes lower high (current pivot high < previous pivot high)
Composite oscillator makes higher high (current pivot high > previous pivot high)
Indicates strong underlying bearish momentum - trend continuation down
Confirms downtrend strength
6. Confluence Scoring System
When a divergence is detected on the composite, the indicator checks all four individual oscillators:
Score 1/4: Only one oscillator confirms - weak divergence
Score 2/4: Two oscillators confirm - moderate divergence (minimum for signals)
Score 3/4: Three oscillators confirm - strong divergence
Score 4/4: All four oscillators confirm - extreme divergence (highest probability)
The minimum confluence score (default 2) filters out weak divergences that lack multi-oscillator confirmation.
7. Signal Generation Logic
Signals are generated only at extreme oscillator levels with anti-overlap logic:
Bullish Signals:
Regular bullish divergence detected
Composite oscillator < -20 (oversold)
Confluence score >= minimum (default 2)
At least 20 bars since last bullish signal (anti-overlap)
Bearish Signals:
Regular bearish divergence detected
Composite oscillator > 20 (overbought)
Confluence score >= minimum (default 2)
At least 20 bars since last bearish signal (anti-overlap)
Extreme Signals:
Confluence score = 4/4 (all oscillators confirm)
Composite at extreme levels (< -30 or > 30)
Displayed as diamond shapes for emphasis
8. Visual Divergence Lines
Divergence lines are drawn connecting pivot points:
Regular Divergences: Solid lines (green = bullish, red = bearish)
Hidden Divergences: Dashed lines (cyan = bullish, orange = bearish)
Oscillator Pane: Lines drawn on composite oscillator
Chart Projection: Lines also drawn on main price chart (optional)
Lines provide visual confirmation of the divergence pattern and help identify the exact pivot points involved.
Visual Elements
Four Oscillator Lines: Thick colored lines showing RSI (cyan), MACD (magenta), TSI (yellow), and Stochastic (green)
Composite Line: White line showing unified oscillator
Zero Line: Gray horizontal line at zero
Overbought/Oversold Zones: Shaded areas at +30/-30 levels
Divergence Lines: Solid/dashed lines connecting pivot points
Signal Triangles: Small triangles at signal generation points
Extreme Diamonds: Larger diamonds for 4/4 confluence signals
Information Dashboard: Displays composite position, confluence score, RSI/MACD/TSI/Stochastic status, composite value, divergence types, signal strength, extreme events, and overall verdict
How to Use This Indicator
Step 1: Monitor Composite Position
Check if composite oscillator is at extreme levels (> 30 overbought, < -30 oversold). Divergences at extremes have highest probability.
Step 2: Check Confluence Score
Look for confluence scores of 3/4 or 4/4. Higher scores indicate stronger divergence confirmation across multiple oscillators.
Step 3: Identify Divergence Type
Regular divergences signal reversals, hidden divergences signal trend continuation. Trade accordingly.
Step 4: Wait for Signal Confirmation
Don't trade divergence lines alone. Wait for signal triangles that confirm divergence meets all criteria (extreme level, confluence, anti-overlap).
Step 5: Look for Extreme Events
Diamond shapes indicate 4/4 confluence at extreme levels - highest probability setups.
Step 6: Confirm with Price Action
Use divergence signals as alerts, then confirm with price action, support/resistance, or other indicators before entering.
Step 7: Check Individual Oscillators
Dashboard shows status of each oscillator. All four overbought/oversold provides additional confirmation.
Best Practices
Trade only divergences with confluence score >= 2 (default minimum)
Focus on regular divergences at extreme levels (< -30 or > 30) for reversals
Use hidden divergences to confirm trend continuation, not as standalone entries
Wait for signal triangles - don't front-run divergence lines
4/4 confluence signals (diamonds) offer highest probability setups
Combine with support/resistance levels for additional confirmation
Avoid divergences in middle range (-20 to +20) - wait for extremes
Use higher timeframe divergences for stronger significance
Input Parameters
Pivot Detection:
Pivot Left: Bars to left of pivot (default: 5)
Pivot Right: Bars to right of pivot (default: 5)
Max Lookback: Maximum bars to compare pivots (default: 60)
Min Lookback: Minimum bars to compare pivots (default: 5)
Oscillator Configuration:
RSI Length: Period for RSI (default: 14)
MACD Fast: Fast EMA period (default: 12)
MACD Slow: Slow EMA period (default: 26)
MACD Signal: Signal line period (default: 9)
TSI Long: Long smoothing period (default: 25)
TSI Short: Short smoothing period (default: 13)
Stochastic K: K period (default: 14)
Stochastic D: D smoothing (default: 3)
Divergence Rules:
Show Regular Divergence: Toggle regular divergence detection (default: enabled)
Show Hidden Divergence: Toggle hidden divergence detection (default: enabled)
Min Confluence Score: Minimum oscillators that must confirm (default: 2)
Project on Chart: Draw divergence lines on main chart (default: enabled)
Visual Configuration:
Bullish/Bearish Divergence Colors: Colors for regular divergences
Hidden Bullish/Bearish Colors: Colors for hidden divergences
Originality Statement
This indicator is original in its multi-oscillator confluence approach. While individual oscillators and divergence concepts are established, this indicator is justified because:
It combines four distinct oscillators into a unified composite system
The confluence scoring system measures divergence strength across multiple oscillators
Automatic detection of both regular and hidden divergences with pivot analysis
Signal generation includes extreme level filtering and anti-overlap logic
Chart projection allows divergence visualization on both oscillator and price chart
The comprehensive dashboard presents all oscillator states and divergence metrics simultaneously
Integration of multiple oscillator perspectives creates higher probability divergence signals
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Divergence analysis does not guarantee profitable trades or reversals. Past divergences do not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Gösterge

Nexus Structure Detector [JOAT]Nexus Structure Detector
Introduction
The Nexus Structure Detector is an advanced open-source Smart Money Concepts (SMC) indicator that identifies institutional order flow through Order Blocks, Fair Value Gaps, Liquidity Levels, and Market Structure analysis. This indicator combines multiple SMC methodologies into a unified system that reveals where institutions are positioning their orders and how they manipulate price to fill those orders.
Unlike basic support/resistance indicators, the Nexus Structure Detector provides institutional-grade structure analysis through order block detection, FVG identification, liquidity sweep tracking, and premium/discount zone mapping. The indicator is designed for traders who understand that institutions move markets through systematic order placement and liquidity manipulation.
Why This Indicator Exists
This indicator addresses the need for systematic SMC analysis on TradingView. By combining order blocks, fair value gaps, liquidity levels, and market structure into one tool, it reveals:
Order Blocks: The last candle before a strong move where institutions placed orders
Fair Value Gaps: Imbalances in price where institutions will likely return to fill orders
Liquidity Levels: Pivot highs/lows where retail stops cluster and institutions hunt liquidity
Market Structure: Break of Structure (BOS) and Change of Character (CHOCH) detection
Premium/Discount Zones: Price positioning relative to range equilibrium
Mitigation Tracking: Monitors when order blocks and FVGs are filled
Core Components Explained
1. Order Block Detection
Order blocks are identified by finding the candle with the most extreme price before a strong directional move. The indicator uses pivot detection to identify swing points, then traces back to find the order block candle:
Bullish Order Block: Forms when price breaks above a pivot low - the candle with the lowest low before the breakout becomes the bullish OB
Bearish Order Block: Forms when price breaks below a pivot high - the candle with the highest high before the breakdown becomes the bearish OB
Order blocks are drawn as boxes extending into the future. When price returns to an order block, institutions are likely to defend that zone. Mitigation occurs when price closes through the order block (wick or close mitigation options available).
2. Fair Value Gap (FVG) Detection
FVGs are three-candle patterns where there's a gap between candle 1's high/low and candle 3's low/high:
Bullish FVG: Current low > high from 2 bars ago (gap up)
Bearish FVG: Current high < low from 2 bars ago (gap down)
FVGs represent imbalances where price moved too quickly, leaving unfilled orders. Institutions often return to these zones to fill orders. The indicator tracks FVG mitigation using touch, wick, close, or average methods.
3. Liquidity Level Tracking
Liquidity levels are identified at pivot highs (Buy Side Liquidity - BSL) and pivot lows (Sell Side Liquidity - SSL). These represent areas where retail traders place stop losses:
Buy Side Liquidity (BSL): Above pivot highs where long stop losses cluster
Sell Side Liquidity (SSL): Below pivot lows where short stop losses cluster
Institutions often push price through these levels to trigger stops and fill their orders. The indicator tracks when liquidity is swept (price moves through the level) and displays swept levels with dotted lines.
4. Market Structure Analysis
The indicator tracks market structure by monitoring higher highs/lows and lower highs/lows:
Bullish Structure: Price making higher highs and higher lows
Bearish Structure: Price making lower highs and lower lows
Break of Structure (BOS): When structure continues in the same direction
Change of Character (CHOCH): When structure shifts direction
Market structure helps identify the current trend and potential reversal points. The indicator combines structure with order blocks and liquidity to identify high-probability setups.
5. Premium/Discount Zones
The indicator calculates the range between the highest high and lowest low over a lookback period (default 50 bars), then divides it into zones:
Premium Zone: Above 50% of the range (75-100%) - ideal for shorts
Equilibrium: At 50% of the range - neutral zone
Discount Zone: Below 50% of the range (0-25%) - ideal for longs
Institutions typically buy in discount zones and sell in premium zones. The indicator displays these zones with dotted lines and tracks current price position.
Visual Elements
Order Block Boxes: Solid boxes showing bullish (green) and bearish (red) order blocks with volume labels
Fair Value Gap Boxes: Dashed boxes showing bullish (cyan) and bearish (orange) FVGs
Liquidity Lines: Horizontal lines at pivot highs (BSL - green) and pivot lows (SSL - red)
Premium/Discount Lines: Dotted lines showing range extremes, 75%, equilibrium, and 25% levels
Mitigation Indicators: Faded boxes and dotted lines show mitigated zones
Information Dashboard: Displays market structure, active OBs/FVGs, liquidity levels, price position, and trading bias
How to Use This Indicator
Step 1: Identify Market Structure
Check the dashboard for current market structure (Bullish/Bearish/Neutral). Trade in the direction of structure for highest probability.
Step 2: Locate Order Blocks
Look for unmitigated order blocks in the direction of structure. Bullish OBs in discount zones and bearish OBs in premium zones offer best setups.
Step 3: Monitor Fair Value Gaps
FVGs often get filled before price continues. Use FVGs as entry zones when they align with order blocks and structure.
Step 4: Watch for Liquidity Sweeps
When price sweeps liquidity (BSL or SSL), it often reverses. Look for liquidity sweeps near order blocks for high-probability reversals.
Step 5: Check Price Position
Use premium/discount zones to determine if price is at an extreme. Buy in discount, sell in premium, avoid equilibrium.
Step 6: Combine Elements for Confluence
Best setups occur when multiple elements align: structure + order block + FVG + liquidity sweep + premium/discount zone.
Best Practices
Trade with market structure, not against it
Wait for price to return to order blocks before entering
Use liquidity sweeps as confirmation, not standalone signals
Combine order blocks with FVGs for highest probability entries
Avoid trading in equilibrium zones - wait for premium or discount
Monitor mitigation - once an OB or FVG is mitigated, it's no longer valid
Use higher timeframe structure to confirm lower timeframe setups
Be patient - wait for all elements to align before entering
Input Parameters
Structure Detection:
Swing Length: Pivot detection period (default: 10)
Max Order Blocks: Maximum OBs to display (default: 3)
Max Fair Value Gaps: Maximum FVGs to display (default: 3)
Max Liquidity Levels: Maximum liquidity lines (default: 3)
Mitigation Rules:
OB Mitigation: Wick or Close (default: Close)
FVG Mitigation: Touch, Wick, Close, or Average (default: Close)
Show Mitigated Zones: Toggle mitigated zone display (default: disabled)
Premium/Discount Zones:
Show PD Zones: Toggle zone display (default: enabled)
Lookback Period: Range calculation period (default: 50)
Visual Configuration:
Bullish/Bearish OB Colors: Customizable order block colors
Bullish/Bearish FVG Colors: Customizable FVG colors
Buy/Sell Liquidity Colors: Customizable liquidity line colors
Show Labels: Toggle zone labels (default: enabled)
Show Volume: Toggle volume display on OBs (default: enabled)
Show Dashboard: Toggle information table (default: enabled)
Originality Statement
This indicator is original in its comprehensive SMC integration. While individual concepts (order blocks, FVGs, liquidity) are established SMC principles, this indicator is justified because:
It combines four distinct SMC methodologies into a unified detection system
The automatic order block detection uses swing analysis to identify the exact candle
FVG tracking with multiple mitigation methods provides flexibility
Liquidity sweep detection with volume confirmation adds institutional context
Premium/discount zone integration provides price positioning context
Market structure tracking with BOS/CHOCH detection guides directional bias
The comprehensive dashboard presents all SMC elements simultaneously
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Smart Money Concepts are analytical tools, not guarantees of future price movement. Order blocks, FVGs, and liquidity levels do not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Gösterge

Bastion Execution Protocol [JOAT]Bastion Execution Protocol
Introduction
The Bastion Execution Protocol is an open-source automated trading strategy built in Pine Script v6. It combines regime detection, market structure analysis, dual momentum confirmation (RSI + Stochastic Momentum Index), order flow validation (CVD), candle pattern recognition, session filtering, and dynamic risk management into a single institutional-grade execution framework. The strategy is designed to take high-confluence directional trades only when multiple independent factors align — regime, structure, momentum, volume flow, and session — while managing risk through ATR-based stop losses, configurable reward-to-risk ratios, trailing stops, regime-adaptive position sizing, daily trade limits, and end-of-day forced closes.
This is not a "set and forget" black box. It is a transparent, fully configurable framework where every entry condition, risk parameter, and filter can be adjusted. The strategy is published open-source so traders can study the logic, understand why each trade is taken, and adapt the parameters to their instruments and timeframes.
Why This Strategy Exists
Most published strategies on TradingView fall into two categories: overly simple (single indicator crossover) or overly complex (dozens of conditions that overfit to historical data). This strategy occupies the middle ground — it requires meaningful confluence from independent analytical dimensions without over-optimizing to specific historical patterns:
Multi-Factor Entry Gate: Every trade requires agreement from regime detection, market structure, momentum oscillators, and optionally CVD order flow and candle patterns. No single factor can trigger a trade alone.
Regime-Aware Execution: The strategy only trades in trending regimes by default. It avoids squeeze conditions and can be configured to require specific regime states. Position sizing automatically reduces in volatile or uncertain regimes.
Session Intelligence: Trades are filtered by session (London, New York, Kill Zones) and day of week. The strategy avoids low-quality periods and forces position closure at end of day.
Dynamic Risk Management: ATR-based stop losses adapt to current volatility. Trailing stops activate after a configurable profit threshold. Position sizing is calculated from account equity and risk percentage, then adjusted by regime conditions.
Performance Tracking: Real-time HUD displays win rate, profit factor, max drawdown, daily trade count, and current position status.
Strategy Architecture — 9 Modules
The strategy is organized into 9 sequential modules, each responsible for a specific aspect of the trading process:
Module 1: Regime Detection
The regime engine classifies the market into four states using SMA alignment and VWAP slope:
Trend Up: SMA 20 > 50 > 200 (bull alignment) AND positive VWAP slope — clear upward momentum
Trend Down: SMA 20 < 50 < 200 (bear alignment) AND negative VWAP slope — clear downward momentum
Squeeze: Bollinger Band width in the bottom 10th percentile — volatility compression
Range: No SMA alignment and flat VWAP slope — sideways conditions
The VWAP slope is normalized by ATR to make it comparable across instruments with different price scales. The regime state directly controls whether trading is allowed — by default, the strategy requires a trending regime.
Module 2: Market Structure
Swing-based structure tracking identifies the directional bias:
Pivot highs and lows are detected using configurable lookback
When price closes above the last swing high while structure was bearish or neutral, structure flips bullish
When price closes below the last swing low while structure was bullish or neutral, structure flips bearish
Structure must agree with the regime for entries — regime bullish + structure bullish = long allowed
Displacement candle detection identifies aggressive institutional order flow — candles with body >= 70% of range and body >= 1.8x the 20-bar average body. These serve as entry triggers when all other conditions are met.
Module 3: Momentum Confirmation
Dual momentum confirmation requires both RSI and SMI to agree:
RSI: Must be above the bull threshold (default 55) for longs, below the bear threshold (default 45) for shorts
Stochastic Momentum Index: Must be positive for longs, negative for shorts. The SMI measures where price sits relative to the midpoint of its recent range, double-smoothed for noise reduction.
Both must agree — RSI bullish AND SMI bullish = momentum confirmed for longs
Module 3B: CVD Order Flow Confirmation
When enabled, Cumulative Volume Delta must support the trade direction:
Buy volume is estimated from bullish candles (close > open = full volume, otherwise proportional)
Sell volume = total volume minus buy volume
CVD = cumulative sum of (buy volume - sell volume)
CVD must be above its moving average for longs, below for shorts
This ensures that actual volume flow supports the intended trade direction
Module 3C: Candle Pattern Detection
When enabled, the strategy detects institutional candle patterns as entry triggers:
Bullish Engulfing: Current bullish candle fully engulfs the prior bearish candle's body, with volume above average
Bearish Engulfing: Current bearish candle fully engulfs the prior bullish candle's body, with volume above average
Bullish Pin Bar: Lower wick > 2x body, upper wick < 0.5x body — rejection of lower prices
Bearish Pin Bar: Upper wick > 2x body, lower wick < 0.5x body — rejection of higher prices
Patterns serve as alternative entry triggers alongside displacement candles. Either a displacement candle, a pattern, or price above SMA20 + VWAP can trigger entry when all other conditions are met.
Module 4: Session Filter
The session filter controls when trading is allowed:
Four session windows: NY Kill Zone (7-10am), London Kill Zone (2-5am), NY Session (9:30am-4pm), London Session (3am-9:30am)
Each session can be individually enabled/disabled
Day of week filter allows disabling specific days (e.g., avoid Mondays or Fridays)
Configurable timezone (default: America/New_York)
End-of-day forced close at configurable time (default: 3:45pm)
Module 5: Daily Trade Counter
A daily trade counter prevents overtrading:
Resets at the start of each new day
Configurable maximum trades per day (default: 3)
Combined with squeeze avoidance and regime filtering for comprehensive trade gating
Module 6: Entry Signal Generation
Entry signals require ALL of the following to be true simultaneously:
// Long entry requires full confluence:
// 1. Regime = Trend Up
// 2. Structure trend = Bullish (swing break confirmed)
// 3. RSI > bull threshold AND SMI > 0
// 4. CVD above its MA (if enabled)
// 5. Bar is confirmed (barstate.isconfirmed)
// 6. Trade is allowed (daily limit, session, no squeeze)
// 7. Trigger: displacement candle OR pattern OR price > SMA20 + VWAP
This multi-gate approach ensures that trades are only taken when regime, structure, momentum, volume flow, session, and a specific trigger all agree. The probability of a random signal passing all gates is very low, which is by design.
Module 7: Risk Calculations
Risk is calculated dynamically for each trade:
Stop Loss: ATR * configurable multiplier (default 1.5x) below entry for longs, above for shorts
Take Profit: SL distance * reward-to-risk ratio (default 2.0x)
Position Size: (Account Equity * Risk Percentage * Regime Multiplier) / SL Distance
Regime-Adaptive Sizing: When enabled, position size is reduced to 50% during squeeze conditions and 70% during non-trending conditions. Full size is used only in trending regimes.
Module 8: Trade Execution
Entries are executed using strategy.entry() with calculated position size. The strategy tracks active trade parameters (entry price, SL, TP) for trailing stop management.
Module 9: Exit Management
Three exit mechanisms operate simultaneously:
Fixed SL/TP: strategy.exit() with the calculated stop loss and take profit levels
Trailing Stop: When enabled, activates after price moves a configurable multiple of R in profit (default 1.0R). The trail distance is ATR * configurable multiplier (default 1.0x). The trailing stop only moves in the favorable direction and replaces the fixed SL when it is tighter.
End-of-Day Close: All positions are closed at the configured time to avoid overnight risk
Performance Tracking
The strategy tracks and displays real-time performance metrics:
Win Rate: Wins / (Wins + Losses) as a percentage
Profit Factor: Gross Profit / Gross Loss — values above 1.5 indicate a healthy edge
Max Drawdown: Peak-to-trough equity decline as a percentage
Net P&L: Total net profit/loss
Daily Trade Count: Current day's trades vs maximum allowed
Strategy Settings and Backtesting Notes
The strategy is configured with realistic default parameters:
Initial Capital: $100,000
Default Position Size: 2% of equity
Risk Per Trade: 1.5% (configurable)
Commission: Not included by default — users should add commission appropriate to their broker in the strategy settings
Slippage: Not included by default — users should add slippage appropriate to their instrument
calc_on_every_tick: false — the strategy only evaluates on confirmed bar closes to prevent repainting
calc_on_order_fills: true — allows trailing stop updates on fill events
Important: Before evaluating backtest results, users should:
Add realistic commission for their broker (e.g., $5 per trade for stocks, 0.1% for crypto)
Add realistic slippage (e.g., 1-2 ticks for liquid instruments)
Verify that the backtest period includes different market conditions (trending, ranging, volatile)
Check that the number of trades is sufficient for statistical significance (100+ trades recommended)
Understand that past performance does not guarantee future results
Input Parameters
Risk Management:
Risk Per Trade %: Percentage of equity risked per trade (default: 1.5%)
Reward:Risk Ratio: TP distance as multiple of SL distance (default: 2.0)
SL ATR Multiplier: Stop loss distance as ATR multiple (default: 1.5)
ATR Length: Period for ATR calculation (default: 14)
Use Trailing Stop: Enable/disable trailing (default: true)
Trail After X R Profit: Profit threshold to activate trail (default: 1.0R)
Trail ATR Multiplier: Trail distance as ATR multiple (default: 1.0)
Max Trades Per Day: Daily trade limit (default: 3)
Regime-Adaptive Sizing: Reduce size in non-trending conditions (default: true)
Regime Filter:
VWAP Slope Lookback: Period for slope calculation (default: 20)
Slope Threshold: Normalized threshold for trend detection (default: 0.12)
Bollinger Length/Multiplier: BB parameters for squeeze detection (default: 20/2.0)
Avoid Squeeze Entries: Skip entries during squeeze (default: true)
Require Trend Regime: Only trade in trending conditions (default: true)
Structure:
Swing Lookback: Pivot detection length (default: 5)
Displacement Min Body Ratio: Minimum body/range for displacement (default: 0.7)
Displacement Body Multiplier: Minimum body vs average for displacement (default: 1.8)
Momentum:
RSI Length/Thresholds: RSI parameters (default: 14, bull 55, bear 45)
SMI Lookback/Smoothing: SMI parameters (default: 13/25/2)
Session Filter:
Enable Session Filter: Toggle session-based trade gating
Individual session toggles: NY KZ, London KZ, NY, London
Day of week toggles: Monday through Friday
Force Close End of Day: Toggle EOD position closure
Close Hour/Minute: EOD close time (default: 15:45)
Order Flow:
CVD Confirmation: Require delta direction to match entry (default: true)
CVD Lookback: Period for CVD moving average (default: 10)
Candle Patterns:
Use Pattern Confirmation: Enable pattern detection as entry trigger (default: true)
Pattern Volume Multiplier: Minimum volume for pattern confirmation (default: 1.3x)
How to Use This Strategy
Step 1: Configure for Your Instrument
Adjust the ATR multiplier and displacement thresholds for your instrument's volatility. Add realistic commission and slippage in TradingView's strategy settings.
Step 2: Set Your Risk Parameters
Choose a risk percentage that matches your risk tolerance. The default 1.5% with 2:1 R:R is conservative. Adjust the trailing stop parameters based on your preference for locking in profits vs giving trades room.
Step 3: Configure Sessions
Enable the sessions relevant to your instrument. For US equities, NY KZ and NY Session are most relevant. For forex, both London and NY Kill Zones are important. Disable days you prefer not to trade.
Step 4: Run the Backtest
Apply the strategy to your chart and review the backtest results. Check win rate, profit factor, max drawdown, and number of trades. Ensure results are realistic and not the product of overfitting.
Step 5: Forward Test
Before trading live, run the strategy in paper trading mode for at least 2-4 weeks to verify that live performance matches backtest expectations.
Best Practices
Always add commission and slippage before evaluating backtest results
The strategy works best on liquid instruments with reliable volume data
Higher timeframes (15m+) produce fewer but higher-quality trades
The multi-gate entry system means trades are infrequent by design — this is a feature, not a bug
Regime-adaptive sizing is recommended — it automatically reduces exposure in uncertain conditions
The daily trade limit prevents revenge trading and overexposure
End-of-day forced close eliminates overnight gap risk for intraday strategies
Monitor the HUD during live trading for real-time regime, momentum, and session context
If win rate drops below 40% or profit factor drops below 1.0, re-evaluate parameters for current market conditions
Limitations
The strategy uses lagging indicators (SMAs, RSI, SMI) for entry conditions. Entries occur after the trend has started, not at the exact turn.
Regime detection can lag regime changes. The strategy may miss the first portion of a new trend or take a trade just as a trend is ending.
CVD is estimated from candle direction, not true order flow data. This is an approximation.
Backtest results are hypothetical and do not account for real-world execution issues (partial fills, requotes, connectivity).
The strategy is designed for intraday/swing trading. It is not optimized for scalping or long-term position trading.
Session filtering is based on EST timezone. Instruments traded primarily in other timezones may need different session definitions.
The multi-gate entry system can be too restrictive in some market conditions, producing very few trades. This is intentional — the strategy prioritizes quality over quantity.
Past performance in backtesting does not guarantee future results. Market conditions change, and strategies that worked historically may not work in the future.
Technical Implementation
Built with Pine Script v6 using:
calc_on_every_tick=false for non-repainting execution
barstate.isconfirmed gating on all signal generation
9-module architecture with clear separation of concerns
ATR-based dynamic stop loss and take profit calculation
Trailing stop with configurable activation threshold and trail distance
Regime-adaptive position sizing with squeeze and non-trending penalties
Session detection with timezone support and day-of-week filtering
Daily trade counter with automatic reset
End-of-day forced close mechanism
Real-time performance tracking (win rate, profit factor, max drawdown)
Dual momentum confirmation (RSI + SMI)
CVD order flow validation
Candle pattern detection (engulfing, pin bar) with volume confirmation
6 alert conditions covering entries, regime changes, EOD close, patterns, and drawdown
Originality Statement
This strategy is original in its multi-dimensional confluence framework. While individual components (RSI, SMI, SMA alignment, session filtering) are established concepts, this strategy is justified because:
The 9-module architecture creates a clear, auditable decision pipeline where each module's contribution to the final trade decision is transparent
The multi-gate entry system (regime + structure + dual momentum + CVD + session + trigger) requires an unusually high level of confluence, reducing false signals
Regime-adaptive position sizing automatically adjusts exposure based on market conditions, a feature rarely seen in published strategies
The combination of trailing stops with regime-aware sizing creates a dynamic risk framework that adapts to changing conditions
Session filtering with Kill Zone preference and day-of-week controls provides institutional-grade time management
CVD order flow confirmation adds a volume-based validation layer that pure price-based strategies lack
The real-time HUD with performance tracking provides transparency into strategy behavior that most published strategies do not offer
The Volcanic theme provides a cohesive visual identity where every color choice carries meaning (lava = entry, amber = warning, teal = VWAP, crimson = bearish)
Disclaimer
This strategy is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Backtested results are hypothetical and do not represent actual trading. Past performance does not guarantee future results. The strategy involves risk of loss, including the potential loss of the entire investment. Commission, slippage, and other real-world execution costs are not included in the default configuration and must be added by the user for realistic evaluation. The author makes no claims about the profitability of this strategy and is not responsible for any losses incurred from its use. Always use proper risk management, trade with capital you can afford to lose, and consider consulting a qualified financial advisor before trading.
-Made with passion by officialjackofalltrades
Strateji

ON sqrtRange -> RTH Open LevelsOvernight sqrtRange → RTH Open Levels
This indicator captures the overnight session range (6 PM – 9:30 AM ET), takes the square root of that range, multiplies it by a user-defined factor, and snaps the result to the nearest tick to produce a dynamic unit (U). Starting from the RTH open at 9:30 AM, it plots up to 8 levels above and below, creating a structured price map for the entire trading day.
Features:
-Auto-calculated unit size from overnight range math
-Up to 8 levels each side with color-coded band fills and midpoints
-ONH / ONL lines with breach markers
-Day type classifier at open (Trend Up / Trend Down / Two-sided)
-Gap detection above ONH or below ONL at the open
-Live info table showing range, sqrtR, unit size, nearest levels, and tick distances
-Alert conditions for every level cross, ONH/ONL breach, and gap opens
-All levels drawn with line objects — zero plot budget wasted
Best used on: ES, NQ futures, but not limited to, individual names may need to tweak the settings for individual names to avoid big or small ranges, which is what the multiplier setting is for(I typically only work with 1,2,4,8 on the multiplier)
For ES, 2x multiplier is ideal and 4x on NQ and dow
individual names vary but typically 1x-2x on the multiplier Gösterge

Trend Resonance Oscillator [JOAT]Trend Resonance Oscillator
Introduction
The Trend Resonance Oscillator is an open-source non-overlay indicator that measures multi-timeframe trend alignment and produces a composite resonance score. It fetches trend data from up to five configurable timeframes, calculates whether they agree on direction, and outputs an oscillator that reflects the degree of alignment. When most or all timeframes point the same way, the oscillator reaches extreme values and the indicator declares a state of "resonance" — a condition where directional conviction is high across the time spectrum. It also includes quantum-inspired coherence scoring, harmonic pattern detection, and momentum alignment visualization.
Built with Pine Script v6, the indicator uses custom types for trend state, resonance state, timeframe data, quantum state, and harmonic patterns.
Why This Indicator Exists
A trade taken in the direction of the 5-minute trend may fail if the 1-hour and daily trends disagree. Multi-timeframe alignment is one of the most reliable filters for trade quality, but checking multiple timeframes manually is tedious and subjective. This indicator automates that process by:
Simultaneous MTF analysis: Fetches close, EMA, and rate-of-change data from five configurable timeframes in a single indicator
Alignment scoring: Quantifies how many timeframes agree on direction and how strong each trend is, producing a single composite score
Resonance detection: Identifies periods when alignment exceeds a configurable threshold, signaling high-conviction directional conditions
Confluence signals: Generates labeled signals when a minimum number of timeframes align, providing clear entry confirmation
Coherence and entanglement metrics: Measures the consistency and correlation between timeframe trends, adding depth beyond simple directional agreement
Core Components Explained
1. Multi-Timeframe Trend Detection
For each of the five timeframes (default: 5m, 15m, 1H, 4H, Daily), the indicator fetches close price, EMA, and rate-of-change using `request.security()` with proper lookahead settings to avoid repainting:
float _tf1Close = request.security(syminfo.tickerid, tf1, close, barmerge.gaps_off, barmerge.lookahead_off)
float _tf1EMA = request.security(syminfo.tickerid, tf1, _globalEMA, barmerge.gaps_off, barmerge.lookahead_off)
Each timeframe's trend is classified as bullish, bearish, or flat based on the percentage difference between close and EMA relative to a configurable threshold (default 0.5%). The trend strength is calculated as the magnitude of that percentage difference, capped at 100.
2. Alignment Score Calculation
The alignment score counts how many timeframes are bullish versus bearish, then produces a normalized score from -100 (all bearish) to +100 (all bullish):
+100: All active timeframes are bullish — maximum bullish alignment
+60: Majority bullish with some neutral — strong bullish bias
0: Equal bullish and bearish — no directional consensus
-60: Majority bearish — strong bearish bias
-100: All bearish — maximum bearish alignment
The alignment score is weighted by the average trend strength across all active timeframes, so a +80 alignment with strong individual trends produces a higher oscillator value than +80 alignment with weak trends.
3. Resonance Detection
Resonance occurs when the ratio of aligned timeframes to total active timeframes exceeds the resonance threshold (default 0.7) and the aligned count meets the minimum confluence requirement (default 4 timeframes). During resonance, the background is tinted to indicate the directional bias, and a duration counter tracks how long the resonance state has persisted.
Sustained resonance (high duration) suggests a strong, established trend. New resonance (low duration) may signal the beginning of a directional move. The dashboard displays the resonance score, aligned count, and duration for quick assessment.
The Trend Resonance Oscillator panel showing the main oscillator line with gradient coloring, MTF trend bars at the bottom showing individual timeframe directions, resonance background shading during a strong bullish alignment, and confluence/resonance signal labels
4. Quantum Coherence and Entanglement
The indicator calculates two additional metrics inspired by quantum physics concepts (used as analytical metaphors, not literal physics):
Coherence: The ratio of aligned timeframes to total timeframes. A coherence of 1.0 means perfect agreement. When coherence exceeds the threshold (default 0.8), the indicator enters a "coherent" state, which is visualized as a subtle wave pattern on the oscillator.
Entanglement: Measures the pairwise correlation between all timeframe trends. For each pair of timeframes, if they agree on direction, the entanglement score increases; if they disagree, it decreases. High entanglement means timeframes are moving in lockstep.
for i = 0 to 3
for j = i + 1 to 4
if trend_i != 0 and trend_j != 0
correlation = trend_i == trend_j ? 1.0 : -1.0
entanglement += correlation
pairs += 1
When the quantum superposition score (combination of coherence and entanglement) exceeds a threshold, a "quantum collapse" signal fires, indicating that all timeframes have converged to a single directional state.
5. Harmonic Pattern Detection
The harmonic module detects cyclical patterns in the resonance data. When resonance is sustained for more than 10 bars, the pattern is classified as a sine wave (smooth, established trend). When resonance is new or intermittent, it is classified as a square wave (choppy, emerging trend). The harmonic wave is plotted as a subtle overlay on the oscillator.
6. Confluence and Signal System
The indicator generates three tiers of signals, with higher tiers taking priority:
CONF (Confluence): Minimum timeframes aligned with alignment score >= 70
RES (Resonance): Strong resonance with score >= 80
QTM (Quantum): Quantum collapse — all metrics converge to a single state
Each signal fires only on its first bar (not continuously), preventing chart clutter. Signals are color-coded with gradient intensity based on the underlying strength.
Visual Elements
Main Oscillator: Smoothed alignment score plotted as a line with gradient coloring from bearish to bullish
Reference Levels: Lines at 0 (neutral), +/-50 (moderate), +/-80 (strong)
MTF Trend Bars: Five colored column bars at the bottom of the panel, each representing one timeframe's trend direction and strength
Resonance Background: Tinted background during resonance states
Quantum Superposition Line: Step-line showing the quantum composite score
Coherence Wave: Subtle area plot showing coherence oscillation
Harmonic Pattern: Sine/square wave overlay during active resonance
Momentum Alignment: Area histogram showing aggregate momentum across timeframes
Convergence/Divergence: Histogram showing agreement between momentum and oscillator
Signal Labels: CONF, RES, and QTM labels at signal points
Entanglement Lines: Visual connections when timeframe entanglement is high
Dashboard: Comprehensive table showing each timeframe's trend, strength, and the aggregate resonance metrics
Input Parameters
Multi-Timeframe Settings:
Toggle and configure each of 5 timeframes (default: 5m, 15m, 1H, 4H, Daily)
Trend Detection:
Trend EMA Length (default 20), Momentum Length (default 14), Trend Threshold (default 0.5%)
Resonance Settings:
Resonance Lookback (default 20), Resonance Threshold (default 0.7)
Show Resonance Zones toggle
Alignment Scoring:
Min TFs for Confluence (default 4)
Show Alignment Score and Confluence Signals
Advanced Resonance:
Quantum Resonance, Coherence Waves, Entanglement Lines, Harmonic Patterns toggles
Coherence Threshold (default 0.8), Harmonic Period (default 8)
Visual Settings:
Show Oscillator, MTF Bars, Dashboard, Glow Effects, Waveform
Color Scheme: Quantum, Classic, Professional, Neon
How to Use This Indicator
Step 1: Check the MTF trend bars at the bottom of the panel. If all five bars are the same color (all bullish or all bearish), you have strong multi-timeframe alignment.
Step 2: Read the oscillator value. Values above +50 indicate moderate bullish alignment; above +80 indicates strong alignment. The inverse applies for bearish readings.
Step 3: Watch for resonance background shading. When the background turns bullish or bearish, the indicator has detected sustained multi-timeframe agreement — this is the highest-conviction environment for directional trades.
Step 4: Use CONF, RES, and QTM signals as entry confirmations. A CONF signal in the direction of the oscillator provides moderate confirmation. A RES or QTM signal provides strong confirmation.
Step 5: Monitor the momentum alignment area. When momentum and the oscillator agree, the move has both directional alignment and momentum behind it. When they diverge, the move may be losing steam.
Dashboard showing all five timeframes with their individual trend states, the aggregate resonance score, coherence level, entanglement reading, and harmonic pattern status
Indicator Limitations
Multi-timeframe data requires sufficient history on all selected timeframes. On newly listed instruments, higher timeframe data may be limited.
The indicator uses `request.security()` with `barmerge.lookahead_off` to prevent repainting, but the inherent delay of higher timeframe data means signals reflect confirmed (not real-time) higher timeframe states.
Alignment does not guarantee profitable trades. All timeframes can align in one direction and then reverse simultaneously.
The quantum and harmonic features are analytical metaphors that provide useful metrics, not literal physics simulations.
On very low timeframes (1m or less), higher timeframe data updates infrequently, which can make the oscillator appear static for extended periods.
The indicator makes multiple `request.security()` calls, which counts against TradingView's security call limit.
Originality Statement
This indicator is original in its comprehensive multi-timeframe resonance framework. While MTF trend indicators exist, this indicator is justified because:
It produces a quantified resonance score that measures not just direction but the degree and duration of multi-timeframe agreement
The coherence and entanglement metrics add pairwise correlation analysis between timeframes, going beyond simple directional counting
The three-tier signal system (CONF/RES/QTM) provides graduated confidence levels based on the strength of alignment
Harmonic pattern detection on the resonance data identifies whether alignment is sustained (sine) or emerging (square)
The momentum alignment overlay shows whether aggregate momentum across timeframes supports the directional reading
The weighted oscillator combines alignment direction with individual trend strength for a more nuanced composite score
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Multi-timeframe alignment is a powerful filter but does not guarantee profitable trades. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Gösterge

Volume Dispersion Field [JOAT]Volume Dispersion Field
Introduction
The Volume Dispersion Field is an open-source non-overlay indicator that provides a comprehensive volume analysis suite combining relative volume classification, buy/sell delta tracking, volume dispersion measurement, climax detection, volume profile calculation, smart money activity analysis, and anomaly detection. Rather than showing a simple volume histogram, this indicator dissects volume into multiple analytical layers that reveal who is participating, how aggressively, and whether the activity is normal or anomalous.
Built with Pine Script v6, the indicator uses custom types for volume state, delta state, dispersion bins, profile data, smart money state, and volume pulse tracking.
Why This Indicator Exists
Standard volume indicators show a single bar per candle. This tells you how much volume occurred but not who was buying or selling, whether the volume is unusual, or how volume is distributed across the price range. This indicator addresses those gaps by providing:
Seven-tier volume classification: Categorizes each bar from Extreme Low to Extreme High relative to the moving average, giving immediate context about whether current activity is normal or exceptional
Delta analysis: Estimates buying and selling volume using candle structure, then calculates smoothed delta and cumulative delta to show the net direction of volume pressure
Volume dispersion: Measures how volume is distributed between the upper and lower halves of the recent price range, revealing whether volume is concentrated at highs (distribution) or lows (accumulation)
Climax detection: Identifies volume spikes that exceed a configurable threshold, often marking exhaustion points or the start of major moves
Smart money analysis: Tracks institutional-sized volume activity and classifies the market phase as Accumulation, Markup, Distribution, or Markdown
Anomaly detection: Uses Z-score analysis to flag statistically unusual volume events that may indicate institutional intervention
Core Components Explained
1. Volume Classification System
Every bar is classified into one of seven categories based on its ratio to the volume moving average:
volMA = ta.sma(volume, volMaLength)
volRatio = volume / volMA
Extreme High (>= 3.0x): Institutional-level activity, potential climax
High (>= 2.0x): Significant above-average interest
Above Average (>= 1.0x): Healthy participation
Average (>= 0.5x): Normal market conditions
Below Average (>= 0.25x): Reduced interest
Low (< 0.25x): Thin liquidity, potential for slippage
Extreme Low: Minimal activity
Each category is color-coded with a distinct color from the Quantum Volume palette, making it instantly visible which bars carry institutional weight and which are retail noise. The high and low volume multiplier thresholds are fully configurable.
2. Delta Analysis
The delta engine estimates buying and selling volume by analyzing candle structure. For a bullish candle (close > open), buying volume is estimated as the proportion of the candle range from low to close, multiplied by total volume:
if close > open
buyVol := volume * (close - low) / (high - low + 0.0001)
sellVol := volume - buyVol
else if close < open
sellVol := volume * (high - close) / (high - low + 0.0001)
buyVol := volume - sellVol
The raw delta (buyVol - sellVol) is smoothed with an EMA and also accumulated over a configurable period to produce cumulative delta. Rising cumulative delta with rising price confirms bullish conviction. Falling cumulative delta with rising price warns of hidden distribution.
The indicator also detects delta divergences — when price moves in one direction but delta moves in the opposite direction over a 10-bar window. These divergences are marked with cross symbols on the chart.
The Volume Dispersion Field panel showing color-coded volume bars, delta histogram, cumulative delta line, and smart money accumulation/distribution arrows with the dashboard displaying all metrics
3. Volume Dispersion Measurement
Dispersion quantifies how volume is distributed between the upper and lower halves of the recent price range. Over the dispersion lookback period (default 50 bars), the indicator sums volume for bars that closed in the upper half versus the lower half:
Positive dispersion (> 20): Volume is concentrated in the upper range — bullish bias, potential distribution if extended
Negative dispersion (< -20): Volume is concentrated in the lower range — bearish bias, potential accumulation if extended
Near zero: Volume is balanced across the range — no clear directional bias
Dispersion is plotted as a filled area chart, providing a visual representation of where the volume weight sits within the price range.
4. Volume Profile and POC
The indicator calculates a simplified volume profile by dividing the recent price range into configurable bins (default 10) and summing volume in each bin. From this profile, it derives:
Point of Control (POC): The price level with the highest volume — acts as a magnet for price
Value Area High (VAH): Upper boundary of the 70% volume concentration zone
Value Area Low (VAL): Lower boundary of the 70% volume concentration zone
The profile type is classified as Normal (balanced), Imbalanced (narrow value area, directional), or Ranged (wide value area, consolidation).
5. Smart Money and Anomaly Detection
The smart money engine analyzes volume distribution across the price range over a 50-bar window. If significantly more volume occurs in the lower 30% of the range while price is below its 50-period SMA, the indicator classifies the phase as Accumulation. If more volume occurs in the upper 30% while price is above the SMA, it classifies as Distribution.
Anomaly detection uses Z-score analysis:
volState.zScore := (volume - volMA) / (volStdDev + 0.0001)
volState.isAnomaly := math.abs(volState.zScore) > anomalyThreshold
Volume events with Z-scores exceeding the threshold (default 3.0 standard deviations) are flagged as anomalies and marked with diamond symbols. These statistically rare events often indicate institutional intervention or major news-driven activity.
6. Market Phase Classification
The indicator classifies the current market phase based on the combination of price direction and volume trend:
Markup: Price rising + volume rising — healthy uptrend
Distribution: Price rising + volume falling — potential top forming
Accumulation: Price falling + volume rising — smart money buying the dip
Markdown: Price falling + volume falling — healthy downtrend
Visual Elements
Volume Histogram: Color-coded bars by classification tier
Volume MA Line: 20-period moving average of volume
High/Low Volume Bands: Reference bands at the high and low multiplier levels with fill
Delta Histogram: Smoothed buy/sell delta with gradient coloring
Cumulative Delta Line: Running sum of delta over configurable period
Dispersion Area: Filled area showing volume distribution bias
Climax Markers: Triangle markers for buy and sell climax events
Anomaly Markers: Diamond markers for statistically unusual volume
Smart Money Arrows: Accumulation (up arrow) and Distribution (down arrow) signals
Volume Pulse: Circle markers when volume exceeds the pulse threshold
Heatmap Background: Subtle background coloring based on volume intensity
Dashboard: 14-row metrics table showing volume category, anomaly status, phase, delta direction, dispersion, and more
Close-up of the dashboard showing volume classification as "HIGH", phase as "Markup", delta as "BULLISH" with "BUY SIDE" flow, and an anomaly detection reading
Input Parameters
Volume Analysis:
Volume MA Length (default 20)
High Volume Multiplier (default 2.0) and Low Volume Multiplier (default 0.5)
Delta Analysis:
Delta Smoothing (default 3)
Cumulative Delta Length (default 20)
Dispersion Settings:
Dispersion Lookback (default 50) and Dispersion Bins (default 10)
Climax Detection:
Climax Threshold (default 2.5) and Climax Lookback (default 50)
Advanced Volume:
Smart Money Concepts, Institutional Activity, Volume Anomalies toggles
Anomaly Threshold (default 3.0 std dev)
Volume Pulse toggle and Pulse Threshold (default 1.5)
Visual Settings:
Volume Profile, Dashboard, Glow Effects, Heatmap toggles
Profile Width and Color Scheme (Quantum, Classic, Professional, Neon)
How to Use This Indicator
Step 1: Monitor the volume classification. Extreme High and High bars deserve attention — they indicate institutional participation. Consecutive high-volume bars in one direction confirm conviction.
Step 2: Check the delta direction. Bullish delta with rising price confirms the move. Bearish delta with rising price (divergence) warns of potential reversal.
Step 3: Watch for climax events. A buy climax (extreme volume + bullish candle) at a resistance level may signal exhaustion. A sell climax at support may signal capitulation.
Step 4: Monitor the market phase. Accumulation phases often precede significant upward moves. Distribution phases often precede declines.
Step 5: Pay attention to anomaly markers. These statistically rare volume events often mark turning points or the start of major institutional campaigns.
Step 6: Use dispersion to understand volume positioning. Positive dispersion (volume at highs) during an uptrend is healthy. Positive dispersion during a downtrend suggests distribution.
Indicator Limitations
Delta estimation uses candle structure as a proxy for actual order flow. It is an approximation, not true Level 2 data.
Volume analysis works best on instruments with reliable, consistent volume data. Forex spot volume from brokers is tick volume, not true exchange volume.
Anomaly detection assumes volume follows a roughly normal distribution. During earnings seasons or major events, multiple "anomalies" may fire in succession.
The volume profile is a simplified calculation using close prices, not a tick-by-tick profile. It provides a useful approximation but not exchange-grade precision.
Smart money phase classification is based on volume distribution patterns, not on actual institutional order data.
Climax detection identifies extreme volume events but does not predict the direction of the subsequent move.
Originality Statement
This indicator is original in its comprehensive, multi-layer approach to volume analysis. While individual volume tools exist, this indicator is justified because:
It combines seven distinct volume analysis methodologies (classification, delta, dispersion, profile, climax, smart money, anomaly) into a unified system
Z-score-based anomaly detection provides a statistical framework for identifying unusual volume that simple threshold methods miss
Market phase classification (Accumulation/Markup/Distribution/Markdown) adds a Wyckoff-inspired context layer to raw volume data
Volume dispersion measurement quantifies the spatial distribution of volume across the price range, a metric not available in standard volume indicators
The delta divergence detection system identifies hidden disagreements between price and volume pressure
The comprehensive dashboard presents 14 metrics simultaneously for holistic volume analysis
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Volume analysis is a tool for understanding market participation, not a crystal ball for predicting future price movement. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Gösterge

Fibonacci Imbalance Zones [JOAT]Fibonacci Imbalance Zones
Introduction
Fibonacci Imbalance Zones is an open-source overlay indicator that merges automatic Fibonacci retracement with Fair Value Gap (FVG) detection and order block identification to find high-probability confluence zones where institutional concepts overlap. When a Fibonacci level aligns with an unmitigated FVG or an active order block, the indicator highlights that zone as a confluence point and optionally generates entry signals. It bridges the gap between classical Fibonacci analysis and modern Smart Money Concepts.
Built with Pine Script v6, the indicator uses custom types for Fibonacci levels, FVG zones, confluence points, swing points, order blocks, and institutional levels.
Why This Indicator Exists
Fibonacci retracement and FVG analysis are both widely used, but they are almost always applied as separate tools. Traders manually eyeball whether a Fibonacci level happens to overlap with an FVG, which is subjective and error-prone. This indicator automates that process by:
Auto-Fibonacci calculation: Automatically identifies the most recent significant swing high and swing low using pivot detection, then draws Fibonacci levels between them — no manual drawing required
FVG lifecycle tracking: Detects bullish and bearish FVGs, filters them by minimum size (ATR-based), tracks mitigation, and classifies them as premium or discount relative to fair value
Confluence detection: Programmatically checks whether any active Fibonacci level falls within a configurable ATR tolerance of any unmitigated FVG or order block, and calculates a confluence strength score
Entry signal generation: When price enters an FVG zone that overlaps with a key Fibonacci level (0.500-0.786 range), the indicator generates a directional entry signal
Core Components Explained
1. Automatic Fibonacci Levels
The indicator uses pivot detection to find the most significant recent swing high and swing low. The pivot strength parameter (default 5) controls how many bars on each side must be lower/higher for a point to qualify as a swing. Once swings are identified, Fibonacci levels are calculated:
calcFibLevel(float swingH, float swingL, float ratio, int direction) =>
float level = na
if direction > 0
level := swingL + (swingH - swingL) * ratio
else
level := swingH - (swingH - swingL) * ratio
level
Standard levels include 0.236, 0.382, 0.500, 0.618, and 0.786, each toggleable independently. Extensions at 1.618 and 2.272 are also available. When harmonic ratios are enabled, additional levels at 0.127, 0.414, 0.707, and 0.886 are drawn, covering the full spectrum of Fibonacci and harmonic trading levels.
Each level is drawn as a dashed line extending from the swing range to the right of the chart, with a label showing the ratio. Harmonic ratios receive a glow effect (thicker line, lower transparency) to visually distinguish them from standard levels.
2. FVG Detection with Premium/Discount Classification
Fair Value Gaps are detected using the standard three-bar pattern: a bullish FVG forms when the current bar's low is above the high from two bars ago. The indicator filters FVGs by a minimum size threshold (default 0.3x ATR) to avoid plotting insignificant gaps.
Each FVG is classified as premium or discount relative to the fair value of the middle candle:
Premium FVG: The gap's midpoint is above fair value — sellers may have an edge
Discount FVG: The gap's midpoint is below fair value — buyers may have an edge
FVGs are drawn as colored boxes. Premium FVGs use a gold color, discount FVGs use cyan, and neutral FVGs use the standard bull/bear colors. When mitigation tracking is enabled, the indicator monitors each FVG and updates its visual style (dotted border, faded color) when price fills the gap's midpoint.
Chart showing auto-drawn Fibonacci levels between swing high and swing low, with FVG boxes classified as premium (gold) and discount (cyan), and confluence diamonds where Fibonacci levels overlap with FVGs
3. Order Block Detection
The indicator identifies order blocks as the last opposing candle before a significant swing point, filtered by volume. A bullish order block is the last bearish candle before a swing high, but only if the volume on that candle exceeds 1.5x the 20-period volume average. This volume filter ensures that only institutionally significant order blocks are tracked.
Order blocks are drawn as semi-transparent boxes and monitored for sweeps. When price breaks through an order block, it is marked as swept and its visual is updated to a neutral, dotted style.
4. Confluence Detection Engine
The confluence engine is the core innovation of this indicator. It iterates through all active Fibonacci levels and checks each one against all unmitigated FVGs and active order blocks:
tolerance = atrVal * confluenceTol
for fib in fibLevels
if fib.isActive
for fvg in fvgZones
if not fvg.isMitigated
if math.abs(fib.price - fvg.mid) < tolerance
confStrength += 1
Each confluence point receives a strength score based on how many factors align:
Fibonacci level + FVG = base confluence
Add +1 if the Fibonacci level is a harmonic ratio (0.382, 0.618, etc.)
Add +1 if the FVG is in the premium or discount zone
Add +1 if the FVG has above-average volume
Add +1 if an order block also overlaps
Confluence points are drawn as labeled boxes showing which factors are present (e.g., "Harmonic+Discount+Volume"). A minimum confluence strength threshold (default 2) filters out weak confluences.
5. Entry Signal Generation
When entry signals are enabled, the indicator generates a bullish entry when price enters a bullish FVG zone that overlaps with a Fibonacci level in the 0.500-0.786 range (the "golden pocket") and the current candle closes bullish. The bearish entry is the inverse. These signals are plotted as circles below (bullish) or above (bearish) the price bars.
Visual Elements
Fibonacci Lines: Dashed lines at each active ratio with labels, harmonic ratios get glow effect
FVG Boxes: Color-coded by direction and premium/discount status, updated on mitigation
Order Block Boxes: Semi-transparent boxes with sweep tracking
Confluence Boxes: Highlighted zones where Fibonacci and FVG/OB overlap, with strength labels
Entry Signals: Circle markers for bullish/bearish entries at confluence zones
Structure Line: Line connecting the swing high and swing low
Background Coloring: Subtle trend-direction background tint
Dashboard: Displays current Fibonacci range, trend direction, active FVG count, confluence count, and entry status
Input Parameters
Fibonacci Settings:
Swing Lookback (default 50) and Pivot Strength (default 5)
Toggle each standard level (0.236, 0.382, 0.500, 0.618, 0.786) and extensions
FVG Detection:
FVG Max Age (default 50 bars)
Track Mitigation toggle
Min FVG Size (default 0.3 ATR)
Confluence Settings:
Confluence Tolerance (default 0.3 ATR)
Show Entry Signals and Confluence Strength
Min Confluence Strength (default 2)
Advanced Fibonacci:
Show Harmonic Ratios (0.127, 0.414, 0.707, 0.886)
Show Institutional Levels (volume-based levels near swings)
Show Smart Money Concepts and Order Blocks
Show Premium/Discount classification
Visual Settings:
Color Scheme: Quantum, Classic, Professional, or Minimal
Show Structure Lines, Dashboard, Glow Effects, Animation
Max Visual Elements (default 30)
How to Use This Indicator
Step 1: Let the indicator automatically identify the current swing range and draw Fibonacci levels. The structure line shows the swing high to swing low connection.
Step 2: Identify the trend direction from the structure line. In an uptrend (swing low formed after swing high), look for bullish setups at discount Fibonacci levels (0.618, 0.786). In a downtrend, look for bearish setups at premium levels.
Step 3: Watch for confluence diamonds. When a Fibonacci level overlaps with an unmitigated FVG, the confluence box appears. Higher strength confluences (3+) are more significant.
Step 4: If entry signals are enabled, wait for price to enter the confluence zone and print a confirming candle (bullish close for longs, bearish close for shorts).
Step 5: Use order blocks within the confluence zone as precise entry levels. The order block's range provides a natural stop-loss area (below the OB for longs, above for shorts).
Close-up of a high-strength confluence zone showing a 0.618 Fibonacci level overlapping with a discount FVG and a bullish order block, with an entry signal circle below the bar
Indicator Limitations
Automatic Fibonacci levels depend on pivot detection, which has an inherent delay. The swing points update only after the pivot is confirmed.
Fibonacci levels are drawn between the two most recent significant swings. In choppy markets with many equal swings, the selected range may not be the most relevant one.
FVG detection uses the standard three-bar pattern, which can produce many gaps on volatile instruments. Use the minimum size filter to manage this.
Confluence detection is proximity-based. A Fibonacci level near an FVG does not guarantee a price reaction — it identifies a zone of potential interest.
Entry signals are mechanical and do not account for broader market context. They should be used as alerts for further analysis, not as standalone trade triggers.
The indicator draws many visual elements. On busy charts, consider using the Max Visual Elements setting and disabling less critical features.
Originality Statement
This indicator is original in its automated confluence detection between Fibonacci analysis and Smart Money Concepts. While Fibonacci tools and FVG indicators exist separately, this indicator is justified because:
It programmatically detects overlap between Fibonacci levels and FVG zones, eliminating subjective visual assessment
The confluence strength scoring system quantifies how many institutional factors align at each zone
Premium/discount FVG classification adds a fair-value context layer to standard FVG detection
Volume-filtered order block detection integrated with Fibonacci levels creates a three-way confluence system
Harmonic ratio support extends beyond standard Fibonacci to cover the full spectrum of institutional trading levels
The entry signal system combines Fibonacci position, FVG presence, and candle confirmation into a structured trigger
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Fibonacci levels and FVG analysis are interpretive tools, not predictive guarantees. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Gösterge

Harmonic Resonance Field [JOAT]Harmonic Resonance Field
Introduction
The Harmonic Resonance Field is an open-source overlay indicator that combines dynamic range detection, Renko-style trend tracking, harmonic frequency analysis, and magnetic field visualization into a unified system for identifying consolidation zones, trend direction, and potential reversal points. It is designed for traders who want to understand where price is within its current range, how strong the prevailing trend is, and when conditions are ripe for a breakout or mean reversion.
Built with Pine Script v6, the indicator uses custom user-defined types for Renko state management, range detection, reversal signals, harmonic bands, magnetic fields, and resonance points.
Why This Indicator Exists
Range-bound markets account for a significant portion of trading time, yet most indicators are optimized for trending conditions. This indicator fills that gap by providing:
ADX-based range detection: Automatically identifies when the market is ranging versus trending using ADX with a configurable threshold, so traders know which strategy framework to apply
Multi-style band calculation: Offers four band calculation methods (ATR, Percentage, Standard Deviation, Harmonic) so traders can choose the volatility measure that best fits their instrument
Renko trend overlay: A smoothed Renko-style trend line that filters noise and shows the dominant direction without requiring a separate Renko chart
Harmonic frequency analysis: Uses sine-wave modulation to create bands that expand and contract with market rhythm, capturing cyclical behavior that static bands miss
Magnetic field visualization: Plots dynamic attraction/repulsion levels around the mean, helping traders visualize where price is likely to gravitate
Core Components Explained
1. Range Detection Engine
The indicator uses ADX to classify market conditions. When ADX falls below the configurable threshold (default 25), the market is classified as ranging, and the indicator highlights the range boundaries. When ADX rises above the threshold, the market is trending, and the indicator shifts focus to the Renko trend line and harmonic bands.
adxSmoothed = ta.rma(dx, adxLength)
isRanging = adxSmoothed < adxThreshold
During ranging conditions, the indicator calculates the highest high and lowest low over the range lookback period and draws a dynamic range box with upper, lower, and midline levels. This gives traders clear boundaries for mean reversion strategies.
2. Harmonic Band System
The band system supports four calculation styles:
ATR: Bands based on Average True Range multiplied by a configurable factor
Percentage: Bands at a fixed percentage distance from the mean
Standard Deviation: Bollinger-style bands using standard deviation
Harmonic: Bands modulated by a sine wave that creates rhythmic expansion and contraction
The harmonic mode is unique to this indicator. It calculates a phase and amplitude based on bar position and ATR, then modulates the band width with a sine function:
harmonicPhase = math.sin(bar_index * 2 * math.pi / bandLength) * 0.5 + 0.5
harmonicAmplitude = atrVal * bandMultiplier
bandWidth = harmonicAmplitude * (0.5 + harmonicPhase * 0.5)
This creates bands that breathe with the market's natural rhythm rather than remaining static or purely reactive.
Chart showing the Harmonic Resonance Field with harmonic bands expanding and contracting around price, Renko trend line, and range detection box during a consolidation period
3. Renko Trend Engine
Rather than requiring traders to switch to a Renko chart, this indicator calculates a Renko-style trend directly on the standard candlestick chart. The brick size can be set using ATR, a fixed percentage, or a static value. The Renko state is managed as a custom type that tracks the current level, direction, and brick boundaries.
When price moves by one brick size in the trend direction, the Renko level advances. When price reverses by the configurable reversal multiplier (default 2 bricks), the trend flips. The result is a stepped trend line overlaid on the chart that filters minor fluctuations and shows only significant directional changes.
4. Magnetic Field Visualization
The magnetic field creates a set of attraction levels around the mean price. These levels represent zones where price tends to gravitate based on the configurable field strength parameter. The field is calculated using the distance from the mean and the current ATR:
Strong attraction zone: Within 0.5x ATR of the mean — price tends to consolidate here
Moderate zone: 0.5x to 1.0x ATR from the mean — normal trading range
Weak zone: Beyond 1.0x ATR — price is extended and may revert
The magnetic field lines are drawn with gradient transparency, becoming more transparent as they move away from the mean, visually communicating the decreasing "pull" of the mean at greater distances.
5. Reversal and Resonance Detection
The indicator generates two types of signals:
Reversal signals: Triggered when price reaches the outer bands with momentum showing signs of exhaustion (RSI-based or rate-of-change based). These are plotted as directional markers on the chart.
Resonance signals: Triggered when multiple conditions align — price at a band extreme, ranging market detected, and volume above average. Resonance points represent higher-conviction mean reversion opportunities.
Visual Elements
Harmonic Bands: Upper and lower bands with gradient fill between them
Renko Trend Line: Stepped line showing the dominant trend direction
Range Box: Dynamic box highlighting the current consolidation range
Magnetic Field Lines: Gradient-colored attraction levels around the mean
Reversal Markers: Directional signals at potential turning points
Resonance Points: High-confluence mean reversion signals
Candle Coloring: Optional trend-based candle coloring
Dashboard: Displays trend direction, range status, band width, Renko state, and resonance count
Input Parameters
Range Detection:
Range Lookback (default 50)
ADX Length (default 14) and ADX Threshold (default 25)
Band Settings:
Band Style: ATR, Percentage, Standard Dev, or Harmonic
Band Length (default 20) and Band Multiplier (default 2.0)
Renko Settings:
Brick Size Style: ATR, Percentage, or Static
Brick Size (default 1.0) and Reversal Multiplier (default 2)
Magnetic Field:
Field Strength (0.1-2.0, default 1.0)
Visual Settings:
Show Candle Coloring, Gradient Fill, Dashboard, Glow Effects, Pulse Effects
How to Use This Indicator
Step 1: Check the dashboard for the current market regime. If the market is ranging, focus on the range box boundaries and magnetic field levels for mean reversion setups.
Step 2: In trending conditions, follow the Renko trend line. Stay with the trend as long as the Renko direction holds. A Renko reversal (direction flip) is a significant event that suggests the trend may be changing.
Step 3: Watch for price reaching the outer harmonic bands. In ranging markets, these represent potential reversal zones. In trending markets, they may indicate overextension.
Step 4: Look for resonance signals. These combine multiple conditions (band extreme + ranging + volume) and represent the highest-conviction mean reversion setups.
Step 5: Use the magnetic field levels as dynamic support and resistance. Price tends to gravitate toward the strong attraction zone near the mean.
Close-up showing reversal markers at band extremes with resonance signals highlighted during a ranging market, with the magnetic field gradient visible around the mean
Indicator Limitations
ADX-based range detection has an inherent lag. The transition from trending to ranging (and vice versa) is identified after it has already begun.
Harmonic bands use a fixed-frequency sine wave. Real market cycles are not perfectly periodic, so the harmonic modulation is an approximation.
Renko trend calculations on a candlestick chart are a simulation. They will not match a true Renko chart exactly due to differences in bar construction.
Reversal signals at band extremes do not guarantee reversals. In strong trends, price can ride the outer band for extended periods.
The magnetic field visualization is a conceptual tool for understanding mean reversion tendency, not a precise prediction of where price will go.
Performance may be affected on very low timeframes with many visual elements enabled. Consider reducing visual effects on sub-minute charts.
Originality Statement
This indicator is original in its synthesis of range detection, harmonic frequency analysis, and magnetic field visualization. While individual components (ADX range detection, Renko trends, Bollinger-style bands) are established concepts, this indicator is justified because:
The harmonic band mode introduces sine-wave modulation to create bands that rhythmically expand and contract, a method not found in standard band indicators
The magnetic field visualization provides a novel way to represent mean reversion tendency using gradient-based attraction zones
Combining Renko trend tracking with ADX range detection on a standard chart gives traders both trend-following and mean-reversion frameworks simultaneously
Resonance detection creates a multi-factor confluence signal by combining band position, range status, and volume conditions
The four-style band system (ATR, Percentage, StdDev, Harmonic) allows traders to adapt the indicator to different instruments and market conditions
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Range detection and band analysis are tools for understanding market structure, not guarantees of future price movement. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Gösterge

VWAP daily, weekly, monthly, yearlyVWAP Multi-Timeframe with Colored Corridors
This indicator provides a comprehensive View Weighted Average Price (VWAP) analysis across multiple timeframes, featuring highly customizable visual zones and individual label controls.
🚀 Key Features
📅 Multi-Timeframe Analysis
Track Daily, Weekly, Monthly, and Yearly VWAP simultaneously on a single chart.
Compare short-term intraday value with long-term structural trends effortlessly.
📊 Dynamic Standard Deviation Bands
Includes 3 levels of Standard Deviation (1σ, 2σ, 3σ) to identify overextended or value areas.
Colored Corridors: Features background fills between bands to visualize "value zones" (Inner, Middle, and Outer).
Default Focus: Optimized by default to highlight the Outer 2-3σ corridor in a sleek blue shade (#6d94fe) at 7% opacity for a premium, non-cluttered look.
🎨 Total Visual Control
Independent Labels: Every VWAP label (Daily, Weekly, etc.) can have its own color, position, and offset.
Visibility Toggles: Easily toggle individual VWAP lines or specific corridor fills on/off to suit your strategy.
Modern UI: Clean, auto-updating price labels prefixed with "VWAP" for instant clarity.
🛠️ How to Use
Identify Value: Use the standard deviation corridors to spot potential reversals or trend continuations.
Contextualize Trend: Observe how the shorter-term VWAP interacts with Monthly or Yearly levels to gauge overall market sentiment.
Customize: Head to the "Settings > Inputs" tab to adjust the transparency of the corridors or change the label colors to match your favorite theme.
Perfect for day traders and swing traders looking for a professional-grade VWAP toolkit. Gösterge

Directional Bias Aggregator [JOAT]Directional Bias Aggregator
Introduction
The Directional Bias Aggregator is a sophisticated multi-timeframe bias scoring system designed to measure and aggregate directional conviction across multiple timeframes. This indicator solves the critical problem of conflicting signals across different timeframes by providing a weighted, systematic approach to bias analysis. Understanding the true directional bias requires looking beyond the current timeframe - professional traders always consider the bigger picture, and this tool brings that institutional approach to your trading.
This indicator is built for traders who understand that trends exist on multiple timeframes simultaneously and that the highest probability trades occur when these timeframes align. Whether you're a day trader needing higher timeframe context, a swing trader confirming trend direction, or a position trader assessing long-term bias, this aggregator provides the comprehensive directional intelligence needed to trade with confidence and clarity.
Why This Indicator Exists
Most traders struggle with timeframe analysis - they might see a bullish signal on the 15-minute chart but bearish conditions on the 4-hour, leading to confusion and poor decisions. This indicator addresses that problem by:
Multi-Timeframe Analysis: Evaluates bias across up to four timeframes simultaneously
Weighted Aggregation: Assigns importance to each timeframe based on trading style
Bias Scoring: Provides numerical bias scores (-100 to +100) for objective analysis
Alignment Detection: Identifies when multiple timeframes agree on direction
Trend Integration: Adds trend filter to prevent trading against major moves
Conviction Measurement: Quantifies the strength of directional bias
The aggregator transforms the complex, often subjective process of multi-timeframe analysis into an objective, systematic framework that can be consistently applied.
Core Components Explained
1. Single Timeframe Bias Calculation
Each timeframe's bias is calculated using multiple indicators:
// Single timeframe bias calculation
f_calc_bias(float src_close, float src_high, float src_low) =>
// MA trend component
float ma_fast = ta.ema(src_close, i_ma_fast)
float ma_slow = ta.ema(src_close, i_ma_slow)
float ma_diff = ma_slow != 0 ? (ma_fast - ma_slow) / ma_slow * 100 : 0
float ma_score = math.max(math.min(ma_diff * 10, 100), -100)
// Price position component
float price_pos = 0.0
if src_close > ma_fast and ma_fast > ma_slow
price_pos := 100
else if src_close < ma_fast and ma_fast < ma_slow
price_pos := -100
// ... additional price position logic
// RSI component
float rsi_val = ta.rsi(src_close, i_rsi_len)
float rsi_score = (rsi_val - 50) * 2
// MACD component
float macd_line = ta.ema(src_close, i_macd_fast) - ta.ema(src_close, i_macd_slow)
float macd_signal = ta.ema(macd_line, i_macd_sig)
float macd_hist = macd_line - macd_signal
float atr_val = ta.atr(14)
float macd_score = atr_val > 0 ? (macd_hist > 0 ?
math.min(macd_hist / atr_val * 50, 100) :
math.max(macd_hist / atr_val * 50, -100)) : 0
// Composite score
float composite = ma_score * 0.35 + price_pos * 0.30 + rsi_score * 0.15 + macd_score * 0.20
composite
Bias components:
MA Trend (35% weight): Fast/slow EMA relationship and slope
Price Position (30% weight): Price relative to moving averages
RSI Momentum (15% weight): RSI centered at 50 for directional bias
MACD Histogram (20% weight): Trend acceleration/deceleration
Score Range: -100 (strong bearish) to +100 (strong bullish)
Neutral Zone: Scores between -30 and +30 considered neutral
Each component contributes unique directional information for comprehensive analysis.
2. Multi-Timeframe Data Requests
The indicator requests bias calculations from multiple timeframes:
// Request bias from each timeframe
f_request_bias(string tf) =>
request.security(syminfo.tickerid, tf, f_calc_bias(close, high, low) ,
lookahead=barmerge.lookahead_on)
float bias_tf1 = f_request_bias(i_tf1) // Fastest timeframe
float bias_tf2 = f_request_bias(i_tf2) // Medium timeframe
float bias_tf3 = f_request_bias(i_tf3) // Slow timeframe
float bias_tf4 = f_request_bias(i_tf4) // Slowest timeframe
MTF features:
Configurable Timeframes: User-defined timeframe selection
Confirmed Bars: Uses previous bar to prevent repainting
Lookahead Management: Proper security request handling
Current TF Bias: Also calculates bias on current timeframe
Data Validation: Handles missing or invalid data gracefully
The MTF system ensures you always have the bigger picture context.
3. Weighted Aggregation System
Timeframes are weighted based on their importance:
// Normalize weights
float total_weight = i_w1 + i_w2 + i_w3 + i_w4
float w1_norm = total_weight > 0 ? i_w1 / total_weight : 0.25
float w2_norm = total_weight > 0 ? i_w2 / total_weight : 0.25
float w3_norm = total_weight > 0 ? i_w3 / total_weight : 0.25
float w4_norm = total_weight > 0 ? i_w4 / total_weight : 0.25
// Aggregate bias score
float aggregate_bias = nz(bias_tf1) * w1_norm + nz(bias_tf2) * w2_norm +
nz(bias_tf3) * w3_norm + nz(bias_tf4) * w4_norm
// Smoothed aggregate
float smooth_bias = ta.ema(aggregate_bias, 3)
Weighting features:
Customizable Weights: Assign importance to each timeframe
Automatic Normalization: Ensures weights sum to 100%
Default Weights: Higher weight to slower timeframes (15%, 25%, 30%, 30%)
Smoothing: EMA smoothing for cleaner signals
Flexibility: Adjust weights based on trading style
The aggregation system creates a single, unified bias score from all timeframes.
4. Bias Alignment Analysis
The indicator measures how many timeframes agree on direction:
// Count aligned timeframes
int bullish_count = 0
int bearish_count = 0
if nz(bias_tf1) > i_weak_thresh
bullish_count += 1
else if nz(bias_tf1) < -i_weak_thresh
bearish_count += 1
// Repeat for TF2, TF3, TF4...
// Alignment score (0-4)
int alignment_score = math.max(bullish_count, bearish_count)
// Alignment direction
int alignment_direction = bullish_count > bearish_count ? 1 :
bearish_count > bullish_count ? -1 : 0
// Perfect alignment check
bool perfect_bullish = bullish_count == 4
bool perfect_bearish = bearish_count == 4
Alignment features:
Alignment Score: Number of timeframes agreeing (0-4)
Alignment Direction: Overall consensus direction
Perfect Alignment: All timeframes agree (strongest signal)
Weak Threshold: Minimum bias for alignment (default 30)
Mixed Signals: When timeframes disagree (lower confidence)
Higher alignment scores indicate higher probability setups.
5. Trend Filter Integration
An optional trend filter prevents trading against major moves:
// Trend filter
float trend_ma = ta.ema(close, i_trend_ma)
bool above_trend = close > trend_ma
bool below_trend = close < trend_ma
float trend_distance = trend_ma != 0 ? (close - trend_ma) / trend_ma * 100 : 0
// Trend-adjusted bias
float trend_adjusted_bias = smooth_bias
if i_use_trend
if above_trend and smooth_bias > 0
trend_adjusted_bias := smooth_bias * (1 + i_trend_weight)
else if below_trend and smooth_bias < 0
trend_adjusted_bias := smooth_bias * (1 + i_trend_weight)
else if above_trend and smooth_bias < 0
trend_adjusted_bias := smooth_bias * (1 - i_trend_weight * 0.5)
else if below_trend and smooth_bias > 0
trend_adjusted_bias := smooth_bias * (1 - i_trend_weight * 0.5)
Trend filter features:
Trend MA: Long-term moving average (default 200)
Trend Weight: Bonus for trading with trend (default 20%)
Penalty System: Reduces bias when trading against trend
Trend Distance: Measures how far price is from trend
Optional: Can be disabled for counter-trend strategies
The trend filter adds an extra layer of confirmation for directional bias.
6. Conviction and Consistency Metrics
The indicator measures the strength and stability of bias:
// Confluence quality
float confluence_quality = (float(alignment_score) / 4.0) *
(math.abs(smooth_bias) / 100.0) * 100
// Bias conviction score
float conviction_score = 0.0
conviction_score += float(alignment_score) * 15 // Max 60
conviction_score += math.abs(smooth_bias) * 0.3 // Max 30
if i_use_trend
if (above_trend and smooth_bias > 0) or (below_trend and smooth_bias < 0)
conviction_score += 10 // Trend alignment bonus
conviction_score := math.min(conviction_score, 100)
// Bias consistency
var int bias_consistency_counter = 0
if smooth_bias > i_weak_thresh and smooth_bias > i_weak_thresh
bias_consistency_counter := math.min(bias_consistency_counter + 1, 20)
else if smooth_bias < -i_weak_thresh and smooth_bias < -i_weak_thresh
bias_consistency_counter := math.min(bias_consistency_counter + 1, 20)
else
bias_consistency_counter := math.max(bias_consistency_counter - 1, 0)
float bias_consistency = float(bias_consistency_counter) / 20.0 * 100
Quality metrics:
Confluence Quality: Combines alignment and strength (0-100%)
Conviction Score: Overall signal strength (0-100)
Bias Consistency: How stable the bias has been (0-100%)
Momentum: Rate of change in bias
Acceleration: Change in bias momentum
These metrics help assess signal reliability and persistence.
Visual Elements
Bias Histogram: Main bias display with gradient coloring
Conviction Ribbon: Visual representation of conviction strength
MTF Breakdown Lines: Individual timeframe bias lines
Alignment Markers: Diamonds for perfect alignment
Momentum Plot: Bias momentum visualization
Background Colors: Regime-based background shading
Dashboard: Comprehensive metrics panel
Glow Effects: Intensity-based visual enhancements
The dashboard displays:
1. Individual timeframe biases and weights
2. Aggregate bias and trend-adjusted bias
3. Alignment score and direction
4. Confluence quality percentage
5. Conviction score and consistency
6. Bias momentum and acceleration
7. Trend filter status and distance
8. Signal strength and recommendations
Input Parameters
Timeframe Settings:
Timeframe 1-4: Individual timeframes for analysis
Default: 15m, 60m, 240m, Daily
Flexible: Can be any valid timeframe combination
Weighting Settings:
TF1-TF4 Weights: Individual importance weights
Default: 15%, 25%, 30%, 30% (favoring slower timeframes)
Total: Automatically normalized to 100%
Calculation Settings:
Fast/Slow MA: Bias calculation periods (default: 8/21)
RSI Period: Momentum oscillator (default: 14)
MACD Settings: Fast/Slow/Signal (default: 12/26/9)
Threshold Settings:
Strong Bias Threshold: Strong signal level (default: 60)
Weak Bias Threshold: Minimum bias for alignment (default: 30)
Trend Weight: Bonus for trend alignment (default: 20%)
How to Use This Indicator
Step 1: Analyze Individual Timeframes
Check the dashboard to see bias on each timeframe. Look for consistency - if most timeframes show the same direction, confidence is higher.
Step 2: Check Aggregate Bias
The aggregate bias provides a unified directional score. Values above 60 indicate strong bullish bias, below -60 indicate strong bearish bias.
Step 3: Verify Alignment
Higher alignment scores (3-4 timeframes) offer the highest probability setups. Perfect alignment (4/4) often precedes strong moves.
Step 4: Assess Conviction
High conviction scores (>75%) indicate strong, consistent bias. Low conviction (<50%) suggests uncertainty - wait for clarity.
Step 5: Consider Trend Filter
If enabled, ensure bias aligns with the major trend. Trading against the trend reduces conviction and increases risk.
Step 6: Monitor Momentum
Accelerating bias in the direction of alignment suggests the move is gaining strength. Decelerating bias warns of potential reversals.
Best Practices
Perfect alignment (4/4) provides the highest probability setups
Higher timeframe bias should generally override lower timeframe signals
Increasing conviction scores suggest strengthening trends
Divergence between timeframes often precedes reversals
Use the trend filter unless you're specifically trading counter-trend setups
Bias consistency is key - look for stable, persistent bias
Sudden changes in aggregate bias often signal regime shifts
Combine with price action for optimal entry timing
Adjust timeframe weights based on your trading style
Keep a bias journal to track how different instruments behave
Trading Applications
Trend Following:
Enter when bias > 60 on at least 3 timeframes
Add to positions as conviction increases
Stay in trades as long as bias remains aligned
Exit when bias weakens or reverses on slower timeframes
Mean Reversion:
Look for extreme bias (>80 or <-80) on faster timeframes
Enter when faster timeframe bias opposes slower timeframe
Target mean reversion to neutral bias levels
Quick exits - don't fight the longer-term bias
Breakout Trading:
Wait for bias alignment across all timeframes
Enter on breakouts with supporting bias momentum
Use wider stops due to potential volatility
Scale out as bias reaches extreme levels
Strategy Integration
This indicator enhances any trading system:
Use as a directional filter for existing strategies
Import aggregate bias for trend confirmation
Use alignment score as signal strength filter
Apply conviction scoring for position sizing
Integrate trend filter for additional safety
Export individual timeframe biases for custom logic
Technical Implementation
Built with Pine Script v6 featuring:
Multi-timeframe bias calculation with proper security requests
Weighted aggregation system with automatic normalization
Advanced alignment detection with perfect alignment alerts
Trend filter integration with adjustable weighting
Conviction and consistency scoring systems
Momentum and acceleration analysis
Comprehensive visualization with multi-layer effects
Real-time dashboard with 12 key metrics
Alert conditions for all major bias events
Export functions for strategy integration
The code uses confirmed bars and proper lookahead management to prevent repainting.
Originality Statement
This indicator is original in its comprehensive approach to multi-timeframe bias aggregation and scoring. While individual components (moving averages, RSI, MACD) are established tools, this indicator is justified because:
It synthesizes bias analysis across multiple timeframes into a unified scoring system
The weighted aggregation allows customization based on trading style and preferences
Alignment detection provides objective measures of timeframe consensus
The conviction scoring system quantifies signal strength and reliability
Trend filter integration adds an extra layer of confirmation
Consistency analysis identifies stable, persistent bias versus noisy fluctuations
The dashboard presents complex multi-timeframe analysis in an accessible format
Export functions enable integration with any trading system
Each timeframe contributes unique context: faster timeframes show immediate bias, slower timeframes show established trends
The indicator solves the real problem of conflicting signals across timeframes through systematic aggregation
The indicator's value lies in transforming the complex, often confusing world of multi-timeframe analysis into a clear, objective system that traders can use to make informed decisions with confidence.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Multi-timeframe analysis is a tool for understanding market context, not a prediction system.
Bias can change suddenly due to news events, economic data, or changes in market structure. Past bias patterns do not guarantee future behavior. The indicator's signals are mathematical calculations based on historical patterns and should be used in conjunction with other forms of analysis.
Always use proper risk management, including stop losses and position sizing appropriate for your account and risk tolerance. Strong bias alignment does not guarantee success - markets can remain irrational longer than you can remain solvent.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this system.
-Made with passion by officialjackofalltrades
Gösterge

Gösterge

Gösterge

Planetary Aspect Lines [PyraTime]The Problem This Solves
Traders utilizing W.D. Gann methodologies and financial astrology often face three major hurdles: manually calculating geocentric planetary aspects across varying timezones, dealing with cluttered charts that obscure price action, and the persistent "Floating Indicator Issue" where graphical lines and labels detach from historical price bars or freeze in mid-air when panning and zooming.
The Solution
PyraTime is a self-contained visual ephemeris built specifically to automate planetary aspect tracking while maintaining strict chart stability. It calculates geocentric mean longitudes for up to three customizable planet pairs, alerts you to exact angular aspects, and anchors all visual data directly to absolute UNIX timestamps. This ensures your astrological analysis remains perfectly aligned with the historical price action, regardless of chart scale.
Key Features:
Predictive HUD Dashboard: A clean, minimal chart overlay that scans forward to project the next upcoming aspect. It provides a live countdown (in days) alongside the calculated directional bias.
Directional Bias System: Instantly gauge the astrological weight of an aspect directly on the chart labels and HUD. The script categorizes Trines and Sextiles as Bullish; Squares, Oppositions, Semi-Squares, and Sesquiquadrates as Bearish; and Conjunctions and Quincunxes as Neutral.
Floating Indicator Protection: We explicitly solved the native TradingView floating object bug. By anchoring all line objects to absolute UNIX timestamps (xloc.bar_time) rather than relative bar indices, and using dynamic vertical positioning for labels, your aspect lines will never detach or float away when scrolling through data.
Layered Aesthetics: Aspects are plotted using a 3-layer overlapping line technique for a clean neon aesthetic without muddying the candles. When an aspect reaches exact status (within 0.1 degrees of the target orb), the visual labels dynamically scale to full opacity to highlight the exact pivot point.
Retrograde Filtering: An optional toggle allows users to automatically suppress aspect alerts and visuals if either planet in a monitored pair is currently moving in retrograde.
Timezone Agnostic: The internal ephemeris engine relies on absolute time data, meaning it synchronizes automatically with your local TradingView clock. No manual UTC offset configurations are required.
How to Use:
Apply the indicator to your chart and open the settings menu.
Select your target planet pairs (e.g., Sun and Mars) and enable any additional pairs you wish to track.
Toggle the specific aspects you want to monitor and adjust your target orbs (degrees of tolerance) based on your trading strategy.
Set standard TradingView alerts to trigger when a confirmed aspect prints on the chart.
Technical Note: This script uses an internal Mean Longitude mathematical engine to calculate planetary positions. This provides fast, self-contained visual performance without relying on external libraries. Traders looking for extreme precision on highly elliptical planets or specific retrograde stations should note there may be slight orb drift compared to a full Swiss Ephemeris array. Gösterge

Strateji

Harmonic Pulse Tracker [JOAT]Harmonic Pulse Tracker
Introduction
The Harmonic Pulse Tracker is an open-source institutional-grade wave and rhythm analysis system that combines Elliott Wave principles, Fibonacci harmonic analysis, WaveTrend oscillator mechanics, and cycle detection into a unified oscillator. This sophisticated system integrates multiple proven methodologies to identify high-probability reversal zones where harmonic patterns, wave cycles, and momentum indicators converge.
The indicator is designed for traders who understand that market movements follow natural harmonic patterns and cyclical rhythms. By synthesizing detrended price oscillation, Fibonacci retracement levels, WaveTrend momentum analysis, money flow dynamics, and volume confirmation, this tool helps identify structural market turning points with mathematical precision.
Why This Integration Exists
This indicator combines six distinct analytical frameworks that complement each other:
Harmonic Wave Analysis: Uses detrended price oscillation combined with Ehlers cycle detection to identify natural market rhythms
Fibonacci Harmonic Levels: Calculates dynamic Fibonacci retracements and extensions based on wave swing points
WaveTrend Oscillator: Implements LazyBear's WaveTrend algorithm for momentum and overbought/oversold detection
Money Flow Integration: Tracks institutional buying and selling pressure through Money Flow Index analysis
Volume Analysis: Confirms wave movements with volume spikes and directional volume pressure
Elliott Wave Counting: Simplified wave counting system to identify impulse and corrective wave phases
Each component addresses different aspects of market rhythm and harmony. The harmonic wave engine identifies natural price cycles, Fibonacci levels provide mathematical support/resistance, WaveTrend shows momentum extremes, money flow reveals institutional activity, volume confirms genuine moves, and Elliott Wave counting provides structural context. Together, they create a multi-dimensional view of market harmony and discord.
Core Components Explained
1. Harmonic Wave Engine
The core wave calculation combines two advanced techniques:
DPO (Detrended Price Oscillator) = close - sma(close, length/2 + 1)
Ehlers Cycle Component = High-pass filtered price with cycle smoothing
Harmonic Wave = Smoothed DPO + (Cycle Component * 0.5)
This creates a wave that removes trend bias while preserving cyclical components, revealing the natural harmonic rhythm of price movement.
Wave Derivatives:
- Wave Momentum: Rate of change in harmonic wave
- Wave Acceleration: Rate of change in momentum
- Wave Velocity: Percentage rate of change over 5 periods
These derivatives help identify wave phase transitions and momentum shifts before they become obvious in price.
2. Fibonacci Harmonic Level System
The indicator calculates dynamic Fibonacci levels based on harmonic wave swing points:
Standard Retracements:
- 23.6%, 38.2%, 50.0%, 61.8%, 78.6% of wave range
Extensions:
- 127.2%, 161.8%, 261.8% beyond wave high
Golden Pocket Zone:
The critical 61.8% to 78.6% retracement zone where most harmonic reversals occur. This zone represents the mathematical sweet spot where Fibonacci ratios converge with natural market rhythm.
Harmonic Resonance Detection:
The system identifies when price is within 5% of key Fibonacci levels and calculates confluence scores when multiple levels align.
3. WaveTrend Oscillator Integration
Implements the proven WaveTrend algorithm:
ESA = ema(hlc3, channel_length)
D = ema(abs(hlc3 - ESA), channel_length)
CI = (hlc3 - ESA) / (0.015 * D)
WT1 = ema(CI, average_length)
WT2 = sma(WT1, 4)
WaveTrend Signals:
- Crossovers in oversold zone (< -50): Bullish reversal signals
- Crossunders in overbought zone (> 50): Bearish reversal signals
- Regular crossovers: Momentum shift confirmation
4. Money Flow Analysis
Tracks institutional buying and selling pressure:
MFI = Money Flow Index over specified period
MFI Centered = (MFI - 50) * multiplier
- Positive MFI: Institutional buying pressure
- Negative MFI: Institutional selling pressure
- Strong MFI: Absolute value > 25 indicates significant institutional activity
5. Volume Analysis Engine
Comprehensive volume analysis including:
Volume Spikes: Volume > Average Volume * Threshold
Volume Ratio: Current volume / Average volume
Volume Strength: Normalized volume intensity (0-100)
Directional Volume:
- Bullish Volume Spike: High volume + green candle
- Bearish Volume Spike: High volume + red candle
6. Elliott Wave Phase Detection
Simplified wave analysis to identify market structure:
Impulse Waves:
- Impulse Up: Positive momentum + acceleration + velocity
- Impulse Down: Negative momentum + acceleration + velocity
Corrective Waves:
- Mixed momentum and acceleration signals indicating consolidation
Wave Counting:
Basic 5-wave count system that resets after wave 5 completion, helping identify potential reversal zones.
Multi-Factor Confluence Scoring System
The indicator calculates a real-time confluence score (0-100) by weighting each component:
Confluence Score Components:
- Fibonacci Zone: Up to 20 points (Golden Pocket = 20, other Fib levels = 4 each)
- Wave Strength: Up to 20 points (based on wave momentum intensity)
- WaveTrend: Up to 20 points (extreme zone crossovers = 20, regular = 15)
- Money Flow: Up to 20 points (strong institutional activity = 20)
- Volume: Up to 20 points (volume spikes = 20, elevated = 15)
Scores above 80 indicate exceptional confluence for potential trades. The dashboard displays individual component scores for transparency.
Perfect Harmonic Alignment Detection
The system identifies rare "Perfect Harmonic" setups when:
- Price is in Golden Pocket zone
- Impulse wave phase is active
- Wave strength > 70
- WaveTrend crossover in extreme zone
- Positive money flow (for bullish) or negative (for bearish)
- Volume spike confirmation
These setups represent the highest probability reversal opportunities.
Visual Elements
Harmonic Wave: Main oscillator with gradient coloring based on wave position
Wave Momentum: Histogram showing rate of change in wave movement
Fibonacci Levels: Key retracement and extension levels (38.2%, 50%, 61.8%, 78.6%, 161.8%)
Golden Pocket Zone: Highlighted area between 61.8% and 78.6% levels
WaveTrend Lines: WT1 and WT2 with overbought/oversold zones
Money Flow Columns: Institutional buying/selling pressure visualization
Volume Strength: Volume intensity histogram
Signal Markers: Perfect Harmonic signals and strong confluence alerts
Background Zones: Golden Pocket and Perfect Signal highlighting
Dashboard: Real-time display of all component values and confluence score
How Components Work Together
The integration creates a harmonic analysis approach:
Layer 1 - Wave Rhythm: Harmonic wave identifies natural market cycles and turning points
Layer 2 - Mathematical Levels: Fibonacci ratios provide precise support/resistance zones
Layer 3 - Momentum Context: WaveTrend shows overbought/oversold extremes
Layer 4 - Institutional Flow: Money flow reveals smart money positioning
Layer 5 - Volume Confirmation: Volume analysis validates genuine moves vs noise
Layer 6 - Wave Structure: Elliott Wave context provides structural framework
Example scenario: Harmonic wave reaches Golden Pocket zone (Layer 1 + 2) during WaveTrend oversold crossover (Layer 3) with positive money flow (Layer 4) and volume spike (Layer 5) in corrective wave phase (Layer 6). This confluence suggests exceptional reversal probability.
Input Parameters
Wave Settings:
Wave Length: Period for harmonic wave calculation (default: 34)
Smoothing Period: Wave smoothing factor (default: 5)
WaveTrend Settings:
Show WaveTrend: Toggle WaveTrend display
WT Channel Length: Channel calculation period (default: 9)
WT Average Length: Smoothing period (default: 12)
WT Overbought: Overbought threshold (default: 50)
WT Oversold: Oversold threshold (default: -50)
Money Flow Settings:
Show Money Flow: Toggle money flow display
MFI Length: Money Flow Index period (default: 14)
MFI Multiplier: Sensitivity adjustment (default: 1.5)
Volume Settings:
Show Volume Analysis: Toggle volume indicators
Volume Spike Threshold: Multiplier for spike detection (default: 1.5)
Fibonacci Settings:
Show Fibonacci Levels: Toggle Fibonacci level display
Fibonacci Lookback: Period for swing point calculation (default: 100)
Cycle Settings:
Cycle Period: Ehlers cycle detection period (default: 20)
Cycle Smoothing: Cycle component smoothing (default: 3)
How to Use This Indicator
Step 1: Identify Wave Phase
Check the dashboard for current wave phase (Impulse Up/Down, Corrective, Neutral) and Elliott Wave count.
Step 2: Locate Fibonacci Zones
Look for price approaching key Fibonacci levels, especially the Golden Pocket zone (61.8%-78.6%).
Step 3: Check WaveTrend Position
Identify if WaveTrend is in extreme zones and watch for crossovers in oversold/overbought areas.
Step 4: Analyze Money Flow
Confirm institutional positioning through Money Flow Index - positive for bullish setups, negative for bearish.
Step 5: Verify Volume Confirmation
Ensure volume supports the move - look for volume spikes in the direction of the expected reversal.
Step 6: Review Confluence Score
Check the dashboard confluence score. Scores above 80 indicate high-probability setups.
Step 7: Wait for Perfect Harmonic Signals
The highest probability trades occur when "PERFECT" signals appear, indicating all factors are aligned.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal harmonic detection
Focus on Golden Pocket zone entries - this is where most harmonic reversals occur
Wait for WaveTrend crossovers in extreme zones for best risk:reward
Confirm with money flow direction - institutional flow should support the trade direction
Volume spikes add significant confirmation to harmonic setups
Perfect Harmonic signals are rare but offer exceptional probability
Wave 5 completions often coincide with major reversal opportunities
Use confluence scores above 80 as primary filter for trade selection
Indicator Limitations
Harmonic patterns can extend beyond expected Fibonacci levels
Perfect Harmonic signals are rare - patience is required for best setups
Wave counting is simplified and may not match complex Elliott Wave analysis
Fibonacci levels are dynamic and may adjust as new swing points form
Money flow can remain extreme longer than expected during strong trends
Volume confirmation may be less reliable in low-liquidity markets
Confluence scoring is mathematical, not predictive of future performance
Requires understanding of harmonic analysis principles for effective use
Technical Implementation
Built with Pine Script v6 using:
Advanced detrended price oscillation with Ehlers cycle detection
Dynamic Fibonacci calculation based on swing point analysis
LazyBear WaveTrend algorithm implementation
Real-time Money Flow Index with institutional bias detection
Volume analysis with spike detection and directional confirmation
Simplified Elliott Wave counting with phase detection
Multi-factor confluence scoring system with component weighting
Anti-overlap signal filtering to prevent signal clustering
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This indicator is original in its harmonic integration approach. While individual components (DPO, Fibonacci, WaveTrend, MFI, volume analysis, Elliott Wave) are established concepts, this integration is justified because:
It synthesizes six distinct methodologies that address different aspects of market harmony
The harmonic wave engine combines detrended oscillation with cycle detection for superior rhythm analysis
Dynamic Fibonacci levels adjust to current wave structure rather than using static retracements
Golden Pocket zone identification provides mathematical precision for reversal timing
Multi-factor confluence scoring quantifies setup quality across all components
Perfect Harmonic detection identifies rare, high-probability reversal opportunities
Each component contributes unique harmonic information: wave analysis reveals natural cycles, Fibonacci provides mathematical levels, WaveTrend shows momentum extremes, money flow indicates institutional positioning, volume confirms genuine moves, and Elliott Wave provides structural context. The integration's value lies in identifying moments when all these harmonic factors align simultaneously.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Harmonic analysis and Fibonacci levels are mathematical concepts that do not guarantee future price movement. Past performance and backtested results do not guarantee future results. Market conditions change, and harmonic patterns that worked historically may not work in the future.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Gösterge

Wolfe Wave Pattern [UAlgo]Wolfe Wave Pattern is a pivot based pattern recognition indicator that scans price structure for a five point Wolfe Wave sequence and automatically draws the pattern on the chart once a valid setup is confirmed. The script works directly on price ( overlay=true ) and is built for visual analysis, giving traders a clear geometric representation of bullish and bearish Wolfe Wave formations with point labels, channel references, and a projected EPA target line.
This implementation uses confirmed swing pivots from TradingView pivot functions as its structural foundation. Every new confirmed pivot is stored, and the script evaluates the most recent five alternating pivots for Wolfe Wave conditions. Instead of trying to detect every possible variation, it applies a practical and consistent ruleset based on swing sequencing, relative highs and lows, convergence of channel lines, and point 5 overshoot behavior beyond the 1 to 3 guide line.
When a valid pattern is found, the script draws the core wave legs (1 to 2, 2 to 3, 3 to 4, 4 to 5), a 2 to 4 channel reference, a 1 to 3 sweet zone guide, and an extended EPA line from 1 to 4 into the future. It also marks the pivot points with labels and triggers an alert message at detection time.
This makes the tool useful for discretionary traders who want a structured way to monitor Wolfe Wave geometry without manually drawing every candidate pattern.
🔹 Features
🔸 1) Pivot Based Wolfe Wave Detection
The script uses ta.pivothigh() and ta.pivotlow() with user configurable left and right bars to build a swing structure map. Each pivot is stored as a custom PivotPoint object containing:
Index of the pivot bar
Pivot price
Pivot type (high or low)
This gives the pattern engine a clean sequence of confirmed turning points rather than raw candle noise.
🔸 2) Automatic Five Point Pattern Recognition
On each newly confirmed pivot, the script checks the most recent five pivots and validates whether they form an alternating sequence suitable for a Wolfe Wave candidate. Only alternating high low high low high or low high low high low structures are considered.
This is an important filter because Wolfe Waves are geometric swing patterns and require clear alternation in pivot direction.
🔸 3) Bullish Wolfe Wave Detection Logic
The bullish model looks for a low high low high low sequence and applies structural and geometric checks, including:
Point 3 below Point 1
Point 4 below Point 2
Point 5 overshooting below the projected 1 to 3 line
Converging channel behavior through slope comparison of 1 to 3 and 2 to 4
This produces a clean descending wedge style candidate that matches the intended bullish Wolfe Wave concept in this implementation.
🔸 4) Bearish Wolfe Wave Detection Logic
The bearish model looks for a high low high low high sequence and applies the inverse logic:
Point 3 above Point 1
Point 4 above Point 2
Point 5 overshooting above the projected 1 to 3 line
Converging channel behavior through slope comparison of 1 to 3 and 2 to 4
This creates a rising wedge style candidate for bearish Wolfe Wave detection.
🔸 5) Full Pattern Drawing on Chart
Once detected, the script draws the pattern directly on price using line objects:
Wave legs 1 to 2, 2 to 3, 3 to 4, and 4 to 5
A 2 to 4 channel reference line
A 1 to 3 sweet zone guide line
An EPA projection line extended from 1 to 4 into future bars
This helps traders quickly inspect geometry and projected target direction without manual plotting.
🔸 6) Point Labels and Pattern Name Display
The indicator labels all five pivot points and positions the labels above or below price depending on pattern direction. This improves readability and makes it easy to verify the sequence visually.
For bullish patterns, low points are labeled below bars and high points above bars. For bearish patterns, the logic is inverted.
🔸 7) EPA Target Projection
The script draws an extended EPA line based on Point 1 and Point 4, projecting it beyond Point 5 to create a visual target path. This offers a practical reference for post detection expectation analysis.
The projection length is proportional to the 1 to 4 horizontal distance, which keeps the target line visually consistent with the pattern scale.
🔸 8) Visual Customization Inputs
Users can customize:
Bullish pattern color
Bearish pattern color
Line width
The script also includes a line style input and line style helper mapping. In the current implementation, core pattern segments are drawn with fixed style choices for visual consistency, while supporting lines use dedicated dashed and arrow styles.
🔸 9) Alert on Detection
When a new bullish or bearish Wolfe Wave is confirmed, the script triggers an alert message at bar close frequency. This allows traders to monitor multiple symbols or timeframes without constantly watching the chart.
🔸 10) Structured Object Design for Maintainability
The script uses custom types for both pivots and patterns:
PivotPoint for swing points
WolfeWave for the full detected pattern including lines, labels, EPA line, and sweet zone line
This object based design keeps the code organized and easier to extend in future versions.
🔹 Calculations
1) Pivot Detection and Storage
The script identifies confirmed swing highs and lows using user defined left and right pivot lengths:
float ph = ta.pivothigh(high, lenLeft, lenRight)
float pl = ta.pivotlow(low, lenLeft, lenRight)
When a pivot is confirmed, it is stored at the actual pivot bar index ( bar_index - lenRight ) because pivot confirmation happens after the right side bars are complete:
if not na(ph)
pivotArray.addPivot(bar_index - lenRight, ph, true)
if not na(pl)
pivotArray.addPivot(bar_index - lenRight, pl, false)
The pivot array is capped to a manageable size:
if pivots.size() > 100
pivots.shift()
2) Pattern Scan Trigger and Five Pivot Window
The pattern engine only runs when at least five pivots exist. It then reads the latest five pivots in order:
PivotPoint p5 = pivotArray.get(pivotArray.size() - 1)
PivotPoint p4 = pivotArray.get(pivotArray.size() - 2)
PivotPoint p3 = pivotArray.get(pivotArray.size() - 3)
PivotPoint p2 = pivotArray.get(pivotArray.size() - 4)
PivotPoint p1 = pivotArray.get(pivotArray.size() - 5)
The check is gated so the recognition logic processes only when a new pivot has just been confirmed:
bool newPivotConfirmed = not na(ph) or not na(pl)
3) Alternation Check
Before applying Wolfe rules, the script requires the five pivots to alternate between highs and lows:
bool alternating = (p1.isHigh != p2.isHigh) and (p2.isHigh != p3.isHigh) and (p3.isHigh != p4.isHigh) and (p4.isHigh != p5.isHigh)
This prevents invalid sequences such as repeated highs or repeated lows from being treated as pattern candidates.
4) Slope and Projection Utilities
Two helper methods provide the geometric basis of the pattern logic:
Slope between two pivots:
method getSlope(PivotPoint pA, PivotPoint pB) =>
(pB.price - pA.price) / (pB.index - pA.index)
Projected price of a line at a target bar index:
method getProjectedPrice(PivotPoint pA, PivotPoint pB, int targetIndex) =>
float slope = (pB.price - pA.price) / (pB.index - pA.index)
pA.price + slope * (targetIndex - pA.index)
These methods are used for overshoot validation, convergence checks, and EPA target projection.
5) Bullish Wolfe Wave Detection Rules
The bullish pattern requires a pivot sequence of:
Point 1 low
Point 2 high
Point 3 low
Point 4 high
Point 5 low
In code, this is checked as:
if not p1.isHigh and p2.isHigh and not p3.isHigh and p4.isHigh and not p5.isHigh
Then the script applies structural conditions:
if p3.price < p1.price and p4.price < p2.price
This enforces a downward contracting structure.
Next, it checks Point 5 overshoot relative to the projected 1 to 3 line at the Point 5 index:
float proj13_at_5 = p1.getProjectedPrice(p3, p5.index)
if p5.price < proj13_at_5
Finally, it checks convergence using slope comparison:
float m13 = p1.getSlope(p3)
float m24 = p2.getSlope(p4)
if m24 < m13
detected := true
Interpretation:
For a bullish setup in this script, both 1 to 3 and 2 to 4 slopes are typically negative, and the 2 to 4 line must descend faster than the 1 to 3 line so the structure converges to the right.
6) Bearish Wolfe Wave Detection Rules
The bearish pattern requires a pivot sequence of:
Point 1 high
Point 2 low
Point 3 high
Point 4 low
Point 5 high
In code:
else if p1.isHigh and not p2.isHigh and p3.isHigh and not p4.isHigh and p5.isHigh
Structural conditions:
if p3.price > p1.price and p4.price > p2.price
This enforces an upward contracting structure.
Point 5 overshoot must be above the projected 1 to 3 line:
float proj13_at_5 = p1.getProjectedPrice(p3, p5.index)
if p5.price > proj13_at_5
Convergence is then checked using slope comparison:
float m13 = p1.getSlope(p3)
float m24 = p2.getSlope(p4)
if m24 > m13
detected := true
Interpretation:
For a bearish setup, both lines are typically rising, and the 2 to 4 line must rise faster than the 1 to 3 line so the wedge contracts to the right.
7) Sweet Zone Guide and Channel Reference
After detection, the script draws a sweet zone guide using the 1 to 3 geometry projected to the Point 5 index:
this.sweetZoneLine := line.new(
this.p1.index, this.p1.price,
this.p5.index, this.p1.getProjectedPrice(this.p3, this.p5.index),
color=color.new(c, 50), width=1, style=line.style_dashed)
It also draws a 2 to 4 reference line as a dashed channel boundary:
this.patternLines.push(line.new(this.p2.index, this.p2.price, this.p4.index, this.p4.price, color=color.new(c, 50), width=1, style=line.style_dashed))
Together, these lines visually frame the Wolfe Wave channel and the Point 5 overshoot area.
8) EPA Line Projection
The EPA line is projected from Point 1 to Point 4 and extended into the future. The horizontal projection length is based on the bar distance from Point 1 to Point 4:
int dist14 = this.p4.index - this.p1.index
int targetIdx = this.p5.index + dist14
float targetPrice = this.p1.getProjectedPrice(this.p4, targetIdx)
The EPA line is then drawn with an arrow style:
this.epaLine := line.new(this.p1.index, this.p1.price, targetIdx, targetPrice, color=color.yellow, width=2, style=line.style_arrow_right)
This provides a projected target path for the expected move after Point 5.
9) Label Placement Logic
The script places point labels above or below bars based on pattern direction so the labels remain readable and consistent with swing polarity.
For bullish patterns:
Points 1, 3, and 5 are placed below bars
Points 2 and 4 are placed above bars
For bearish patterns:
Points 1, 3, and 5 are placed above bars
Points 2 and 4 are placed below bars
This logic is encoded through direction dependent yloc assignment before creating labels.
10) Detection Object Construction and Drawing
Once a pattern is validated, the script creates a WolfeWave object and calls its draw method:
WolfeWave ww = WolfeWave.new(p1, p2, p3, p4, p5, isBull)
ww.draw()
The object stores the five pivots, direction, line arrays, label arrays, and special lines (EPA and sweet zone), which makes the implementation modular and easier to manage.
11) Alert Logic
After a bullish or bearish pattern is drawn, the script sends an alert message:
alert("Wolfe Wave " + (isBull ? "Bullish" : "Bearish") + " Detected", alert.freq_once_per_bar_close)
This allows users to automate notification workflows and review setups only when a complete pattern has been confirmed. Gösterge
