Educational Reference

The Inside Bar Is Not a Pattern, It Is a Measurement

An inside bar is a bar whose entire range sits within the previous bar's range. Filed as a candlestick pattern it is thin material: two bars, no thresholds, no story. Read as what it actually is, a discrete measurement of range contraction, it becomes the doorway to one of the few effects in technical analysis with real statistical support. That effect is about size, not direction, and the distinction between those two is the entire content of this page. It is not described here. It is coded, detected across 750,000 generated daily bars, and measured.

The finding, stated first. Direction and size are separate questions and the inside bar answers only one of them. Across 37,112 detected breaks the directional edge over a matched base rate was 0.007 percentage points with a standard error of 0.024, which is 0.31 standard errors from zero, on a tape where the same machinery detected a deliberately inserted effect at 5.68 standard errors. The size question is a different story: a contraction ratio explains 9.13 percent of the variation in the subsequent range and 0.00024 percent of the variation in its direction. The binary inside bar flag explains 0.029 percent of the subsequent range, roughly one 315th of what the continuous measure it stands in for explains. All results on this page are illustrative and simulated.

What an inside bar is, and what it is not

The definition is unusually clean. A bar is inside if its high is at or below the previous bar's high and its low is at or above the previous bar's low. Nothing else. No parameters, no tolerances, no argument about how many bars back to look. Among the objects technical analysis asks you to recognise, this is close to unique: two people running the same rule on the same data will produce the same list.

That cleanliness comes at a price, and the price is that the definition contains no direction. It does not care whether either bar closed up or down. It does not care where the closes sit inside the ranges. It records one fact, which is that the second bar covered less ground than the first and stayed within its boundaries. Every directional reading ever attached to an inside bar has been attached from outside the definition, by someone who wanted the shape to say more than it says.

It is worth being precise about what the inside bar is not, because it has a two bar cousin that is constantly confused with it. A harami compares the two bodies, so the second body sits inside the first, and it is read directionally as a pause in a prevailing move. The bodies are the open and the close; the wicks are ignored. An inside bar compares the two full ranges, wicks included, and has no directional reading. The two overlap on some bars and diverge on many, and they are answering different questions. The harami, together with the engulfing and piercing structures it belongs beside, is treated at length in the deep dive on the engulfing pattern, which sets out the body based grammar and the context those shapes depend on. This page deliberately leaves that grammar alone. It is not about what the two bars are saying about buyers and sellers. It is about the number the second bar produced.

Nor is the inside bar rare, which is the other thing worth establishing before any claim is made about it. On the generated tape used here it appeared on 18.19 percent of all bars, 136,388 occurrences in 750,000, which is about one bar in every 5.5 and roughly 45.5 per instrument per year. A pattern that fires on nearly a fifth of all bars is not a discovery. It is a common state of the tape, and treating a common state as a signal is the failure mode this page exists to make visible.

Where the bar sits in the wider vocabulary of candlestick reading, and how the four prices of a session become a shape at all, is the subject of the guide to reading candlestick charts. The work here goes underneath that vocabulary rather than adding to it.

Two definitions of the same thing, one of them thrown away

Here is the observation that reframes the object. If an inside bar is interesting because the range contracted, then the interesting quantity is the contraction, and the contraction is a number rather than a yes or no. A bar's range can be compared with the recent average range directly, which gives a value for every bar on the chart, not a flag for one bar in five. Call that the contraction ratio: this bar's range divided by the mean range of the previous 20 bars. Below one is a contraction, above one is an expansion, and the further from one the more extreme.

The two definitions are related but they are not the same, and the relationship is lossy in a specific and measurable way. An inside bar is a bar that is smaller than the one bar immediately before it and also positioned within it. That is a comparison against a sample of one, plus a containment condition that has nothing to do with size. The contraction ratio is a comparison against a sample of twenty, and it ignores position entirely. Both are trying to capture the same underlying thing. Only one of them is measuring it.

The two definitions, written out in full. The binary one needs no thresholds, which is its only real advantage. Illustrative simulated data throughout.
ClauseThe binary flagThe continuous ratio
The ruleHigh at or below the previous high and low at or above the previous lowThis bar's range divided by the mean range of the previous 20 bars
What it compares againstExactly one prior bar, whichever bar that happened to beTwenty prior bars, so one unusual neighbour cannot dominate
Thresholds requiredNone. This is its genuine advantage and the reason it survivesOne, the lookback length. Moving it changes the values but not their ordering
OutputTwo states. Yes or noA number. The middle eight tenths of bars span 7.8 times from end to end
Position sensitivityYes. A bar can be small and still fail, because containment is requiredNo. Only size is measured, which is the thing being asked about
How often it fires136,388 times, 18.19 percent of bars, about 45.5 per instrument yearEvery bar, once the lookback is filled
Near misses35,184 bars, 4.69 percent, missed by under 0.05 of an average true range on one edgeNo such category exists. A near miss is simply a slightly different number
Median value when flaggedFlagged bars had a median contraction ratio of 0.553The median across all bars was 0.904

The near miss row deserves a moment. For every four inside bars on this tape there is roughly one bar that failed the test by less than a twentieth of an average true range on a single edge. Those bars contracted just as hard; they poked a fraction above the previous high and were therefore filed as nothing at all. A boundary that reclassifies a bar on the strength of a movement smaller than a normal tick is not describing a real division in the data. It is a convention, and conventions that produce hard edges out of smooth quantities are exactly what a continuous measurement replaces. The same problem in a more elaborate form runs through the three named triangles, where an undocumented tolerance decides which of three labels a converging range receives.

Two definitions of the same thing, on the same bars Sixty-four consecutive generated daily bars. Above, the binary flag. Below, the continuous quantity it stands in for. 2 in a row Inside bar: high and low both inside the previous bar Near miss: one edge over by less than 0.05 ATR Contraction ratio: this bar's range divided by the mean range of the previous 20 bars 0.5 1.0 1.5 2.0 2.5 Same 64 bars, read left to right Above the dashed line is an expansion, below it a contraction The ringed point is a flagged inside bar whose own range is 2.74 times its 20 bar average. 14.1 percent of inside bars sit above the line like this.
Sixty-four consecutive generated daily bars. Solid green triangles mark bars whose whole range sits inside the previous bar's range; hollow gold triangles mark bars that missed by less than 0.05 of an average true range on one edge. The strip beneath is the continuous contraction ratio for every bar. The flag can only say yes or no; the strip underneath it has a value at every single bar. Illustrative simulated data.

The figure makes the point that a table cannot. The flag along the top produces a scatter of green and gold markers, some bars in and some out, with no gradation between them. The strip along the bottom is the same sixty four bars measured properly, and it is continuous. Note the bar picked out in gold: it is a genuine inside bar whose range is nonetheless larger than its own twenty bar average. It is flagged as a contraction and it is an expansion. On the full tape 14.1 percent of inside bars are in that position, which is one in seven.

Before testing anything, check the effect is in the tape

The magnitude question rests entirely on volatility clustering, the observed tendency of calm to follow calm and turbulence to follow turbulence. It is one of the small number of empirical regularities in market data that has survived decades of scrutiny, and it is the reason a contraction could carry any information at all. It is also the reason that a simulation which does not contain clustering cannot be used to test the question, and a page that tests a magnitude claim on a tape without clustering has measured nothing.

So the generator was built to contain it and then checked. Log volatility follows a first order autoregression with a persistence of 0.94, which produces quiet stretches and loud stretches that arise from the process rather than being placed by hand. Drift switches between three symmetric, equally likely states, so the unconditional drift of the tape is exactly zero and nothing in the construction makes direction predictable. The wider machinery of how volatility states are identified and used, including average true range and the index volatility measures, belongs to the guide on detecting market regimes; here only the one property is needed.

Confirming it is a two line measurement. The autocorrelation of the log bar range, taken as a fraction of price so the drifting price level cannot masquerade as persistence, was 0.438 at one lag, 0.340 at five lags and still 0.135 at twenty. Quiet genuinely follows quiet on this tape. A third tape was then built by taking the first and randomly permuting the volatility path within each instrument, which leaves the distribution of bar sizes exactly as it was and destroys the ordering. On that tape the same autocorrelation is 0.000 at every lag tested. Two tapes, identical in every respect that a histogram of bar sizes could detect, and one of them has the effect while the other does not. That pair is what makes the rest of the page checkable.

The experiment: two questions, asked separately

Almost every published claim about an inside bar conflates two things. The first is whether the bar tells you where price is going. The second is whether it tells you how far price is going to travel, in either direction. These are logically independent. A measurement can answer one and be silent on the other, and if it answers only the second, then every entry rule built on it is resting on the wrong half.

Separating them requires only that they be measured with the same regressor on the same bars in the same window. Every bar on the tape was sorted into ten bins by its contraction ratio. For each bin two things were then measured over the following ten bars: the signed move, expressed in units of local volatility so bins are comparable, and the realised range, expressed in the same units. One question is about sign and the other is about size, and they are being put to the identical data.

The same measurement, put to two different questions Every one of 731,000 generated bars sorted into ten bins by how contracted it was. Illustrative simulated data. DOES IT PREDICT WHICH WAY? Subsequent 10 bar move, in units of local volatility −0.04 +0.04 0 Flat. R² = 0.02 of one percent. Ninety-five percent whiskers straddle zero in every bin. DOES IT PREDICT HOW BIG? Subsequent 10 bar range, in units of local volatility 0.9 1.1 1.3 1.5 A clean gradient, 1.81 times from end to end. R² = 9.13 percent. 0.29 0.46 0.59 0.71 0.84 0.98 1.14 1.34 1.64 2.26 ratio Tape with volatility clustering Control tape, clustering destroyed most contracted on the left, most expanded on the right
Every generated bar sorted into ten bins by its contraction ratio, most contracted on the left. The upper panel asks whether the bin predicts the direction of the next ten bars and the lower panel asks whether it predicts their size. Same bars, same measurement, same window: one panel is flat and the other is a clean gradient. The gold line is the control tape with the volatility clustering destroyed. Illustrative simulated data.

The upper panel is flat. The signed move is indistinguishable from zero in every bin, the ninety five percent whiskers straddle zero throughout, and there is no gradient from the most contracted bin to the most expanded. Expressed as variance explained, the contraction ratio accounts for 0.00024 percent of the variation in the subsequent direction. That is not a small effect. It is the absence of one.

The lower panel is a clean staircase. Subsequent range rises from 0.881 in the most contracted bin to 1.597 in the most expanded, a spread of 1.81 times, and the ordering never breaks. The contraction ratio accounts for 9.13 percent of the variation in the subsequent range. Set the two side by side and the ratio between them is roughly 38,173 to one. The same number, measured the same way on the same bars, is informative about how big and silent about which way.

The dashed gold line is the control tape with the clustering removed. It runs flat at 1.023 to 1.032 across all ten bins, and the same regression on that tape explains 0.0105 percent. Whatever the staircase in the lower panel is, it is the clustering, because when the clustering is taken out the staircase goes with it and nothing else about the tape changed.

One further measurement completes the picture. If the contraction ratio predicts the size of the subsequent range, it should also predict the size of the subsequent move regardless of sign, and it does: it explains 2.51 percent of the variation in the absolute move. The information is real, it is about magnitude, and it survives being asked in more than one way.

Direction, measured against a base rate that had to be repaired

The bin analysis treats every bar. The narrower question, the one an inside bar is usually put to, is what happens after the bar breaks out of its range. That needs a break rule, an entry convention and a base rate, and the base rate is where this test almost went wrong.

The rule used here is deliberately plain. Watch the 5 bars after the inside bar. The first close beyond the bar's high by 0.05 of an average true range is an upward break and the first close beyond its low by the same margin is a downward break. Enter at the next bar's open, never on the bar that generated the signal, and hold for 10 bars. Overlapping detections are discarded so no two measured outcomes share a window. That produced 38,629 independent events of which 37,112 broke, at an average of 1.73 bars after the bar completed, and 49.68 percent of those breaks were upward with a standard error of 0.26. A coin toss, which is what a range with no directional content should produce.

The base rate compares each break against random entries on the same instrument, matched for direction and holding period. The obvious way to draw them, and the way inherited from the sibling analyses in this series, is from a window either side of the event. That is wrong, and the reason is worth stating because it generalises to every pattern study anyone reads. A window centred on the event contains the stretch of tape that produced the event. For an inside bar that stretch is a quiet one almost by definition, so a symmetric control quietly matches on the very volatility state the measurement is trying to detect, and the comparison is no longer between a pattern and a random moment but between a pattern and a moment chosen to resemble it.

The way to find out how badly this bites is to slide the window and watch. Drawing controls only from bars before the event gives a direction statistic of -1.59 standard errors. A symmetric window of 250 bars gives -0.35. Widened to a thousand bars it gives 0.59. Restricted to bars strictly after the event it gives 0.46, and widened forward it gives 1.08. The point estimate walks steadily across the ladder, which is the signature of contamination, and the only reason it does not change the verdict on this page is that every rung of the ladder is a null. That is luck rather than method, and the correct control is the forward only one, which is what every direction figure quoted here uses.

A forward only control is worthless if it is simply blind, so it was calibrated. On the tape with a real directional effect deliberately inserted, the symmetric control detects the effect at 4.67 standard errors and the forward only control detects it at 5.63. Forward only is not the weaker instrument. On this tape it is the sharper one, and it earns the right to be the default.

The direction test, and the control that makes its null credible Inside bar breaks against random entries matched for instrument, direction and holding period. Illustrative simulated data. TAPE ONE: nothing in the generator makes direction predictable −10% −5% 5% 10% 0 0.00 0.05 0.10 0.15 0.20 0.25 THE SAME TWO MEANS, MAGNIFIED ABOUT FORTY TIMES matched random the whisker covers the base rate Event mean +0.03%, matched base rate +0.02%. Difference +0.007 points, +0.31 standard errors from zero. TAPE TWO: one real directional effect inserted, keyed to volatility and never to inside bars −10% −5% 5% 10% 0 0.00 0.05 0.10 0.15 0.20 0.25 THE SAME TWO MEANS, MAGNIFIED ABOUT FORTY TIMES matched random the whisker clears the base rate Event mean +0.17% against +0.03%. Difference +0.139 points, +5.68 standard errors. The detector finds what is there. Matched random entries Inside bar breaks, tape one Inside bar breaks, tape two
Both arms of the direction test on two tapes. In the upper panel nothing in the generator makes direction predictable and the two distributions sit on top of each other. In the lower panel a real directional effect was inserted, keyed to a volatility squeeze and never to inside bars, and the detector finds it. The lower panel is the control that makes the upper panel worth believing. Illustrative simulated data.

With that settled, the answer is a null and it is a clean one. Inside bar breaks returned 0.032 percent on average over the holding period against 0.024 percent for matched random entries, a difference of 0.007 percentage points with a standard error of 0.024, or 0.31 standard errors from zero, with a ninety five percent interval running from 0.039 points below to 0.054 above. 50.1 percent of pattern outcomes were positive against 50.2 percent of controls. The two distributions in the upper panel of the figure are not merely close in the middle; they lie on top of each other in the tails as well, which matters more, because a claim that a pattern occasionally produces something large has to survive the observation that random entries produce the same large things at the same rate.

The lower panel is why any of this is believable. The identical detector, base rate and thresholds were run over a second tape built the same way with one real effect added: after the recent trading range had been unusually narrow, a close outside that range was followed by extra drift in that direction. The effect was written in terms of a price channel and never in terms of inside bars, so the detector had to find it unaided. It did, at 0.139 percentage points and 5.68 standard errors, with 0.168 percent against 0.029 percent. The machinery can see an effect. Where there was nothing to see, it saw nothing.

Magnitude, and the two ways of getting it wrong

The size question has an answer, but arriving at it took three attempts, and the two failures are more instructive than the success because they are the two answers that circulate.

The familiar claim is that a coiled bar releases energy, and the way it is usually evidenced is by comparing what follows against the size of the inside bar itself. Measured that way the effect is enormous: the subsequent ten bar range averaged 1.775 times the inside bar's own range against 1.150 times for matched control bars, a ratio of 1.543 at 139 standard errors. It looks like the strongest result on the page. Then run the identical measurement on the tape with the clustering destroyed, where by construction there is nothing to find, and the same ratio comes back at 1.707, an even larger apparent effect than on the tape that actually contains the phenomenon. The measurement is not detecting coiling. It is detecting the fact that an unusually small number tends to be followed by a larger one, which is arithmetic and would be true of any small number anywhere.

The second attempt compares the subsequent range against a trailing average true range, which sounds obviously right. It gives 0.9720, a 12.91 standard error effect, and the sign is now the opposite of the folklore: quiet is followed by quiet, not by noise. But run it on the control tape and it gives 0.9761 at 18.13 standard errors, again where there is nothing. The reason is a shared denominator. An inside bar guarantees that the bar immediately before it was large, and a trailing average that includes that bar is inflated by it, so the ratio is pushed down by the definition rather than by the market.

The third attempt fixes the overlap. The reference volatility is taken from a window ending 21 bars before the event, so it can contain neither the inside bar nor the bar containing it, and the base rate is drawn forward only. On the tape with clustering this gives a subsequent range 0.74 percent below its matched base rate, 2.55 standard errors, with a ninety five percent interval from 0.17 to 1.30 percent. On the control tape it gives 1.0018, which is 1.34 standard errors, in other words nothing. A measurement that reports nothing where there is nothing and something where there is something is the one to keep.

Confirm the effect exists in the tape, then check the measuring instrument Left: the clustering the magnitude test depends on. Right: three ways to measure it, two of which fail. Illustrative simulated data. AUTOCORRELATION OF LOG BAR RANGE 0.1 0.2 0.3 0.4 0 1 2 3 5 10 20 lag control tape: 0.000 at every lag Quiet follows quiet here. Lag one: 0.438 vs 0.000. THE SAME QUESTION, THREE MEASUREMENTS Against the bar's own range fails the control 1.543 on the clustered tape, 1.707 on the control tape, the folklore reading +70.7 points Against an overlapping baseline fails the control 0.972 on the clustered tape, 0.976 on the control tape, a shared denominator −2.4 points Against a disjoint baseline survives the control 0.993 on the clustered tape, 1.002 on the control tape, the one that holds +0.2 points +0 +20 +40 +60 control error Bar length is how far each measurement reads from no effect on a tape that contains nothing to find. Autocorrelation, clustered tape Autocorrelation and control error, shuffled tape
Left: the autocorrelation of the log bar range, which is the volatility clustering the whole magnitude question depends on, present on the working tape and absent on the shuffled control. Right: three ways of measuring the same effect, each shown on both tapes. Two of the three report an effect on the tape where there is nothing to find, which is what disqualifies them. Illustrative simulated data.

One more control is worth applying, and it is the hardest. The trailing volatility level is something a reader can measure directly without noticing any bars at all, so the honest question is whether the inside bar adds anything to it. Each event was therefore matched to control bars chosen for having the same trailing volatility, to within an average of 6.9 percent. The effect survives: the subsequent range was 1.24 percent below its volatility matched base rate at 5.38 standard errors, and on the control tape the same test returns 1.0018 at 1.63 standard errors. So an inside bar does tell you something the twenty bar average true range has not already told you. The amount it tells you is about one percent of the subsequent range.

The two questions side by side, with counts and standard errors, on all three tapes. Every figure illustrative and simulated, not a track record and not a forecast.
Question and tapeEventsMeasuredBase rateDifference and standard errorVerdict
Direction, clustered tape37,1120.032%0.024%0.007 points, se 0.024, t 0.31Null
Direction, known effect inserted37,1120.168%0.029%0.139 points, se 0.024, t 5.68Detected
Size, own range as reference38,6291.775 times own range1.150 timesratio 1.543, t 139Fails its control
Size, overlapping reference38,629ratio 0.9720forward only drawst 12.91 below zeroFails its control
Size, disjoint reference38,6290.74% belowforward only draws0.17 to 1.30%, t 2.55Holds
Size, volatility matched control38,6291.24% belowmatched to 6.9%t 5.38Holds
Size, clustering destroyed38,629ratio 1.0018forward only drawst 1.34Correctly reports nothing

Read the table as a whole and the shape of the result is plain. Direction is a null that the same machinery could have detected had it been there. Size is real but modest, and only after the measurement itself has been repaired twice. The two attempts that failed both produced confident, large numbers, which is the ordinary way this goes wrong.

The flag is a lossy copy of the ratio

Everything above establishes that a range contraction predicts the size of what follows. It does not establish that an inside bar is a good way to notice one. That is a separate question and it can be settled by putting both measurements into the same regression on all 731,000 bars and reading off how much each explains.

Alone, the binary flag explains 0.029 percent of the variation in the subsequent range. Alone, the continuous ratio explains 9.13 percent, about 315 times as much. Put both in together and the pair explain 10.20 percent, so the flag adds 1.06 percentage points to what the ratio already knew, while the ratio adds 10.17 points to what the flag knew. A reader who has the ratio gains almost nothing from also being told which bars were inside bars. A reader who has only the flag is missing nearly all of the available information.

What the flag can say, and what the ratio can say The binary flag has exactly two settings. The quantity it stands in for has a range. Illustrative simulated data. 0.9 1.1 1.3 1.5 51 34 26 21 16 13 9 7 4 2 flagged % everything the flag can say: 1.13 to 1.16 SUBSEQUENT 10 BAR RANGE, BY CONTRACTION BIN The bars span 0.88 to 1.60. The flag can only ever say 1.13 or 1.16. Bottom row: the share of each bin that the binary flag actually catches. VARIANCE EXPLAINED Contraction ratio 9.134 percent Binary flag 0.029 percent The ratio explains 315 times more of the subsequent range than the flag does. AND THE FLAG CHANGES SIGN WHEN THE RATIO IS PUT BESIDE IT On its own the flag says −0.0252. Holding the contraction ratio fixed it says +0.1647, because an inside bar also means the bar before it was large.
The subsequent ten bar range by contraction bin, with the two levels the binary flag is capable of reporting drawn across it. The bottom row of the left panel is the share of each bin that the flag actually catches. The flag fires on half the most contracted bin and on a small share of every other bin, so it neither isolates contraction nor measures it. Illustrative simulated data.

The figure shows why in a way the coefficients do not. The bars are the subsequent range by contraction bin, spanning 0.881 to 1.597. Across them run the only two values the flag is capable of reporting: 1.130 when it fires and 1.159 when it does not, a gap of a couple of percent laid over a quantity that varies by 1.81 times. The instrument has two settings and the thing it is pointed at has a range.

The overlap statistics are worse than the variance figures suggest. Only 27.8 percent of inside bars fall in the most contracted tenth of bars, so the great majority of them are not extreme contractions at all. Conversely 50.6 percent of the most contracted tenth are inside bars, meaning about half of the strongest contractions on the chart never get flagged. And 14.1 percent of inside bars have a contraction ratio above one, which is to say their range is larger than their own recent average. The flag is not a coarse version of the contraction. It is a partially overlapping different thing.

There is a final detail that makes the confounding concrete, and it is the sharpest result in this section. On its own the flag's coefficient on the subsequent range is -0.0252, with a standard error of 0.0017: flagged bars are followed by smaller ranges, which reads like the clustering effect. Hold the contraction ratio fixed and the same coefficient becomes 0.1647, with a standard error of 0.0018. It changes sign. Among bars that contracted by the same amount, the inside bars are followed by larger ranges, not smaller ones.

That reversal has a mechanism and the mechanism is instructive. An inside bar is two facts welded into one label. The first is that this bar was small. The second, which nobody states, is that the previous bar was big enough to contain it. The contraction ratio isolates the first. Once it is held fixed, the only thing the flag still carries is the second, and a large preceding bar means the market is currently more active than a longer average would suggest, which predicts a larger subsequent range. The flag is not simply a blunt version of the contraction measure. It is a blend of the contraction measure and its opposite, and the blend is invisible until the two are separated.

Two in a row, and three

The natural response to a weak signal is to demand more of it, and the standard escalation here is to require consecutive inside bars. It is a fair thing to test, and the test has a clean shape: the effect does strengthen, and the population collapses much faster than the effect grows.

Two inside bars, then three: the population collapses faster than the effect grows Same tape, same measurements, restricted to runs of consecutive inside bars. Illustrative simulated data. HOW MANY ARE LEFT 100 1,000 10,000 38,629 1 bar 12.88 a year 8,489 2 in a row 2.83 a year 426 3 in a row 0.14 a year Log scale. Three in a row is 91 times rarer than one. WHAT HAPPENS TO EACH EFFECT SUBSEQUENT RANGE, AGAINST ITS BASE RATE no effect 0.993 0.958 0.912 DIRECTION, STANDARD ERRORS FROM ZERO +2 −2 inside this band is indistinguishable from zero +0.34 1 bar +0.05 2 in a row −0.03 3 in a row The size effect roughly doubles then doubles again. Direction never moves. Population Subsequent range against base rate Direction test statistic
Restricting the measurement to runs of consecutive inside bars. The population falls on a log scale while the size effect grows and the direction test statistic stays pinned to zero. Three in a row is about 91 times rarer than one, and buys a size effect roughly twelve times larger. Illustrative simulated data.
Consecutive inside bars. Same tape, same thresholds, same base rate, restricted to runs. Illustrative simulated results.
Run lengthMeasured eventsPer instrument yearSubsequent range below base rateVolatility matchedDirection, standard errors from zero
One inside bar38,62912.880.7%, t 2.511.2%, t 5.350.34
Two in a row8,4892.834.2%, t 6.844.8%, t 9.890.05
Three in a row4260.148.8%, t 3.418.8%, t 4.12-0.03

The size effect grows from 0.7 percent below the base rate to 4.2 and then 8.8, roughly doubling and doubling again, and it holds up under the volatility matched control at every level. So the escalation genuinely works in the direction its advocates claim. The cost is on the other side of the table. Measured independent events fall from 38,629 to 8,489 to 426, which is 91 times rarer at three, and 0.14 occurrences per instrument per year. On a single chart that is roughly one every seven years, which is not a frequency any process can be built around and not a sample size on which anyone should form a view of a particular instrument.

Direction, meanwhile, does not move at all. The test statistic reads 0.34, 0.05 and -0.03 standard errors across the three run lengths. Stacking more inside bars sharpens the size reading and does nothing whatever to the sign reading, which is the same result the bin analysis produced, arrived at from a different direction. Whatever a contraction is, more of it is still not a forecast.

What this supports, and what it does not

A simulation can establish some things and not others, and being precise about which is the difference between a study and an opinion with numbers attached.

That an inside bar carries no directional information is supported, on this data. 37,112 breaks against a matched base rate came out 0.31 standard errors from zero, on machinery that found a deliberately inserted effect at 5.68. That range contraction predicts the size of what follows is also supported: 9.13 percent of the variance of the subsequent range, and it disappears entirely when the clustering is removed from the tape and nothing else is changed.

That the binary flag is a poor instrument for the second of those is supported, at 0.029 percent against 9.13 percent, and more damningly by the fact that its coefficient changes sign once the contraction ratio is held beside it. That a contraction is followed by a bigger move is not supported. Against a reference that does not overlap the event, it is followed by a smaller range. The larger reading comes from dividing by the small bar itself, and it reproduces at full strength where no clustering exists at all.

That consecutive inside bars are a stronger signal is only partly supported. The size effect grows severalfold while the population falls by 91 times, so the total information available across a chart barely moves and may fall. That any of this is tradeable is not supported and is not claimed. A size forecast does not tell you which side to be on, and nothing here is a trade, a signal or a rule.

Two things this page explicitly does not establish are worth naming, because both would be easy to read into it. It does not show that inside bars carry no edge in Indian equities, or in any other real market: it tested generated data, not an exchange, and what it establishes is the baseline a real study would need. And it does not demonstrate that volatility clustering exists in live markets. That is a widely documented empirical regularity which this page assumes in order to build a tape containing it, and then confirms is present in the tape before relying on it. Assuming something and measuring it are different acts, and only the second one happened here.

The obvious limitation is that generated data has no earnings, no policy announcements, no index rebalancing and no order book. It cannot tell you what happens when a real range compresses ahead of a real event, and the most interesting inside bars on a real chart are probably the ones sitting in front of something scheduled. What generated data can do, and real data cannot, is provide a case where the true answer is known before the measurement runs. Two of the three ways of measuring the size effect were disqualified by exactly that, and neither would have been caught on real data, because on real data both would have produced a large number and a plausible story.

The second limitation is that this is one tape, one holding period and one break rule. The direction null was stable across every control window tried, which is reassuring, but a different holding period is a different experiment. Anyone who believes a different set of choices would produce a different answer is making a testable claim, and the way to settle it is to write the choices down as code and run them.

What to do with an inside bar instead

None of this makes a contracted range uninteresting. It relocates where the interest lives, and it is a smaller loss than it sounds.

Measure the contraction, do not classify it. If the reason a chart caught your attention is that the range has narrowed, then the narrowing is the observation and it has a value. A ratio of range to recent average range takes one line to compute, exists on every bar, and on this data carried around three hundred times more information about what follows than the flag did. The flag's only real advantage is that it requires no threshold, and that advantage is bought by discarding the measurement.

Keep the size question and the direction question in separate columns. This is the transferable habit and it applies well beyond inside bars. When you read any claim about a chart feature, ask which of the two it is asserting. A great deal of published pattern material states a size result and then quietly draws a directional conclusion from it, and the slide between the two happens in a single sentence. Volatility forecasting and return forecasting are different disciplines with different track records, and the honest position is that one of them works considerably better than the other.

Treat a size forecast as an input to risk, not to entry. If the next ten bars are likely to be quieter than usual, that is information about how wide a stop needs to be and how large a position can be for a given risk, not about whether to hold one. It also has to compete with simply reading the average true range, which is available without noticing any bars at all, and the competition here was close: the inside bar added about one percent to what the trailing volatility already said.

Distrust any statistic that has not been shown a control. Two of the three size measurements on this page produced large, confident results on a tape constructed to contain nothing. Neither was carelessly built and both are in common use. The only thing that exposed them was running them where the answer was known in advance, and that step is available to anyone willing to shuffle their own data and re-run their own test before believing it.

Count the population before you value the signal. Three inside bars in a row produced the largest effect measured here and occurred about once per instrument per seven years. An effect you cannot observe often enough to verify is not an edge, it is an anecdote with a standard error attached, and the arithmetic of how many observations a conclusion needs is not optional.

What survives all of this is a narrow and genuinely useful idea. A bar whose range sits inside the previous bar's range is a measurement, it is a crude one, and the quantity it crudely measures is real and worth watching for reasons that have nothing to do with which way price is about to go. Learning to tell those two apart, and to demand a control before accepting either, is a habit rather than a technique, and it is the method we teach.

FAQ

Frequently asked questions

An inside bar is a bar whose entire range sits within the previous bar's range: its high is at or below the previous high and its low is at or above the previous low. That is the whole definition, and unlike most chart patterns it needs no thresholds to be coded. It is a statement about range, not about the open and the close, and it carries no direction of its own. On the generated tape used on this page it occurred on 18.19 percent of bars, roughly one bar in five and about 45.5 times per instrument per year.

No, and the difference matters. A harami compares the bodies of two candles, so the second body sits inside the first body, and it is read as a directional signal about a pause in selling or buying. An inside bar compares the full ranges, wicks included, and carries no directional reading at all. The harami and its family are treated in the deep dive on the engulfing pattern. This page is about the other object: a bar whose range is contained, treated as a measurement of how far the range contracted rather than as a shape with a meaning.

Not on the tape tested here. Across 37,112 inside bar breaks measured against random entries matched for instrument, direction and holding period, the difference was 0.007 percentage points with a standard error of 0.024, which is 0.31 standard errors from zero, and the ninety-five percent interval runs from 0.039 points below to 0.054 above. The same machinery found a real effect at 5.68 standard errors on a second tape where one had been deliberately inserted, so the null is not a failure of the detector. All figures are illustrative and simulated.

It predicts a change in the size of what follows, which is a different claim from a bigger move. Against a base rate drawn only from bars after the event, the subsequent ten bar range was 0.74 percent below its matched control, not above it. Quiet tends to be followed by quiet. The familiar reading that a coiled bar releases energy comes from comparing the next ten bars against the inside bar's own small range, and that comparison produces an even larger apparent effect on a control tape built with no volatility clustering in it at all, which is how you know it is arithmetic rather than evidence.

Volatility clustering is the observed tendency for calm periods to be followed by calm periods and turbulent periods by turbulent ones. It is one of the few regularities in market data with broad statistical support, and it says nothing about direction. It matters here because an inside bar is a crude marker of a quiet period, so any real information the bar carries has to come through clustering. On the tape used here the autocorrelation of the log bar range was 0.438 at one lag and still 0.135 at twenty lags, and on the control tape with the volatility path shuffled it was 0.000 at every lag.

On this data, by a wide margin. A contraction ratio, which is simply the bar's range divided by the mean range of the previous twenty bars, explained 9.13 percent of the variation in the subsequent ten bar range across 731,000 bars. The binary inside bar flag explained 0.029 percent, about one 315th as much. The flag has two settings and the quantity it stands in for has a full range, so most of the information is discarded at the moment the bar is classified.

The size effect strengthens and the population collapses much faster. One inside bar gave a subsequent range 0.7 percent below its base rate across 38,629 measured events. Two in a row gave 4.2 percent below across 8,489. Three in a row gave 8.8 percent below across 426, which is about one occurrence per instrument every seven years. Direction stayed a null at every level, with test statistics of 0.34, 0.05 and -0.03 standard errors. Adding bars to the run buys a larger effect at a steep price in sample size.

Not on its own, and this page does not propose a trade. Knowing that the next ten bars are likely to be quieter or noisier than usual tells you nothing about whether to be long or short, which is the decision a position requires. A size forecast is an input to things like position sizing and the width of a stop, where it has to compete with measuring volatility directly, and the evidence here is that measuring it directly is the better instrument. Nothing on this page is a recommendation, a signal or a forecast.

Because a generated tape can be built with a known answer inside it and real data cannot. Three tapes were used: one where direction is unpredictable by construction but volatility clusters, one with a real directional effect inserted so the detector can be shown to work, and one with the volatility path shuffled so the clustering is destroyed while the distribution of bar sizes is unchanged. That third tape caught two of the three ways of measuring the magnitude effect reporting a result where there was nothing to report. Real data cannot do that, and it is the reason the exercise is worth running.

Method note

How the numbers on this page were produced

Every figure comes from one deterministic simulation, seeded so that it reproduces identically on each run. Three tapes were generated, each of 250 independent instruments of 3,000 daily bars, 750,000 bars in total and about 3,000 instrument years. Log volatility follows a first order autoregression with a persistence of 0.94, so quiet stretches and loud stretches arise from the process and are never inserted by hand, and drift switches between three symmetric equally likely states so the unconditional drift of every tape is zero. The first tape contains nothing that could make direction predictable. The second adds one directional effect, defined entirely in terms of a price channel and never in terms of inside bar geometry, and exists to prove the detector can find an effect when one is present. The third takes the first and randomly permutes the volatility path within each instrument, which leaves the distribution of bar sizes untouched and destroys the clustering.

Detection runs on the open, high, low and close of the generated bars. The binary flag needs no thresholds. The continuous ratio divides the bar's range by the mean range of the previous 20 bars. Breaks are taken on the close and positions open at the next bar's open, so no result uses information that was not available at the time. Outcomes are measured over 10 bars. Overlapping detections are discarded so that no two measured outcomes share a window. The base rate draws 100 control entries per event from bars strictly after the event and within 250 bars of it, on the same instrument, matched for direction and holding period; a symmetric window either side of the event was tested and rejected, for the reason set out above. The volatility reference used for the size measurement ends 21 bars before the event, so it can contain neither the inside bar nor the bar containing it. Standard errors are computed from the event arm alone, which is the conservative choice, because the control arm has many draws per event and those draws are not independent of one another.

All results are illustrative and simulated. They are not a track record, they are not a forecast, and they are not an indication of what any measurement would produce in a live account or on any Indian security or index. The purpose of the exercise is to establish which of the two questions a range contraction can answer, which is a question about the measurement rather than about any particular market.

Related

Continue reading

Next step

Find your starting stage. Everything else follows from there.

Educational reference only. No buy, sell or hold recommendations. All results shown are illustrative and simulated.