Mis à jour
L1 Multidimensional KDJ

Level: 1
Background
The KDJ oscillator display consists of 3 lines (K, D and J - hence the name of the display) and 2 levels. K and D are the same lines you see when using the stochastic oscillator. The J line in turn represents the deviation of the D value from the K value. The convergence of these lines indicates new trading opportunities. Just like the Stochastic Oscillator, oversold and overbought levels correspond to the times when the trend is likely to reverse.
Function
L1 Multidimensional KDJ utilizes multiple KDJ modeling across multiple time frames. In this instance, it covers three time frames as day, week and month. Although it is named like that, one can deduce and use it in small time frames e.g. 15mins (day), 60mins (week) and 4H (month) because KDJ oscillator is commonly used for small time frames across various markets.
Key Signal
kd --> day K value
kw --> week K value
km --> month K value
dd --> day D value
dw --> week D value
dm --> month D value
divergence --> divergence among day, week, month D values
resonance --> all three time frame D values are in the same direction
Pros and Cons
Pros:
1. Enable multidimensional KDJ,especially D value comparisons
2. divergence and resoanance among different time frame KDJ can be disclosed
Cons:
1. It may satruate for extreme conditions of long and short.
2. Not accurate for long and short entries by resonance effect.
Remarks
Bring about multiple time frames into consideration of KDJ is novel.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Background
The KDJ oscillator display consists of 3 lines (K, D and J - hence the name of the display) and 2 levels. K and D are the same lines you see when using the stochastic oscillator. The J line in turn represents the deviation of the D value from the K value. The convergence of these lines indicates new trading opportunities. Just like the Stochastic Oscillator, oversold and overbought levels correspond to the times when the trend is likely to reverse.
Function
L1 Multidimensional KDJ utilizes multiple KDJ modeling across multiple time frames. In this instance, it covers three time frames as day, week and month. Although it is named like that, one can deduce and use it in small time frames e.g. 15mins (day), 60mins (week) and 4H (month) because KDJ oscillator is commonly used for small time frames across various markets.
Key Signal
kd --> day K value
kw --> week K value
km --> month K value
dd --> day D value
dw --> week D value
dm --> month D value
divergence --> divergence among day, week, month D values
resonance --> all three time frame D values are in the same direction
Pros and Cons
Pros:
1. Enable multidimensional KDJ,especially D value comparisons
2. divergence and resoanance among different time frame KDJ can be disclosed
Cons:
1. It may satruate for extreme conditions of long and short.
2. Not accurate for long and short entries by resonance effect.
Remarks
Bring about multiple time frames into consideration of KDJ is novel.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Notes de version
OVERVIEW This indicator analyzes price momentum using multidimensional KDJ oscillator values calculated over daily, weekly, and monthly timeframes. Generates actionable trading signals based on dynamic cross relationships between weekly/monthly D-line interactions while incorporating advanced analytical layers such as divergence detection and resonance patterns.
FEATURES
Multi-Timeframe Analysis:
Daily KDJ computed using 5-period parameters
Weekly KDJ based on 27-period settings
Monthly configuration employing 89-period metrics
Actionable Signals:
• Buy signal triggered by weekly/monthly D-line bullish crossover
• Sell signal activated during bearish crossover events
• Visualized with distinct colored labels
Visual Indicators:
✓ Threshold lines (user adjustable) displayed as dotted references
✓ Dynamic differential bars showing weekly/monthly D disparity
✓ Background highlighting confirming trade triggers
Advanced Analytics:
▪ Divergence monitoring identifying conflicting trend directions
▫ Three-period共振(resonance) confirmation requiring sustained upward alignment
■ Last valid value tracking prevents stale data usage
HOW TO USE
Adjust threshold levels using input controls:
botinput = Lower Boundary Setting (default 20)
topinput = Upper Boundary Setting (default 80)
midinput = Midpoint Reference (fixed at 50)
Interpret plot displays:
White line: Daily D momentum
Yellow/Fuchsia lines: Weekly/Monthly D comparisons
Color-coded columns show directional disparities
Monitor pattern formations:
⏷ Bull/Bear flags appear precisely on confirmed crossovers
⇆ Divergence alerts (red signals) indicate potential reversal zones
LIMITATIONS
Historical data requirements may cause delays in initial calculations
Momentum oscillators can produce false signals during strong trending phases
Timeframe-based configurations assume consistent session activity
NOTES
• Uses custom calculate_weighted_moving_average implementation with variable weighting emphasis
• Dynamic typing ensures continuous series validity through get_last_valid_value mechanism
• Differential calculations normalized by multiplying GHIST values × 0.5
CREDITS
Inspired by classical stochastic principles refined for modern algorithmic evaluation techniques.
Notes de version
█ OVERVIEWL1 Multidimensional KDJ reads momentum on three tiers at once — slow, mid and fast — and compresses the interaction between them into a single pane below the price. It marks the crossover between the mid and slow tiers as buy and sell points, grades the move with a differential histogram, flags tier agreement or disagreement as resonance or divergence, and attaches a stop and a target level to every signal.
█ CONCEPTS
A single oscillator only answers one question. This script answers three at the same time, then compares the answers:
• Slow tier — the deepest lookback, acting as the background regime.
• Mid tier — the signal tier; its cross against the slow tier defines entries and exits.
• Fast tier — the fastest engine, plotted as the leading line.
From those three lines the script derives three readable states:
• Differential — the gap between the mid and slow tiers, drawn as a histogram whose colour shows both direction and whether the gap is widening or fading.
• Resonance — both tiers rising together for several bars: trend agreement.
• Divergence — the tiers moving in opposite directions: trend disagreement, a caution state.
█ FEATURES
• Three-tier momentum engine with fully exposed lengths, smoothing and weighting.
• Entry, exit, stop and target labels with adjustable size, plus a compact marker fallback; divergence and resonance labels are available but off by default.
• Differential histogram with four-state strength colouring: widening or fading, in both directions.
• Stop and target levels on every signal, by ATR multiple or by percent.
• Statistics panel: three-tier values and directions, tier alignment, leg state, entry, stop, target, open P/L and signal counters.
• Adjustable line width, histogram width and label size for a compact pane.
• Optional K and J diagnostics for all three tiers, off by default.
• Six alert conditions plus one dynamic alert that carries event and price.
• Grouped, range-constrained inputs with documented defaults.
█ HOW TO USE
1 — Add the script to any chart. It draws in its own pane and never overlaps price.
2 — Keep the defaults for the first run: tier lengths 89 / 27 / 5, smoothing 3 / 3, thresholds 20 / 50 / 80.
3 — Read the labels: BUY appears when the mid tier crosses above the slow tier, SELL when it crosses below.
4 — Watch the histogram: bright colours mean the gap is widening, muted colours mean the move is fading.
5 — Read the risk channel: a red stop line, a green target line and a grey open P/L line, all in percent from entry; exact prices sit in the statistics panel rows Entry, Stop and Target.
6 — Open the settings to change label size, line widths, risk method and panel position.
Input Parameters
KDJ Engine
• Monthly-tier Length (89) — lookback of the slow tier.
• Weekly-tier Length (27) — lookback of the mid, signal-generating tier.
• Daily-tier Length (5) — lookback of the fast tier.
• K Smoothing Length (3) and D Smoothing Length (3) — smoothing depth of each tier.
• K/D Smoothing Weight (1.0) — how strongly the newest value feeds the smoothing.
Thresholds
• Lower Threshold (20), Midpoint Threshold (50), Upper Threshold (80) — dotted reference levels.
• Differential Scale (0.5) — visual scaling of the histogram.
• Divergence / Resonance Level (50) — height of the state markers and labels.
Risk (Stop / Target)
• Show Stop / Target Levels (true) — draws the percent channel and fills the panel rows.
• Level Method (ATR) — ATR or Percent.
• ATR Length (14), Stop ATR Multiple (2.0), Target ATR Multiple (3.0).
• Stop Percent (3.0), Target Percent (6.0).
• Risk Levels Close The Leg (false) — when on, a touch ends the leg and prints a TP or SL label.
Visual
• Line Width (1), Histogram Width (2), Stop / Target Line Width (1).
• Highlight Signal Bars (true) — a very light bar tint on signal bars.
• Show Divergence / Resonance Markers (false) — the red and aqua step markers; off keeps the pane clean, counters and alerts are unaffected.
• Show K / J Lines (false) — engine diagnostics.
Labels
• Show Entry / Exit Labels (true) — buy, sell, stop and target; off switches to compact triangle markers.
• Show Divergence / Resonance Labels (false) — off keeps the pane clean, counters and alerts are unaffected.
• Label Size (Tiny) — Tiny, Small or Normal.
• Include Price In Labels (false).
Statistics
• Show Statistics Panel (true) and Panel Position (Top Right).
█ SIGNALS
• BUY label, green — the mid tier crossed above the slow tier.
• SELL label, red — the mid tier crossed below the slow tier.
• TP or SL label — target or stop reached, only in risk-exit mode.
• DIV label, red — divergence state just started, off by default.
• RES label, aqua — resonance state just started, off by default.
• White line — fast tier, the most responsive line, useful for timing.
• Yellow line — mid tier, the signal tier.
• Fuchsia line — slow tier, the background regime.
• Histogram columns — the mid minus slow differential; red and blue for a positive gap, lime and yellow for a negative one, bright when widening and muted when fading.
• Red, green and grey thin lines — stop level, target level and open P/L, all in percent from entry.
█ WHAT IS NEW IN V2
V2 keeps the engine, the signals and all engine parameters identical to the original. It fixes defects and adds visualization and risk tooling.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.