TradingView indicators

Woodies CCI: system components and rule definitions

Woodies CCI combines a main CCI, a faster Turbo CCI and a histogram. TradingView describes lengths of 14 and 6, with the main line driving a six-bar trend count. A color change alone does not specify a trade. Separate the current run, an established direction and the pattern you intend to test.

Five positive bars, then one negative bar: no six-bar up run.

The current bar must participate in the count. Testing only CCI[1] through CCI[5] can color a negative sixth bar as upward. The example below makes that off-by-one error visible.

Inspect the Pine Script and audit fields

Three layers that need separate definitions

The main line supplies the trend input. Turbo has its own lookback; it is not a moving average of the main CCI. For the underlying formula and mean-deviation calculation, use the CCI formula guide.

Woodies components and what they can establish
LayerObservableBoundary
OscillatorsMain CCI and Turbo CCI on the chosen price source.A shorter period does not guarantee a fixed lead in bars.
Trend stateCount main CCI observations on each side of zero.Define whether the label means the current run or a retained direction.
Setup and executionA named pattern, its filters, an observation time and an order rule.Neither two plotted lines nor a color supplies exits or position sizing.

Schwab's documented WoodiesCCI panel includes LSMA information at zero, Chop Zone at ±100 and Sidewinder at ±200. Its Turbo line assists pattern and exit interpretation rather than defining trend. Plain horizontal levels in a script do not implement these companion studies.

References: TradingView's display description and Schwab's component documentation.

The historical system and the teaching model

The club teaching document endorsed by Ken Wood defines trend through six consecutive main-CCI bars on one side of zero and says a brief crossing does not cancel it. It describes ZLR, Trend Line Break, Tony Trade and GB100 as continuation patterns, with Famir, Vegas and Ghost among trend-changing patterns.

Its ZLR discussion requires an established trend, a move toward zero and a turn back with the trend; Chop Zone and Sidewinder provide further conditions. A generic Turbo/main crossover therefore cannot stand in for the full setup. See the archived club document, pages 13 to 19. The copy is hosted by a third-party archive, not the current club website.

The example here deliberately exposes two independent fields. Histogram color describes the current uninterrupted run. The Data Window's established direction remembers the last side that reached six. This is a specified teaching model, not a claim of exact parity with every platform or historical edition.

  • A sign change clears the old counter and starts the opposite counter at one.
  • An exact zero clears both counters, retains established direction and has a zero-height histogram bar.
  • An unavailable main value or zero mean deviation clears both counters and established direction. A new valid observation starts a fresh run.
  • No session or day reset is applied. A session-reset version would be a different rule set.

The equality and missing-value policies above are our implementation choices. They resolve cases that the cited prose does not completely specify. Keep them in any comparison or backtest specification.

Recalculate a run without market data

These are illustrative main-CCI observations, not price quotes or trading results. Start both counters and established direction at zero. For each completed bar, apply the reset rules, increment the eligible counter, then update direction if a count reaches six.

TradingView describes gray for the first four bars, yellow for the fifth, and green or red from the sixth. This table applies that palette to the current run; the stored direction is shown separately.

Teaching model with current bar counted, zero reset and retained direction
BarMain CCIPositive / negative runHistogramEstablished direction
1+121 / 0Gray0
2+242 / 0Gray0
3+383 / 0Gray0
4+474 / 0Gray0
5+655 / 0Yellow0
6+1106 / 0Green+1
7-80 / 1Gray+1
8+351 / 0Gray+1
900 / 0Zero-height / gray+1
10-100 / 1Gray+1
11-300 / 2Gray+1
12-550 / 3Gray+1
13-800 / 4Gray+1
14-1050 / 5Yellow+1
15-1300 / 6Red-1

Bar 7 breaks the positive run but leaves direction at +1. Bar 9 breaks both runs without choosing a new side. Only bar 15 supplies the sixth consecutive negative observation and changes direction to -1. If bar 6 had instead been -8, direction would still be zero: five earlier positive values are insufficient.

A flat source window has zero mean deviation. In that case the script hides the invalid CCI and clears state; it does not manufacture a directional signal from division by zero. After an actual missing source value, its counters restart, although the built-in CCI calculation may still use available earlier observations.

Pine Script with inspectable counts

Paste this indicator into TradingView's Pine Editor, save it and add it to the chart. Open the Data Window to inspect Positive run, Negative run and Established direction. The script shows only completed bars, so the forming bar intentionally remains blank.

Pine Script v6 · Teaching indicator
//@version=6
indicator("Woodies CCI: teaching count model", overlay=false, precision=2)

source = input.source(hlc3, "Source")
mainLength = input.int(14, "Main CCI length", minval=2)
turboLength = input.int(6, "Turbo CCI length", minval=2)

mainRaw = ta.cci(source, mainLength)
turboRaw = ta.cci(source, turboLength)
mainDev = ta.dev(source, mainLength)
turboDev = ta.dev(source, turboLength)
mainValid = not na(source) and not na(mainRaw) and not na(mainDev) and mainDev > 0
mainCCI = mainValid ? mainRaw : na
turboCCI = not na(source) and not na(turboRaw) and not na(turboDev) and turboDev > 0 ? turboRaw : na

// Count the CURRENT closed bar. A zero breaks both strict-sign runs.
var int positiveRun = 0
var int negativeRun = 0
var int establishedTrend = 0
if barstate.isconfirmed
    if not mainValid
        positiveRun := 0
        negativeRun := 0
        establishedTrend := 0
    else
        positiveRun := mainCCI > 0 ? positiveRun + 1 : 0
        negativeRun := mainCCI < 0 ? negativeRun + 1 : 0
        if positiveRun >= 6
            establishedTrend := 1
        else if negativeRun >= 6
            establishedTrend := -1
        // Otherwise retain the last established direction, including at zero.

runLength = math.max(positiveRun, negativeRun)
histColor = runLength == 5 ? color.yellow : runLength >= 6 ? (positiveRun >= 6 ? color.green : color.red) : color.gray
closedMain = barstate.isconfirmed ? mainCCI : na
closedTurbo = barstate.isconfirmed ? turboCCI : na
plot(closedMain, "Current run histogram", style=plot.style_histogram, color=histColor, linewidth=3)
plot(closedMain, "Main CCI", color=color.blue, linewidth=2, style=plot.style_linebr)
plot(closedTurbo, "Turbo CCI", color=color.orange, style=plot.style_linebr)
hline(0, "Zero", color=color.gray)
hline(100, "+100", color=color.gray, linestyle=hline.style_dotted)
hline(-100, "-100", color=color.gray, linestyle=hline.style_dotted)
hline(200, "+200", color=color.gray, linestyle=hline.style_dotted)
hline(-200, "-200", color=color.gray, linestyle=hline.style_dotted)
plot(barstate.isconfirmed ? positiveRun : na, "Positive run", display=display.data_window)
plot(barstate.isconfirmed ? negativeRun : na, "Negative run", display=display.data_window)
plot(barstate.isconfirmed ? establishedTrend : na, "Established direction: +1 / 0 / -1", display=display.data_window)
Inputs and audit outputs of the teaching script
Setting or outputDefinition in this script
SourceHLC3 by default. Match this before comparing values with a close-based script.
Main / Turbo length14 / 6; each must be at least 2. To preserve the intended faster/slower distinction, keep Turbo shorter than main.
Blue / orange linesMain CCI / Turbo CCI. Line colors are independent of the histogram palette.
Established direction+1 = last established up; -1 = last established down; 0 = no established state since initialization or invalid data.
Zero and ±100 / ±200Reference levels only. They contain no LSMA, Chop Zone or Sidewinder calculations.

All state updates require barstate.isconfirmed. TradingView documents that flag as true on historical bars and on the closing update of a live bar. This avoids counting several intrabar updates as several bars; it also delays observation until the close. The script makes no higher-timeframe requests.

Use the same symbol, session, timeframe, source and available history for comparisons. A stored direction before the first visible bar can depend on earlier loaded bars. Matching a screenshot's colors alone cannot establish that two implementations have identical state.

Turn a named setup into an observable test

The following long pullback rule is a teaching specification inspired by ZLR. It is not the complete historical ZLR: it omits the companion filters and adopts its own thresholds. The plotted script does not detect it.

  1. Require stored direction +1. Since that direction was established, require at least one completed main CCI value at or above +100.
  2. Let the previous completed CCI be a pullback candidate between 0 and +50, inclusive, and no higher than the bar before it.
  3. On the current completed bar, require CCI to rise by at least 20 points from that candidate, finish above zero and finish at or below +120.
  4. Observe the condition at this bar's close. A hypothetical next-bar order still needs a sizing rule, fill model, stop and exit specification before it is a testable trading strategy.

For an already established up direction that has reached +100, the sequence +90, +35, +58 qualifies on the +58 bar: the candidate is inside 0 to +50 and the turn is +23. Replacing +58 with +49 fails the 20-point threshold. Replacing +35 with -8 fails this teaching rule even though the historical approach discusses pullbacks through zero.

For a Trend Line Break implementation, first specify how CCI pivots become confirmed and freeze the anchor points before testing a break. For Tony Trade, GB100, Famir, Vegas or Ghost, supply the chosen source edition and a separate condition list. A pattern name alone leaves developers free to make incompatible decisions about pivots, thresholds and timing.

A six-bar up state can be followed immediately by falling prices. Near zero, alternating signs keep resetting the current run while the retained direction becomes stale. Neither the count nor the pullback example includes execution costs or a maximum loss. No win rate or profitable setting is established here.

Give Pineify a rule it can implement

The Pine Script AI Coding Agent can help write and revise custom indicators from your specification. Attach the reference edition and request a syntax check explicitly. Review the resulting conditions against the table before adding orders or evaluating a strategy.

Create a Pine v6 indicator with HLC3, main CCI 14 and Turbo 6. Count the current completed bar. Reset strict-sign counters at zero; retain direction until six opposite bars. Reset all state on invalid main data. Show counts and direction in the Data Window. Add my separately defined pullback marker only after bar close. Explain every deviation from the source and use tools to check syntax.

A successful compiler check verifies syntax, not exact historical fidelity, the quality of a setup or future returns. Compare the counts on individual bars, then define execution and trading costs if you convert the indicator into a strategy.

Specify a Woodies CCI script

Woodies CCI questions

Sources and scope

Sources checked October 17, 2026. Platform descriptions and the archived club document describe different levels of the system; the code makes its own equality, invalid-data and observation-time policies explicit.

Educational information, not investment advice. Trading involves risk of loss. The examples are synthetic rule checks, not market forecasts or backtest results.

Continue with the CCI formula and worked calculation, TRIX zero-crossing comparison, or the TradingView indicators category.