OPEN-SOURCE SCRIPT
Telah dikemas kini Adaptive Pivot-Length WaveTrend

Adaptive Pivot-Length WaveTrend (APL-WT)
A self-tuning WaveTrend oscillator that derives its smoothing lengths from the market’s own dominant cycle rather than fixed user inputs. A multi-scale pivot engine sweeps pivot strengths from 14 to 100 bars, building a probability mass function (PMF) over pivot-to-pivot distances. The mode of that distribution — the statistically dominant cycle length L — drives both WaveTrend lengths: n2 = L (average) and n1 = round(L × ratio) (channel), with floors, ceilings, and a stickiness tolerance to prevent jitter.
Because length adapts bar-to-bar, WaveTrend’s EMA state is carried manually to stay stable when periods change. Overbought, oversold, and mid-band levels are not hardcoded — they’re computed as empirical percentiles of WT1’s own recent distribution (default: 95/80/50/20/5 over 2000 bars), so the thresholds self-calibrate to each instrument and timeframe.
Signals
• Bullish/bearish WT1/WT2 crosses gated by the adaptive OS/OB percentile levels
• Mid-line cross alerts
• Full regular and hidden divergence suite (bull, bear, hidden bull, hidden bear) with pivot lookback controls, gated by the ±50 zones on WT1
Readouts
Optional info table showing dominant L, active n1/n2, cumulative pivot sample count, live WT1/WT2 values, WT1’s self-percentile rank, current OB/OS levels, regime state (OB / Upper / Mid / Lower / OS), and WT1-vs-WT2 polarity. Optional bar coloring in OB/OS extremes.
Best suited for traders who want WaveTrend to respect the actual cycle structure of whatever they’re looking at, without manually tuning lengths per symbol or timeframe.
A self-tuning WaveTrend oscillator that derives its smoothing lengths from the market’s own dominant cycle rather than fixed user inputs. A multi-scale pivot engine sweeps pivot strengths from 14 to 100 bars, building a probability mass function (PMF) over pivot-to-pivot distances. The mode of that distribution — the statistically dominant cycle length L — drives both WaveTrend lengths: n2 = L (average) and n1 = round(L × ratio) (channel), with floors, ceilings, and a stickiness tolerance to prevent jitter.
Because length adapts bar-to-bar, WaveTrend’s EMA state is carried manually to stay stable when periods change. Overbought, oversold, and mid-band levels are not hardcoded — they’re computed as empirical percentiles of WT1’s own recent distribution (default: 95/80/50/20/5 over 2000 bars), so the thresholds self-calibrate to each instrument and timeframe.
Signals
• Bullish/bearish WT1/WT2 crosses gated by the adaptive OS/OB percentile levels
• Mid-line cross alerts
• Full regular and hidden divergence suite (bull, bear, hidden bull, hidden bear) with pivot lookback controls, gated by the ±50 zones on WT1
Readouts
Optional info table showing dominant L, active n1/n2, cumulative pivot sample count, live WT1/WT2 values, WT1’s self-percentile rank, current OB/OS levels, regime state (OB / Upper / Mid / Lower / OS), and WT1-vs-WT2 polarity. Optional bar coloring in OB/OS extremes.
Best suited for traders who want WaveTrend to respect the actual cycle structure of whatever they’re looking at, without manually tuning lengths per symbol or timeframe.
Nota Keluaran
Updated the divergence length Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.