Free: indicator teardowns, a repaint checker and open-source scripts. No buy/sell signals, ever.

Taught to TradeSystems over signals.

Explainers / CM_Price-Action-Bars by ChrisMoody

CM_Price-Action-Bars by ChrisMoody, explained from the source

CM_Price-Action-Bars is an open-source TradingView indicator by ChrisMoody, written in January 2014, with about 28,000 boosts. Its header credits Chris Capre. It paints price bars that match four shapes: pin bars, shaved bars, inside bars and outside bars. This page walks through the published code in order, says what each test really is, and ends with where it fails. It does not say whether the patterns make money, and it gives no trades.

The surprise: add it to a chart and nothing happens

All four "Show" boxes are off by default. Until you tick one, the script paints nothing. And once ticked, each colour is a plain geometric test on one or two bars. Nothing in the code looks at trend, volume or what came next.

Step 1: pin bars (lime and red)

The setting says "what % the wick of candle has to be", default 66. The code does not measure a wick. For a lime pin bar it asks two things: the open and the close both sit in the top 34% of the bar's range, and the bar's low is the lowest low of the last 6 bars, itself included. A red pin bar is the mirror: open and close both in the bottom 34%, and the high is the highest of the last 6.

The test does not ask how big the bar is or whether it closed up or down. A very small bar passes as easily as a large one.

Step 2: shaved bars (aqua and fuchsia)

Aqua when the close is within 5% of the bar's range from its high. Fuchsia when it is within 5% of its low. The open is not checked.

Step 3: inside and outside bars (yellow and orange)

Yellow when the high is at or below the previous high and the low is at or above the previous low. Equal highs or lows count. Orange when the high is above the previous high and the low is below the previous low. Equal ones do not count.

Step 4: the gray option

A last box turns bars gray so the pattern colours stand out. One bar can meet more than one test: a pin bar can also be an inside bar or a shaved bar. Which colour shows then depends on the order TradingView applies bar colours. We read the tests from the code and did not watch that order on a chart.

What we checked in Python

We ported the four tests to Python and ran them on invented random-walk prices with a typical move of 1% a bar: 20 runs of 5,000 bars, each bar built from 60 smaller steps, the first 300 bars of each run left out. Shape counts depend on how a bar is built, so treat these as rough sizes.

How often each test passes on random prices. Lime pin bars 2.3% of bars, red pin bars 2.3%, aqua shaved bars 12.1%, fuchsia 11.9%, inside bars 10.1%, outside bars 9.9%. With all four boxes ticked, 42% of bars met at least one test. These prices have nothing to find.

Overlap. Of 4,238 pin bars, 1,008 (about one in four) also met a shaved, inside or outside test.

The live bar. A bar's shape changes until it closes. For every pin bar that held at the close, about four more bars passed the pin test at some point while forming and did not finish as one (16,820 against 4,238).

These figures describe the code on invented data, not any market.

Where it fails

Educational only. Not financial advice. Nothing here is a recommendation to buy or sell anything. CM_Price-Action-Bars is by ChrisMoody on TradingView; this page describes its published open-source code in our own words and is not affiliated with the author. Simulation figures come from synthetic random-walk prices and say nothing about how the script behaves on any market.

Also explained: Repaint checker, VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, What is repainting on TradingView?, Is TradingView backtesting accurate?, Chandelier Exit, WaveTrend Oscillator, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Support Resistance Channels, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue, Volume Flow Indicator by LazyBear, FVG Order Blocks by BigBeluga, CM_Williams_Vix_Fix by ChrisMoody, Bollinger + RSI Double Strategy by Chart, Ultimate Moving Average MTF by ChrisMood, Fibonacci Bollinger Bands by Rashad, Candlestick Patterns Identified by repo3, MACD + SMA 200 Strategy by ChartArt, Pine Script v5 to v6, Moving Average Cross Alert, Multi-Timefr, WaveTrend Oscillator [WT] by LazyBear, WaveTrend with Crosses [LazyBear], RSI Candles by glaz, CM RSI-2 Strategy Lower Indicator by Chr, CM Stochastic Multi-TimeFrame by ChrisMo, CM_Ultimate RSI Multi Time Frame by Chri, TonyUX EMA Scalper - Buy / Sell by tux, MACD 4C by vkno422, My Pine Script is valid. What did the va

Next steps

  • Get a script fixed. Compiles but behaves differently live, or changes after a reload? In a Pine Script Audit, an AI model reads every line and writes a report on what to fix for $49, or also fixes those problems for $149. It cannot prove a script is safe.
  • Check your own script. Paste its source into the free repaint checker. It runs in your browser and flags known patterns.
Before you trust its backtest: the Integrity Checklist, $19 one-offBack to Taught to Trade

No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.