# Master Pattern

Master Pattern is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Detects Wyckoff-inspired contraction phases (a lower high against a higher low) and flags bullish and bearish master patterns when price breaks out of the contraction range, graded major or minor, with an expansion line drawn at the range midpoint. Liquidity levels from historical pivots supply target and stop references. For traders who work the contraction-to-expansion rhythm.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jul 31, 2023.
- Access: free.
- Concepts: [Expansion → Retracement → Consolidation Cycle](https://www.luxalgo.com/library/concept/expansion-retracement-consolidation-cycle/) (primary), [Range Expansion/contraction](https://www.luxalgo.com/library/concept/range-expansion-contraction/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn3ne20053vhsg8kt5f91q
- Page: https://www.luxalgo.com/library/indicator/master-pattern/

The **Master Pattern** automates a Wyckoff-inspired read of the [expansion–retracement–consolidation cycle](https://www.luxalgo.com/library/concept/expansion-retracement-consolidation-cycle/). It hunts contraction phases (a lower high paired with a higher low), plots the average of the recent swing high and low as an expansion line, and classifies what happens when price escapes. Liquidity levels drawn from historical pivots round out the toolkit as ready-made references for targets and stops.

## How to Trade the Master Pattern?

- **Contraction resolves**: an upward break of the [contraction range](https://www.luxalgo.com/library/concept/range-expansion-contraction/) prints a bullish master pattern; a downward break, a bearish one.
- **Expansion, then markup**: price often lingers around the expansion line before the markup phase carries it decisively away. Hesitation between the two is normal.
- **Major vs minor**: major patterns break both extremities of the range and get a highlighted border; minor patterns break only one.
- **Expansion lines as S/R**: old expansion lines keep serving as support and resistance long after the pattern completes.

## Master Pattern Settings

- **Contraction Detection Lookback**: period for the swing points that define contraction ranges.
- **Liquidity Levels**: lookback for the pivots used as liquidity levels. Longer values shift focus toward longer-term zones.
- **Show Major Pattern / Show Minor Pattern**: display toggles for each pattern class.

## Frequently Asked Questions

### Are the liquidity levels predictive?

No. They derive from historical pivots and plot retrospectively. Their value is as a map of where liquidity rested, which brings discipline to target and stop placement rather than generating entries on its own.

### How does the Master Pattern connect to Wyckoff analysis?

The debt is in its reading of consolidation: Wyckoff treated ranges as preparation for the directional move that follows, and this build formalizes that hand-off with its contraction detection and expansion lines. For explicit phase labeling of accumulation ranges, the [Wyckoff Accumulation Schematic](https://www.luxalgo.com/library/indicator/wyckoff-accumulation-schematic/) is the dedicated companion piece.

### How can I start using the Master Pattern?

It is one of LuxAlgo's free builds, available from its LuxAlgo Library page. You can also open it in Quant, our coding agent, right from the page to experiment with contraction-based setups. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Squeeze Index](https://www.luxalgo.com/library/indicator/squeeze-index/) (Range Expansion/contraction): markdown at https://www.luxalgo.com/library/indicator/squeeze-index.md
- [Smart Money Concepts (SMC)](https://www.luxalgo.com/library/indicator/smart-money-concepts-smc/) (Break of Structure): markdown at https://www.luxalgo.com/library/indicator/smart-money-concepts-smc.md
- [Structure & Trend Dashboard](https://www.luxalgo.com/library/indicator/structure-trend-dashboard/) (Break of Structure): markdown at https://www.luxalgo.com/library/indicator/structure-trend-dashboard.md
- [FVG + Liquidity Sweep + CISD](https://www.luxalgo.com/library/indicator/fvg-liquidity-sweep-cisd/) (Change of Character): markdown at https://www.luxalgo.com/library/indicator/fvg-liquidity-sweep-cisd.md
- [MSS Sweep Fib Retrace](https://www.luxalgo.com/library/indicator/mss-sweep-fib-retrace/) (Change of Character): markdown at https://www.luxalgo.com/library/indicator/mss-sweep-fib-retrace.md
- [HTF CISD Projections](https://www.luxalgo.com/library/indicator/htf-cisd-projections/) (Change of Character): markdown at https://www.luxalgo.com/library/indicator/htf-cisd-projections.md
- [HTF Sweep Signals](https://www.luxalgo.com/library/indicator/htf-sweep-signals/) (Swing Failure Pattern): markdown at https://www.luxalgo.com/library/indicator/htf-sweep-signals.md
- [Liquidity Structure & Order Flow](https://www.luxalgo.com/library/indicator/liquidity-structure-order-flow/) (Break of Structure): markdown at https://www.luxalgo.com/library/indicator/liquidity-structure-order-flow.md

---

Source: https://www.luxalgo.com/library/indicator/master-pattern/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
