Chart patterns

Rectangle Chart Pattern: Range Breakouts on Gold

A rectangle is four swings that bounce between a flat ceiling and a flat floor. Pravex draws it once a candle closes outside the box, up or down, and puts a target one box height beyond the line it broke.

Loading the live chart.

Close
–

Open the gold chart

What it shows

Two horizontal lines (the ceiling and the floor) running from the first swing to the breakout candle, a light fill between them, a "Rectangle" label above the box, and a dotted target line ending in a Target label.

How Pravex works it out

  1. The scan looks back 600 candles at most. It first marks turning points: a candle whose high is strictly higher than the previous 5 highs and at least as high as the next 5 is a swing high, and lows work the other way round. Because 5 later candles are needed, every turning point is 5 candles old before it can be used. Two turning points of the same kind in a row are merged into the more extreme of them.
  2. Take four alternating swings in a row, two highs and two lows (it can start on either). The ceiling is the average of the two highs, the floor the average of the two lows, and the height is the ceiling minus the floor.
  3. Every swing must sit within the Edge tolerance share of the height from its own line, and no close inside the pattern may go beyond a line by more than that same allowance.
  4. Breakout: the first candle after the fourth swing that closes above the ceiling or below the floor. Target: the line that broke, plus the height for an upside break or minus it for a downside break. Failure level: the opposite line; a low under the floor after an upside break (or a high over the ceiling after a downside break) marks it Failed.
  5. From the breakout on, each later candle is checked: touching the target first makes the status Reached, crossing the failure level first makes it Failed, a candle that does both at once makes it Indefinable, and until then it stays Awaiting.

Settings

SettingDefaultWhat changing it does
Which patterns to keepAllDecides which patterns are drawn. With All nothing is hidden. Awaiting and Reached removes Failed and Indefinable patterns, Only Awaiting also removes Reached ones, and Last Awaiting narrows it to the newest pattern that is still Awaiting.
Where targets are drawnOnly AwaitingControls the target lines only. Pick All, Only Awaiting, Awaiting and Reached, or None; the pattern lines and fill stay whatever you pick here.
Edge tolerance15How far each swing, and each close, may stray from the flat ceiling or floor, as a percent of the box height. Raise it to accept boxes with ragged edges; at 0 only perfectly flat lines pass.
Show unconfirmed patternsoffWhen off, only broken-out patterns are drawn. When on, Pravex also draws shapes still waiting for their breakout, the last leg dotted and a provisional target in place. That final point is not a confirmed swing but the running high or low, so it shifts as new candles print.

How traders read it

A rectangle is a balance between buyers and sellers with the verdict postponed; the first close outside it decides the side. The box height gives the target.

A toy example with invented prices: the ceiling is 110 and the floor 100. A candle closes at 111: the target is 110 plus 10, which is 120. A close under 100 would aim at 90 instead.

When it misleads

The rectangle has no direction until it breaks, so the first close outside can be a false start; the next candles may return inside, and the status will show Failed only when price crosses the opposite line. Ranges with ragged edges fail the tolerance, and raising Edge tolerance to catch them also lets in boxes that are not really flat. Confirmed swings are the only input, but the drawing is not frozen: a more extreme swing of the same kind arriving later replaces the old one, which can reshape or remove the pattern, and a close outside on the forming candle can still slip back before it finishes.

Questions and answers

Does a rectangle show a bullish or a bearish pattern?

Neither until it breaks. Pravex draws it after the first close above the ceiling (target above) or below the floor (target below). With unconfirmed patterns shown, an unbroken box shows both targets.

How flat do the lines have to be?

Each swing may stray from its line by the Edge tolerance share of the box height, 15 by default. The lines themselves are drawn perfectly horizontal.

How many touches does a rectangle need?

Four swings: two on the ceiling and two on the floor. They alternate, and the box may start on either.

What are the best rectangle settings?

The defaults are a sound start. Loosen the tolerances if you see too few shapes, tighten them if you see sloppy ones. Raising a tolerance finds more patterns of lower quality; there is no setting that makes a pattern more likely to work.

Related: Triangle Chart Pattern, Bullish Flag Chart Pattern, Double Top Chart Pattern, All Chart Patterns, every indicator.

Not financial advice. Read our disclaimer.

Pro charts. Zero paywalls.

Charts for gold, oil, US indices and crypto, with every tool free to use.

Open the chart

No card, no trial, no upgrade pop-ups.