# O'Neil Base Analysis

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

Implements the base-trading rules of William O'Neil's growth-stock method: consolidations are validated against a 30% prior uptrend, 5-bar minimum length and 33% depth cap, the pivot buy point sits just above resistance, breakouts demand a 40% volume surge, base stages are counted with late-stage flags, and the 7% base-failure stop is enforced. Eight alerts cover the cycle.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jun 17, 2026.
- Access: free.
- Concepts: [O'Neil Base Analysis](https://www.luxalgo.com/library/concept/oneil-base-analysis/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=wf22vu0282fx9lkrd2trosdr
- Page: https://www.luxalgo.com/library/indicator/oneil-base-analysis/

**O'Neil Base Analysis** runs the base life cycle of [O'Neil base analysis](https://www.luxalgo.com/library/concept/oneil-base-analysis/) shape-agnostically. A candidate anchors at a high and matures once it passes the prior-uptrend, length and depth checks, waiting with a dotted live pivot line. A closing breakout draws the base box, grades quality, stamps the stage label and opens the failure watch, buy zone and stop line drawn.

## How to Trade the O'Neil Base Analysis?

- **Pivot buy vs weak-volume breakout**: a close through the pivot on volume at least the surge above average is confirmed; without it, alerted as unconfirmed.
- **Buy zone discipline**: entries belong in the narrow zone above the pivot: beyond it prints Extended; a heavy-volume close back inside the base is the early warning.
- **Base failure**: a drop to the stop below the buy point is an automatic sale under the fixed loss rule: no debate.
- **Base count**: a pivot forming sufficiently above the prior one advances the stage; late stages turn labels cautionary, and a decline below the prior base's low resets the count.

## O'Neil Base Analysis Settings

- **Prior Uptrend Minimum %** (default 30) and **Uptrend Lookback (bars)** (default 40): the prerequisite advance.
- **Minimum Base Length (bars)** (default 5) and **Maximum Base Depth %** (default 33): what counts as a base rather than a correction.
- **Pivot Margin Above Resistance %** (default 0.1), **Buy Zone Above Pivot %** (default 5) and **Base-Failure Stop %** (default 7): entry and loss geometry.
- **Volume Average Length** (default 10) and **Breakout Volume Surge %** (default 40): breakout confirmation; **Breakout Resolution Gain %** (default 20) ends the failure watch.
- **Stage Increment Threshold %** (default 20) and **Late-Stage Threshold** (default 3): base counting.
- **Tight Closes: Max Average Change %** (default 4) and **Volume Dry-Up Window (bars)** (default 5): quality grading, plus display toggles.

## Frequently Asked Questions

### How does this differ from a cup-with-handle detector?

A [Cup With Handle Base](https://www.luxalgo.com/library/indicator/cup-with-handle-base/) detector targets one named shape. This build validates any consolidation against the shared prerequisites and runs what every shape shares: pivot, volume confirmation, counting, the failure rule.

### What does the Q score in the stage labels mean?

Three checks over the base body: tight bar-to-bar closes, recent volume below its average (the dry-up), and up-day volume exceeding down-day volume, the quiet-accumulation signature of a sound base.

### Which timeframe should I use?

Weekly charts: the defaults are sized for them, the shortest standard bases running about 5 weeks. On daily charts raise the Volume Average Length to 50 and scale the lengths to match.

## Related indicators

- [Ascending Base](https://www.luxalgo.com/library/indicator/ascending-base/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/ascending-base.md
- [Double-bottom Base](https://www.luxalgo.com/library/indicator/double-bottom-base/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/double-bottom-base.md
- [Flat Base](https://www.luxalgo.com/library/indicator/flat-base/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/flat-base.md
- [IPO Base](https://www.luxalgo.com/library/indicator/ipo-base/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/ipo-base.md
- [Gap Fill Breakouts](https://www.luxalgo.com/library/indicator/gap-fill-breakouts/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/gap-fill-breakouts.md
- [On-neck / In-neck / Thrusting](https://www.luxalgo.com/library/indicator/on-neck-in-neck-thrusting/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/on-neck-in-neck-thrusting.md
- [Rising/falling Three Methods](https://www.luxalgo.com/library/indicator/rising-falling-three-methods/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/rising-falling-three-methods.md
- [Swing Highs/Lows & Candle Patterns](https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns/) (Chart & Candlestick Patterns): markdown at https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns.md

---

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