Home › Guides › Chart Patterns

WHY BOTS FAILFREENO ACCOUNTAUTOMATED TRADE BOTSChart PatternsThe arithmetic of how bots failEDUCATION ONLY | NO SIGNALSEXAMPLE NUMBERS ARE LABELLEDAUTOMATED TRADE BOTSautomatedtradebots.com
A free page on chart patterns. Education only, with example numbers labelled.
WHY BOTS FAIL

Chart Patterns

Short answer

A chart pattern is a recognisable shape in a price chart, built from swing highs, swing lows and the lines between them. Traders give shapes names such as double top, triangle and flag.

A chart pattern is a shape that price has drawn, such as two similar highs or a narrowing triangle. A bot cannot see shapes, so every pattern has to be turned into exact rules first.

The page explains the idea in plain words, works through the arithmetic with a table, and shows how it hits grid, martingale and DCA bots, then tells you what to check before you run one.

  • A worked example with real arithmetic
  • How it hits grid, martingale and DCA bots
  • How to check for it before you run a bot
  • No advice, no signals, no profit promises

Last reviewed 28 October 2026. Education only, not advice.

Free, no account Runs in your browser Worked numbers shown Not advice Examples labelled

Ready to go further

Next: see one pattern worked in full

The head and shoulders page defines the shape in numbers, with a neckline, a trigger and a made-up count.

Read head and shouldersFree, no account
Reading time8 minutes
Worked exampleExact arithmetic
Tools linked1 on this page
Reviewed28 Oct 2026

What is included

  • What it is, in plain words
  • The formula or mechanism, with exact arithmetic
  • How it hits grid, martingale and DCA bots
  • A check you can run before you switch a bot on

Who it is for

  • People who run or plan to run a trading bot
  • Anyone reading a backtest or a bot sales page
  • Readers who want the numbers, not the pitch
  • Not advice, and not a signal service
Made-up 22 closes with swing highs found by a two-bar rule98102106181422H3H8H14H20Bar numberMade-up closes. A swing high is a close above the two closes before and the two after it.
The picture for this page. Example numbers are made up unless the page says they were calculated.

Key facts

  • A chart pattern is a recognisable shape in a price chart, built from swing highs, swing lows and the lines between them. Traders give shapes names such as double top, triangle and flag.
  • Patterns are usually sorted into continuation patterns, which are read as a pause inside a trend, and reversal patterns, which are read as a possible change of direction. These are labels for how people read them, not facts about what price will do.
  • Drawing a pattern is subjective. Two people can draw different lines on the same chart. A bot needs a written rule, and the rule has settings such as how far apart swing points must be and how close two highs must be to count as equal.
  • In the made-up example below, the same 4 swing highs give 0, 3, 5 or 6 matching pairs out of 6, depending only on a tolerance of 0.25, 0.5, 1, 1.5 percent (calculated by us on 31 Oct 2026, exact).
  • This page does not say how often any pattern works. That has to be counted on real data, with costs, and a result that depends on one tolerance setting should be treated with suspicion.

What chart patterns are

Price moves up and down. The turning points are called swing highs (a high with lower prices on both sides) and swing lows (a low with higher prices on both sides). A chart pattern is a name for a particular arrangement of those turning points. Two swing highs at about the same level make a double top. A high with a higher high in the middle and a lower high on each side makes a head and shoulders. Highs that fall while lows rise make a triangle.

Each pattern also comes with a story about what the crowd was doing. In a double top, buyers pushed price up to a level twice and failed twice. The story is the reason traders watch the shape. It is not a measurement. The same shape can be followed by a move in either direction, and how often each happens depends on the market, the period and the exact definition. No count of that is given on this page.

Continuation versus reversal

Patterns are normally split into two families.

  • Continuation patterns are read as a rest inside a trend. Flags, pennants and rectangles are examples. The usual reading is that price pauses, then breaks out of the shape in the direction it was already going.
  • Reversal patterns are read as an attempt to turn a trend around. A double top, a double bottom and a head and shoulders are the standard examples. The usual reading is that price breaks the other way.

Some shapes fit both families. A triangle can break either way, and which way it breaks is what decides the label, afterwards. That is the first hint of the main problem with patterns: the name often arrives after the result. A shape that is called a reversal pattern when it works is quietly called something else when it does not.

Common patterns in one line each

PatternUsual familyWhat the shape is
Double topReversalTwo swing highs at about the same level with a dip between them.
Double bottomReversalTwo swing lows at about the same level with a bounce between them.
Head and shouldersReversalThree swing highs, the middle one highest, with a line drawn through the two lows between them.
Ascending triangleUsually continuationA flat upper line and rising lows pressing into it.
Descending triangleUsually continuationA flat lower line and falling highs pressing into it.
Symmetrical triangleEitherFalling highs and rising lows that narrow toward a point.
Flag or pennantContinuationA sharp move, then a small tilted or narrowing pause.
RectangleContinuation or reversalPrice bounces between a flat top and a flat bottom.
WedgeEitherTwo lines that slope the same way and meet.
Cup and handleContinuationA rounded dip and recovery, then a small pullback.

Read the table as vocabulary. For deeper pages on two of them see head and shoulders and double bottom. Both pages show the arithmetic of one pattern, with made-up prices.

Why drawing a pattern is subjective

A human draws a pattern by eye. The eye is flexible, and that is the trouble. Look at the points where you place a line, how many bars you allow between two highs, and how close two highs must be to be "about equal". Change any of those and the chart gives a different answer. A trader who knows the shape they are hoping to find tends to find it.

The same flexibility works backwards. After a move has happened, it is easy to look back and see the pattern that led to it. Those cases get remembered and shown in books and videos. The cases where the shape appeared and nothing followed, or where a shape was drawn only because the line could be placed that way, are not shown. This is a form of survivorship bias, and it is why a pattern that looks obvious on a finished chart may be hard to use on a live one.

Support and resistance lines have the same issue. A level is a price where turns have happened before, but which turns count, and how wide the level is, is a choice. See support and resistance.

How a bot could detect a pattern

A bot cannot use a feeling. It needs a procedure with numbers in it. A common one has three steps.

  • Find the swing points. Pick a window size K. A bar is a swing high if its close is above the K closes before it and the K closes after it. A swing low is the same, reversed. Note that the rule needs K bars after the point, so a swing high is only known K bars late. A bot that treats it as known at the time of the high is using future data. See look-ahead bias.
  • Compare the swing points with a tolerance. Two highs count as equal when their gap, as a percent of the first, is no more than a set tolerance.
  • Define the trigger. For a double top, that could be a close below the lowest low between the two highs. That is a breakout rule, and it meets the same traps as any other. See breakout trading and false breakout.

A worked example with made-up numbers

Take the 22 made-up closes in the picture at the top. With K = 2, the swing highs are at bars 3, 8, 14, 20, at prices 105.0, 106.0, 105.5, 104.5. That gives 4 swing highs and 6 possible pairs. For each pair the gap is the difference in price divided by the first price. The table shows the gap and whether it passes at tolerances of 0.25, 0.5, 1, 1.5 percent, in that order.

BarsPricesGapPass at 0.25 / 0.5 / 1 / 1.5%
3 and 8105.0 and 106.00.95%no / no / yes / yes
3 and 14105.0 and 105.50.48%no / yes / yes / yes
3 and 20105.0 and 104.50.48%no / yes / yes / yes
8 and 14106.0 and 105.50.47%no / yes / yes / yes
8 and 20106.0 and 104.51.42%no / no / no / yes
14 and 20105.5 and 104.50.95%no / no / yes / yes

At 0.25 percent no pair passes, so a double top rule finds nothing. At 0.5 percent 3 pairs pass. At 1 percent 5 pass, and at 1.5 percent all 6 pass. Nothing about the prices changed. Only one setting did, and the number of patterns went from 0 to 6. All numbers here are made up and were calculated by us on 31 Oct 2026, exact. This is the same kind of problem described in overfitting: a setting that can be tuned until a backtest looks good.

Made-up: pairs of swing highs that count as equal at four tolerances0 of 60.25%tolerance3 of 60.5%tolerance5 of 61%tolerance6 of 61.5%toleranceSame 4 swing highs, 6 possible pairs. Only the tolerance changes. Calculated by us on 31 Oct 2026, exact.
The same made-up swing highs, matched at four tolerances. The count of double tops depends on a setting, not on the market.

How pattern rules break in a bot

  • Too many settings. Window size, tolerance, minimum bars between points and the trigger are all numbers. Choosing them by looking at past results fits the past. The overfitting page shows the effect.
  • Late detection. A swing point needs bars after it to be confirmed. By then price may have moved a long way from the high.
  • Costs at the trigger. The trigger is a break of a level, so the fill is often worse than the level. See slippage.
  • Too few examples. A rare pattern gives a handful of trades, and a handful proves nothing.
  • Indicators layered on top. Adding a filter such as RSI, Bollinger Bands or an EMA crossover adds more settings and more ways to fit noise.

How to check a pattern rule

Write the rule down in full before you test it: window size, tolerance, trigger, stop and exit. Run it on several years of real data and several markets, with spread, fees and slippage included. Count the trades, the share that lose, and the average result of each, as in expectancy. Hold back a stretch of data that you do not touch until the end, then follow the method in how to backtest. Test how the result changes when the tolerance moves a little either way. If a small change flips the answer, the rule was fitted to noise. Size any trade by the loss you can accept, using the position size calculator.

What this does not tell you

It does not say that any pattern predicts anything, how often a pattern is followed by a given move, or which pattern is best. The shapes and names are a way to describe a chart. The prices are made up and show only how to count. This page is education only.

FAQ

Frequently Asked Questions

What are chart patterns?

Named shapes in price, such as a double top, a triangle or a flag, made from swing highs, swing lows and lines between them. They describe a chart. They say nothing certain about what comes next.

What is the difference between continuation and reversal patterns?

Continuation patterns are read as a pause inside a trend, and reversal patterns as a possible turn. These are labels for how people read them. Some shapes, such as a triangle, are named only after the break.

Why is drawing chart patterns subjective?

Where you place the lines, how close two highs must be and how many bars you allow are all choices. Different people can draw different patterns on the same chart.

How can a bot detect a chart pattern?

It finds swing points with a window rule, compares them with a tolerance, then waits for a trigger such as a close below a level. Each of those has a setting that changes how many patterns it finds.

Can a backtest prove a pattern works?

It can measure one exact rule on past data with costs. It cannot prove the rule will work later. Test with data you held back, and check that small changes to the settings do not flip the result.

Are the numbers on this page real?

Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.

Can I use this to decide whether to run a bot?

It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.

Is this financial advice?

No. It is general education. The prices are made up and it does not consider your situation or give any signal.

Know the Risk Before You Run It

Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.

Trading carries a risk of loss