Financial Market Technical Analysis Through the Lens of Chan Theory (Chanlun)

    This article explains how Chan Theory (Chanlun) can be applied to the technical analysis of financial markets by decomposing price action into identifiable, reusable geometric structures. It covers the core building blocks—fractals, strokes, and segments—and then explains central pivots, the distinction between trends and consolidations, and the three types of buy/sell points defined by divergence. It closes with practical engineering guidance for building parameterized, traceable, lookahead-free structure-analysis modules. A large-scale financing event is used as the motivating example to show how such events leave structural traces in the price and volume series.

    Financial Market Technical Analysis Through the Lens of Chan Theory (Chanlun)

    1. Why analyze these events with Chan Theory

    The source material describes an unprecedented capital market financing event: the issue price, the base fundraising size, the accompanying private placement allocation, and the comparison relationships that set a historical record. For technical analysis, the specific entity involved does not matter; what matters is the “structural trace” such an event leaves in the price and volume series.

    Gaoshan’s Chan Theory does not emphasize predicting price levels, but rather decomposing price movement into identifiable, reusable geometric structures. The core stance of Chan Theory is that market movement is built up self-similarly, layer by layer, through “fractal — stroke — segment — central pivot — trend type.” The task of analysis is to complete the structural decomposition, not to offer an emotional conclusion.

    For events like ultra-large-scale financing, the impact on the market usually appears at three levels:

    • Liquidity: Short-term liquidity is heavily occupied, causing related instruments and indices to gap, expand in volume, or contract in volume.
    • Sentiment: The expectation gap before and after the event pushes volatility higher.
    • Structure: The central pivot of the existing trend may be broken to the upside or downside, forming a new trend level.

    The value of Chan Theory is that it unifies all of these impacts into a single decidable question: whether the structure has been broken.

    2. Basic building blocks: fractals, strokes, and segments

    2.1 Fractal

    Fractals come in two forms, top fractals and bottom fractals, each formed by three consecutive K-lines. A top fractal requires the middle K-line to have both the highest high and the highest low; a bottom fractal is the reverse. Two points need attention in an engineering implementation: first, the K-lines must undergo inclusion (containment) processing; second, a fractal must be “confirmed” before it can be used to build a stroke.

    Illustrative pseudocode:

    1. def merge_inclusion(klines):
    2. # Merge inclusion relationships so the sequence is unambiguous
    3. merged = [klines[0]]
    4. for k in klines[1:]:
    5. prev = merged[-1]
    6. if (k.high >= prev.high and k.low <= prev.low) or \
    7. (k.high <= prev.high and k.low >= prev.low):
    8. merged[-1] = merge(prev, k)
    9. else:
    10. merged.append(k)
    11. return merged
    12. def is_fractal(seq, i, direction):
    13. a, b, c = seq[i-1], seq[i], seq[i+1]
    14. if direction == 'top':
    15. return b.high > a.high and b.high > c.high and b.low > a.low and b.low > c.low
    16. return b.low < a.low and b.low < c.low and b.high < a.high and b.high < c.high

    2.2 Stroke

    A stroke connects an adjacent top fractal and bottom fractal, with at least one independent K-line in between (different schools require different numbers of separating K-lines, so this should be a configurable parameter in engineering). Strokes alternate in direction and form the most basic description of a trend.

    2.3 Segment

    A segment is formed by at least three strokes and is used to filter out stroke-level noise. Breaking a segment requires a fractal to appear in the characteristic sequence; this step is the most error-prone in many implementations, so it is advisable to cover it with dedicated unit tests.

    3. Central pivot: the core of structure

    A central pivot is formed by the overlapping range of three consecutive sub-level trends. Its upper edge is the minimum of the high points in the overlap, and its lower edge is the maximum of the low points. The purpose of a central pivot is to describe the “consensus cost zone between bulls and bears.”

    Key judgment points:

    • Once a central pivot forms, price repeatedly tests its upper and lower edges—this is consolidation.
    • If a move away from the pivot is quickly pulled back, it is usually judged an invalid breakout.
    • The level of the central pivot determines the minimum level of the subsequent trend, and a level mismatch is the main cause of failed analysis.

    Pseudocode for updating a central pivot:

    1. def update_central(zone, seg_high, seg_low):
    2. if zone is None:
    3. return {'high': seg_high, 'low': seg_low}
    4. new_high = min(zone['high'], seg_high)
    5. new_low = max(zone['low'], seg_low)
    6. if new_high > new_low:
    7. return {'high': new_high, 'low': new_low}
    8. return zone # No overlap; the central pivot ends

    4. Trend types and buy/sell points

    Chan Theory divides movement into two categories: trends and consolidations. A trend requires at least two same-direction central pivots that successively rise or fall; with only one central pivot, the movement is a consolidation.

    General definitions of the three types of buy/sell points:

    1. First type: divergence appears at the end of a trend, meaning price makes a new high or low while the momentum indicator decays.
    2. Second type: the first sub-level pullback after a first-type point does not break the prior low (or prior high).
    3. Third type: after price leaves the central pivot, the pullback does not re-enter the pivot’s range.

    Divergence detection in engineering usually relies on computable quantities such as MACD area, volume, or amplitude decay, but one thing must be clear: these are only proxy indicators for momentum and cannot be equated with the structure itself.

    5. Engineering implementation recommendations

    • Externalize parameters: inclusion processing, stroke spacing, and segment confirmation methods should all be configurable to avoid hard-coding.
    • Make structure traceable: every structural decomposition should save its version and rationale, which makes it easier to align reviews with backtests.
    • Avoid lookahead: fractal confirmation and segment breakage must use only data available after the current K-line closes.
    • Combine with general cloud capabilities: market data can be stored in object storage, compute tasks can run on a container platform, task scheduling can be delegated to a message queue, and runtime metrics can be observed through log services and a monitoring and alerting system.
    • Separate backtesting from live trading: structure recognition and strategy execution should be layered, with the former only emitting structural events and the latter consuming those events.

    6. Conclusion

    The real insight of Gaoshan’s Chan Theory is not any specific conclusion but a methodology: turning uncontrollable market fluctuations into divisible, verifiable structural objects. For events like ultra-large-scale financing, Chan Theory provides a language for judging “whether the structure continues or breaks.” If developers can turn the five components—fractal, stroke, segment, central pivot, and divergence—into parameterized, traceable, lookahead-free modules, they can reliably reproduce the analysis process on any market data. That is precisely where the true value of quantitative research and engineering practice lies.