INVITE-ONLY SCRIPT

ChanLun-v5.0

42
ChanLun (Entanglement Theory)

ChanLun, also known as Entanglement Theory, is a highly respected technical analysis methodology that originated in China. Since its introduction in 2006, ChanLun has gained tremendous popularity and a strong following within the Chinese trading community due to its exceptional ability to navigate complex market dynamics.
ChanLun places great emphasis on market structure, price behavior, momentum, and the intricate interactions between market forces. It recognizes that markets operate in cyclical patterns and seeks to capture the underlying structure and rhythm of price movements. By analyzing the complex relationship between price and time, ChanLun provides traders with unique insights into market trends, potential reversals, and critical turning points.
This indicator delivers a detailed and comprehensive implementation of ChanLun theory. It enables in-depth analysis and visualization of all core components, including Candlestick Conversion, Candlestick Standardization, Fractals, Strokes, Segments, Pivots, and Buying/Selling Points.
🔵 Step 1: Candlestick Conversion
In ChanLun, candlestick analysis places less emphasis on open/close prices and wicks, and instead focuses on the price range reached by the market. Therefore, the first step involves converting each candlestick into a simplified form that retains only the high and low values, discarding all other elements
🔵 Step 2: Candlestick Standardization
In the second step, the converted candlesticks are standardized to ensure strict directional consistency and to eliminate inside bars and outside bars.
For any two adjacent candlesticks A and B, if one candle’s price range completely contains the other, they are merged into a new candlestick C.
If A is in an upward trend relative to the previous candle:
High(C) = max(High(A), High(B))
Low(C) = max(Low(A), Low(B))
If A is in a downward trend:
High(C) = min(High(A), High(B))
Low(C) = min(Low(A), Low(B))
After this process, for any adjacent candles A and B, one of the following conditions will always hold:
High(A) > High(B) and Low(A) > Low(B)
High(A) < High(B) and Low(A) < Low(B)
🔵 Step 3: Fractals
A Fractal is a pattern formed by three consecutive standardized candlesticks, where the middle candle shows a clear extremum relative to its neighbors.
For three adjacent candles A, B, and C, the conditions are:
Top Fractal:
High(B) > High(A) and High(B) > High(C)
Low(B) > Low(A) and Low(B) > Low(C)
Bottom Fractal:
High(B) < Low(A) and High(B) < Low(C)
Low(B) < Low(A) and Low(B) < Low(C)
Top fractals are marked with red triangles, while bottom fractals are marked with green triangles.
🔵 Step 4: Stroke
A Stroke is a line connecting a top fractal and a bottom fractal, subject to the following rules:
There must be at least one “free” candlestick between the two fractals (not part of any fractal), ensuring a minimum of five candlesticks per stroke.
A top fractal must have a higher price than the corresponding bottom fractal.
The endpoint fractals must represent the absolute high or low within the stroke range (this rule can be enabled or disabled via settings).
Strokes help traders identify and visualize significant price movements while filtering out minor fluctuations.
🔵 Step 5: Segment
A Segment is a higher-level structure that connects the start and end points of at least three consecutive strokes, representing the prevailing market structure.
As new strokes form, the segment continues to extend until the market structure is broken. A break occurs when:
An uptrend forms lower highs and lower lows, or
A downtrend forms higher highs and higher lows.
Within consolidation ranges, strokes may form overlapping patterns similar to inside/outside bars. In such cases, strokes are merged until a clear structural break appears.
Segments provide a more stable representation of market trends at higher timeframes.
The segment algorithm can be applied recursively to generate higher-level segments, representing market trends across larger time scales.
🔵 Step 6: Pivot (Central Hub)
In ChanLun, a Pivot does not represent a reversal point. Instead, it defines a consolidation zone where price oscillates.
Within a given segment, a pivot is formed by the overlap of two consecutive strokes moving against the direction of the segment.
For two descending strokes A and B within an upward segment S:
Upper ound(P) = min(High(A), High(B))
Lower Bound(P) = max(Low(A), Low(B))
Pivots typically represent areas of consolidation and high trading volume.
If subsequent counter-trend strokes overlap with the existing pivot, the pivot extends horizontally. If two consecutive counter-trend strokes overlap with each other but not with the previous pivot, a new pivot is formed.
Pivots can also be recursively identified at higher segment levels.
🔵 Step 7: Buying / Selling Points
ChanLun defines three types of buying and selling points:
Type 1 (Trend Reversal
Occur at the termination of an old segment and the formation of a new one.
Type 2 (Trend Continuation)
Occurs during a trend:
In an uptrend, a Type 2 buy point forms after a pullback and rebound from prior support.
In a downtrend, a Type 2 sell point forms after a rebound and pullback from resistance.
Type 3 (Pivot Breakout Retest)
Represents a retest after price breaks out of a pivot range, indicating potential continuation beyond the pivot.
Although these points are lagging indicators, ChanLun mitigates this by using multi-timeframe analysis, where lower-timeframe confirmations enhance higher-timeframe trend confidence.
🔵 Step 8: Divergence
Divergence is a core ChanLun technique used to anticipate Type 1 buy/sell points. While MACD is the most commonly used indicator, others such as RSI can also be applied.
🟠 Summary
ChanLun is a powerful technical analysis framework that combines structural price analysis, quantitative indicators, and multi-timeframe logic. Its distinguishing feature lies in its holistic approach—integrating qualitative interpretation with quantitative structure—to support informed and disciplined trading decisions.
Core Value

This indicator systematizes ChanLun into a fully computable structure, delivering:

Objective structural market analysis

Multiple stroke/segment interpretations for varying conditions

Robust buy/sell point filtering

Multi-level market perspective

This indicator is for technical analysis only and does not constitute investment advice.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.