Skip to content

Repository files navigation

Pine Scripts by WavesUnchained

Pine Version: v6 · License:MIT · Author:WavesUnchained

A collection of custom TradingView indicators built around composable analysis — market structure, trend, momentum, and confluence scoring.


Getting Started

  1. Open any .pine file and copy its contents
  2. In TradingView: Pine Script Editor → Paste → Add to Chart

Scripts marked [RTA] require the RTA libraries to be published to your TradingView account first — see Libraries.


Indicators

Vein Adaptive Suite

A set of composable indicators — the core three cover trend, pullback, and exhaustion and are designed to be read together. The remaining scripts are more specialized: focused on commodity futures (primarily NatGas 4H), execution timing, and research tooling.

Core

ScriptFocus
vein_trend.pineTrend phase scoring — EMA structure, ADX, regime, composite score
vein_pullback.pinePullback quality — Fibonacci depth, volume, EMA proximity, micro BOS
vein_exhaustion.pineExhaustion detection — candle pressure, volume absorption, momentum streaks

Commodity / NatGas focused

ScriptFocus
vein_accumulation_phase.pine4H bottom formation and accumulation phase detection — 5-component process state
vein_reversal_score.pineTwo-layer reversal scoring (setup conditions + structural confirmation)
vein_structure_zones.pineSwing detection, BOS, spring/upthrust, auto S/R zones with lifecycle tracking
vein_execution.pine15m entry timing overlay — micro BOS, sweeps, rejection candles, follow-through
vein_spread_context.pineCommodity futures calendar spread context — bias and momentum modifier, not a signal

Research / utility

ScriptFocus
vein_feature_exporter.pineBar-level feature calculation for reversal research — trend, momentum, volume, candle structure
vein_reversal_labeler.pineHistorical reversal labeling with forward-looking ATR rules — research and ML labeling only

indicators/trend_direction/vein/README.md — full documentation and layered reading guide


Market Structure

ScriptWhat it does
market_structure_advanced.pineSwing pivot classification (HH/HL/LH/LL) mapped to a bounded score oscillator — continuous structural bias reading without chart labels
smc_structure_expectation.pineBOS, CHoCH, order blocks, fair value gaps
wyckoff_schematics.pineWyckoff phases and events — accumulation, distribution, spring, UTAD
modern_wyckoff_state_machine_visual.pineModern Wyckoff State Machine Lite — locked range, range-bounded A-E phase zones, cause score, quality-graded events and dashboard
sr_zones_mtf_v2.pineMulti-timeframe support and resistance zones
market_structure_pivot_map.pineHTF pivot/CPR/projection map with cross-timeframe confluence zones and nearest-S/R readout — a location tool, not a signal generator
tweezer_kangaroo_zones.pineTweezer tops/bottoms and kangaroo tails mapped to supply/demand zones
jma_struct.pineJMA entry clusters with Wyckoff and SMC structure context
time_to_react_volatility_time.pineBOS and sweep timing with volatility-adjusted candle coloring
coilforge_zones_v1.pineCompression zone detection with multi-module scoring and post-zone breakout watch
edge_atlas.pineRight-edge price-level atlas — period/session/pivot/swing-Fib/S/R/round-number levels, filtered and ranked into a shared registry, docked to the visible right edge of the chart
market_motion_dna_v1.pineObjective movement-character engine — classifies each confirmed and live pivot-to-pivot leg as impulsive/corrective/neutral from a 10-feature Leg DNA score, not a directional (bullish/bearish) read
fib_reaction_memory.pineFibonacci retracement levels scored by confirmed local price reactions that occurred inside the frozen A→B reference leg (reaction-first, not geometric-proximity-first) — 0–100 Memory Score per level, APPROACHING/TESTING/REJECTED/ACCEPTED/RECLAIMED state machine, score-based NEXT level highlight, no table
market_scenario_projector.pineThree weighted forward scenarios (Direct Continuation / Pullback Continuation / Failure) drawn as a dominance-ranked scenario tree from current impulse strength, efficiency, acceleration, swing structure bias, clustered support/resistance zones, candle-based rejection/exhaustion evidence and a converging pullback zone; optional outcome recorder tracks each setup to resolution for offline calibration — percentages are heuristic evidence weights, not calibrated probabilities (see indicator's todo.md)
support_resistance_zones.pineDetector-driven support/resistance zone engine — pivot cluster, multiple-test, base/supply-demand, order block, fair value gap, price gap and equal-high/low liquidity detectors feed candidates into a central registry that merges, scores (confluence: EMA/VWAP/Fib/psychological/volume), lifecycle-tracks (touch/reaction/break/flip) and renders only the nearest score-filtered zones per side; 0.1.0 engine-foundation build, not yet compiler-tested (see indicator's todo.md)
reversal_engine_score_v1.pineScore-based liquidity sweep reversal signals with HTF trend filter and configurable evidence threshold
reversal_type_classifier_v1.pineEx-post diagnostic: classifies confirmed pivot reversals as Snapback / Grind / Fake / Chop with WT context and R-outcome scoring
structure_break_risk.pineHow close the prevailing trend's structure is to breaking, and against which level — an RSI pane with momentum-divergence lines drawn on the RSI (the earliest crack, shown where it is readable), plus a break-level line, a shaded risk zone, a trend-context EMA and word event labels on the price chart, with the 0–100 risk magnitude in a compact, mobile-friendly info label; symmetric top-/bottom-break scoring from five weighted sensors (near level, confirmed BOS, failed breakout, structure erosion, pivot divergence); companion to Trend Persistence Score
trading_range_state_machine.pinePivot-cluster range detection with an 8-factor weighted range score, driving an Inactive/Building/Confirmed/Mature/Breaking state machine — range lines, midline, touch markers, background heat, ribbon and dashboard
market_tradability_engine.pineMarket-quality/no-trade filter — Tradability/Balance/Compression/Direction scores driving a No Trade/Balance/Compression/Ready/Breakout/Trend/Aftermath/Exhaustion state machine; dual-window efficiency, balance boundaries, transition markers, dashboard, and Pine-Log calibration logging for offline threshold tuning
commodity_heat_reversal.pineScore-based mean-reversion reversal signals for commodity futures — ATR distance, expansion, RSI extreme, wick pressure, BB breach
exhaustion_scanner.pineRole-separated overextension context (0–100): Stretch + Exhaustion + Reaction scores, volatility as multiplier, regime classifier framing each signal as Continuation Risk / Trend Exhaustion / Range Fade; per-market presets

Trend & Regime

ScriptWhat it does
adx_advanced.pineADX with DI± display, pluggable signal smoothing, 4-state histogram, gradient line, and DI crossover / threshold alerts
regime_classifier.pineStage-1 reversal-pipeline filter — fuses Fractal Dimension, Kaufman Efficiency Ratio and Choppiness into a Trend / Range / Chaos classification with hysteresis, symmetric reversal/trend permission outputs (no triggers) and an optional HTF regime line
trend_persistence_score.pineGraded 0–100 trend-strength oscillator — fuses Regression R², Kaufman Efficiency Ratio, ADX strength+slope and Fractal Dimension into one persistence axis with a Strong/Healthy/Transition/Weak/Dead state, hysteresis, calibration-anchor inputs and visual-only directional context
bayesian_trend_factor.pineBayesian-inspired trend-quality filter — fuses regression direction, gated ADX/ER/R² strength, aged swing structure and exhaustion risk into a signed −100..+100 Trend Factor plus separate Confidence; volatility is quality-only; trend-state hysteresis, PB/CONT labels with hover explanations and HAMA-style smoothed Trend Candles
markov_state_engine.pineSix-state regime resolution map with an exit-conditional Markov model ("when this regime breaks, where did similar states resolve?") — extremes-first debounced classification, a robust Timing axis (Persistence + coiled-spring Maturity) split from the thin Direction axis, a net resolution line whose fill encodes Reliability, a hysteresis Bias and Reversal/Breakout/Continuation-typed edges
market_memory_decay_oscillator.pineSigned Carry/Decay oscillator fusing autocorrelation half-life, Hurst exponent approximation, path efficiency and range expansion/decay into one read on how long the current impulse is likely to persist before mean-reverting
regime_transition_engine.pineSeven-state regime classifier (Noise/Compression/Expansion/Trend Up/Down/Exhaustion/Reversion) with dwell+hysteresis debouncing and a directional Transition Pressure oscillator reading how close the active state is to flipping into its natural successor
predictability_regime_index.pineSigned −100..+100 index fusing Variance Ratio, return autocorrelation, Hurst exponent approximation and fractal efficiency into a Momentum / Reversion / Noise / Mixed regime read, with a Confidence output combining reading strength and sensor agreement
market_state_engine.pineScore-arbitrated context engine with orthogonal structure/energy/location axes, efficient impulse memory, four-level directional context, Auction Pressure, and acceptance-based Balance/Compression zone breakouts
commodity_pulse_matrix_v3.pineMulti-timeframe confluence scoring matrix across instruments — published on TradingView
signal_quality_engine.pineRange-fade signal engine — fades exhausted range edges (long the lows, short the highs) via a Distance+Structure+Momentum exhaustion score, with an Edge → Setup → Watch → Trigger read and candle-rejection confirmation
trade_permission_engine_v1.pineDoes the market currently permit trading Long or Short — unified Continuation/Reversal Maturity on one retracement ratio against an alternating confirmed reference leg, with a live (not just frozen-at-formation) trend-quality read and permission decay when the move goes quiet; plus a decoupled Position Health score (HOLD/PROTECT/REDUCE/EXIT) for an already-open position
regime_detector.pineMA-zone based trend regime overlay
ma_regime_bands.pineMoving average regime classification bands
relative_leg_efficiency.pineEfficiency ratio per price leg — how directional each move is
auto_trendlines.pineCombinatorial trendline detection with OLS refinement, quality scoring, and greedy selection
chandelier_flip_radar.pineATR trailing stop with five-level trend state — progressive bar coloring, trap markers, body-filtered flips, optional MTF confluence
smooth_trend_radar.pineDouble-smoothed Supertrend baseline — auto-scaled per timeframe, ATR-scaled slope trend detection with hysteresis, live baseline rejections in both regimes, statistical overextension via candle coloring, automatic SL/TP setup on flips
adaptive_arithmetic_candles.pineEfficiency-adaptive candle transform with a regression-anchored body boost and a 0-100 Trend Quality Score; flips are early warnings, Long/Short signals require a strong-state breakout of the prior N bars' high/low
modern_trend_regime.pineTrend / Range / Transition regime — both sides scored via factors (not AND-chains) from ADX, efficiency ratio, DI, line stack, price and structure compression, with immediate transition on structure loss; trend confirmation fires on the regime change itself (not the raw crossover), plus a frozen swing-based range structure (one-shot breakouts, debounced reactions) and a time-aligned "price vs. structure preview" breakout marker; six tuned presets plus manual mode
ma_cascade_engine.pineFast/Base/Anchor MA triplet run through Visual/Feature/State/Decision layers — seven-state classification (Bull/Bear Expansion, Bull/Bear Pullback, Overextended, Transition, Neutral Compression), signed ±100 score from direction/slope/expansion/curvature/MA-respect/cross-frequency, Permission/Setup/Trigger/Weakness/Exit signal layers
market_average_relationship_engine.pineSingle-MA relationship engine (EMA/SMA/WMA/HMA/VWMA/RMA/DEMA/TEMA/ALMA) — six diagnostic scores (Trend, Respect, Extension, Compression, Acceleration, Exhaustion) feed a signed −100..+100 relationship oscillator and a twelve-state classification; confirmed Pullback/Momentum Release/Do Not Chase/Exhaustion/Relationship Broken events, extension/exhaustion degrade quality without flipping direction; v1.1.0 adds price/relationship Divergence (pivots stay diagnostic-only) and a pivot-free Turn From Extreme event for trend start / trend weakening

Volatility

ScriptWhat it does
atr_advanced.pineATR in four display modes (Raw, ATR%, Normalized, Percentile Rank) with pluggable smoothing, gradient visualization, and expansion/contraction signals
compression_fractal_release.pineDetects a compressed corrective coil inside an HTF trend and trades its release; band break is the trigger, coil strength + release dynamics are scored, choppiness vetoes low-quality breaks; classifies Release (with trend) vs Base Break (against trend)
williams_vix_fix_advanced.pineSynthetic fear gauge (Williams VIX Fix) — mirrored Bull/Bear WVF, StdDev/percentile spike bands, per-side stall/absorption, Spike Quality, Reclaim signal, Sentiment Bar dominance score, gradient coloring

Momentum & Oscillators

ScriptWhat it does
cci_advanced.pineCCI with pluggable smoothing, three scale modes, OB/OS extreme-zone filter, gradient line, shadow fills, and Sentiment Bar/Signal Quality scoring
fisher_transform_advanced.pineFisher Transform with reversal-heavy extreme reads, trend context, stall/absorption markers, cross conviction, divergence wedge, and Sentiment Bar/Signal Quality scoring
roc_advanced.pinePercentage Rate of Change with momentum-stretch zones, trend context, stall/absorption markers, cross conviction, divergence wedge, and Sentiment Bar/Signal Quality scoring
rsi_advanced.pineRSI with smoothed signal, trend context, stall/absorption markers, cross conviction, divergence wedge, long/short directional coloring, and Sentiment Bar/Signal Quality scoring
stoch_rsi_advanced.pineStoch RSI K/D with trend context, stall/absorption markers, cross conviction, divergence wedge, long/short directional coloring, and Sentiment Bar/Signal Quality scoring
tsi_advanced.pineTrue Strength Index with clean signal crosses, trend context, stall/absorption markers, cross conviction, divergence wedge, and Sentiment Bar/Signal Quality scoring
wavetrend.pineWaveTrend oscillator — cross signals, divergence, overextension duration, slope quality filter, zone persistence
wavetrend_advanced_smoothing.pineWaveTrend with 8 pluggable smoothing kernels, gradient line coloring, shadow fills, 4-state histogram, configurable scale modes, and a Sentiment Bar
williams_r_advanced.pineWilliams %R normalized to 0-100 with fast extreme reads, trend context, stall/absorption markers, cross conviction, divergence wedge, and Sentiment Bar/Signal Quality scoring
commodity_flow_trend.pineMFI + CCI composite oscillator for commodities — 4-state flow background, extreme-zone reversal signals, optional CCI gate, normalized CCI overlay
mtf_wavetrend_opportunity_hunter.pineMTF confluence pane — net score histogram + heat ribbons per layer, RRG-style rotation map, Ehlers Ultimate Smoother core, entropy noise floor, persistent TP/SL zones on the price chart
mtf_wavetrend_confluence.pineTide / Wave / Ripple — WaveTrend across three fixed horizons; the Ripple cross on your chart TF is the signal, graded 0–5 by extreme depth + Wave/Tide/Stoch agreement (never gated), with Reversal/Continuation read and two-tier Watch→Signal alerts
market_stress_oscillator.pineComposite stress index — WVF with JMA and ADX filters
market_exhaustion.pineExhaustion signals via MFI and StochRSI with divergence detection
oscillator_divergence_zones.pineOscillator divergence zones — RSI, CCI, MFI, Fisher, TSI, STC, DPO, Roofing, Cyber Cycle; regular + hidden; ATR-wide zones with retest counter
market_pressure_scale.pineDual-component oscillator — Setup Pressure (coiling) vs Impulse Pressure (expansion), Range Chop Filter, Move Strength gauge, DMI-free Reversal signal, phase labels and Action-readout dashboard
mtf_stochrsi_pair_score.pineMulti-timeframe StochRSI confluence scorer — pair-weighted with sync bonus and conflict penalty, weighted total, Bias/Quality/Timing state-engine readout, signal markers
pivot_momentum_structure.pineRSI/WaveTrend/Stochastic RSI/CCI/Fisher/TSI/Williams %R/CMO — HH/HL/LH/LL structure on price and momentum, best-of-window divergence/alignment anchor search, structure presets, ATR-tolerant labels — published on TradingView

Liquidity & Order Flow

ScriptWhat it does
volume_strata.pineFixed-range volume profile — right-anchored bars, POC, VAH/VAL, HVN/LVN zones, naked POC tracking
money_flow_delta_profile.pineCenter-out diverging profile — green (right) = net buying, red (left) = net selling at each price level; POC, Value Area, optional recency weighting
mfi_advanced.pineMFI with smoothed signal, no-volume fallback, trend context, stall/absorption markers, divergence wedge, long/short directional coloring, and Sentiment Bar/Signal Quality scoring
vwap_cross_visuals.pineVWAP with multi-band deviation analysis
anchored_vwap.pineStage-4 fair-value location sensor — VWAP anchored to swing pivot / session / period / manual date, volume-weighted σ bands, distance-from-value in σ as a symmetric Location output (no triggers)
midas_curves.pineMIDAS 2.0 — anchored MIDAS support/resistance curve (launch-anchored VWAP) plus a true topfinder/bottomfinder accelerated curve with closed-form auto-fit that forecasts trend exhaustion (d/D progress); Location + Exhaustion sensor, context markers not entries
liquidity_hunter.pineRanked equal highs/lows — quality-scored BSL/SSL levels, sweep markers, reclaim detection with event scoring

Pattern & Wave Analysis

ScriptWhat it does
zigzag_core.pineConfigurable ZigZag engine — separated Depth/Backstep/Deviation/Alternation filters, Percent/ATR/Hybrid reversal modes, true higher-timeframe pivot projection, non-repainting-distinct developing last leg
zigzag_patterns_framework.pineZigZag-based pattern detection — ABC, triangles, Wolfe waves
zigzag_fibo_pullback_map.pineConfirmed ZigZag pivots with pullback-to-Fibonacci labeling and active fib fan
elliott_wave_radar.pineRule-validated Elliott Wave counting — labels impulses/ABC only when hard EW rules hold, Fib-scored, with target projections and invalidation watch
wolfe_wave_scanner_pro.pineDedicated 5-point Wolfe Wave scanner — best-of-window swing search, weighted 0-100 score, EPA target from the true 1-3/2-4 apex, multi-pattern tracking, live invalidation tracking, score-breakdown debug table
triangle_compression_scanner_pro.pineSliding-window triangle scanner (symmetric/ascending/descending) — boundary lines fit to a swing window, weighted 0-100 score, multi-pattern tracking, live breakout resolution
broadening_wedge_scanner_pro.pineSliding-window broadening wedge scanner (descending/ascending/symmetric broadening) — expansion-based sibling to the triangle scanner, weighted 0-100 score, multi-pattern tracking, live breakout resolution
candle_story_engine.pineMulti-candle candle-story engine — recency-weighted sequence pressure, dominance, close persistence, compression and trend exhaustion (decoupled from BUY/SELL), follow-through/failure detection; classic candlestick patterns as supporting evidence only

Equities & Relative Strength

ScriptWhat it does
relative_strength_line.pineRS vs. a benchmark (SPY/QQQ) — Mansfield RS oscillator or raw RS line, with the IBD leadership signal (RS new high before price). See MOMENTUM_EQUITIES.md for the equities roadmap

Strategies

Most strategy files are auto-generated from indicator source files via scripts/build_strategies.py — do not edit those directly. The WaveTrend v4 strategy is standalone and maintained by hand. Each strategy adds a trade direction filter, confirmed-bar gate, cooldown, and optional break-even stop on top of the indicator logic.

python3 scripts/build_strategies.py # rebuild all
python3 scripts/build_strategies.py indicators/trend_direction/chandelier_flip_radar/
StrategyBased onSL typeBacktest rating
chandelier_flip_radar_strategy.pineChandelier Flip RadarTrailingPromising (PF 1.60, NatGas 4H)
market_average_relationship_engine_strategy.pineMarket–Average Relationship EngineTrailing (MA ∓ ATR×)Not ready — not yet backtested
oscillator_divergence_zones_strategy.pineOscillator Divergence ZonesPivot ATRPromising (PF 1.14, NatGas 4H)
smooth_trend_radar_strategy.pineSmooth Trend RadarFixed TPPromising (PF 1.71 Long, NatGas 4H)
wavetrend_v4_strategy.pineWaveTrend v4TrailingPromising (PF 3.07, NatGas 1D — best in repo)

Full backtest results and parameter notes: strategies/<name>/<name>_strategy_assessment.md. Schema: strategies/ASSESSMENT_SCHEMA.md.


Libraries

A serious attempt at a reusable Pine Script foundation for MTF analysis, market structure, and strategy execution. The architecture is solid but the project was not completed. Kept here for reference; not actively maintained.

To use [RTA]-tagged scripts, publish each library via Pine Script Editor → Publish Script → Library using the exact name from the library() declaration.

LibraryCovers
RTAFramework.pineCore MTF framework, signal engine, risk management
RTAMarketStructure.pineVolume profile, VWAP, zones, SMC concepts
RTAAdvanced.pineDivergence, Fibonacci, pattern geometry
RTAStrategy.pineStrategy execution, position sizing, analytics
RTALiquidity.pineLiquidity mapping, order flow, Wyckoff
RTAMonitoring.pineDebug utilities, metrics, health monitoring

These scripts are for educational and informational purposes only. Not financial advice. Trading involves substantial risk of loss.

About

Pine Script v6 collection — indicators, strategies & RTA libraries for TradingView

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages