Skip to main content
Cart Log in Sign up
Indicator

Market Structure: swings with BOS and CHoCH

Finds swing highs and lows from pivots, labels them HH, HL, LH and LL, and marks structure breaks as BOS or CHoCH.

Platform

License

Price

≈

Version

You own this product. Go to My products
Get the demo

  • Automatic, instant delivery once payment confirms
  • Free updates for every future version
  • 12 months of technical support
  • Refunds under a transparent policy
  • Pay with USDT, BTC, ETH and more
  • Free: no payment, download it right now

Risk warning: Trading financial markets carries a risk of losing capital, and past performance does not guarantee future results. Terms & conditions

Product type
Indicator
Platforms
TV
Market / symbol
Gold, FX majors, Indices, Crypto
Experience level
Intermediate
Delivery
File download from your dashboard
Last update
November 30, 2026
Broker
Any broker

Overview

Reading market structure means seeing whether price is making higher or lower highs and lows. Market Structure does it with one fixed rule, so two people looking at the same chart see the same structure.

Each time the close breaks the latest swing high or low, it gets a label. A break in the direction of the current structure is a BOS; a break against it is a CHoCH, the first sign of a possible change.

Swings are confirmed by pivots, and pivots always confirm late: with a length of 5, a swing appears 5 bars after it formed. That delay is part of the method and should not be mistaken for a live signal.

  • HH, HL, LH and LL labels on swings
  • BOS and CHoCH lines and labels from the swing to the break bar
  • Break confirmed by close or by wick
  • Latest unbroken swing high and low
  • Alerts for BOS, CHoCH and new swings

Made by

This tool is written by the TradeKit team. The source code is open and included in the download. It is free to use.

Strategy logic

Swings

  • Swing highs come from ta.pivothigh: a bar whose High is above a number of bars on each side. Swing lows come from ta.pivotlow.
  • Each new high is compared with the previous one: higher is HH, lower is LH. Lows become HL or LL.
  • A swing is confirmed only after “swing length” bars have closed to its right.

Structure breaks

  • When the close (or the High in Wick mode) moves above the latest unbroken swing high, a bullish break is recorded. Lows work the other way.
  • If the prior structure was bearish, a bullish break is a CHoCH; otherwise it is a BOS. After each break the structure takes the break’s direction.
  • Each swing can be broken once, and breaks are recorded on closed bars only.

Specifications

Requirements

  • TradingView, the free plan is enough
  • Any timeframe; use a longer swing length on low timeframes
  • Swings confirm with a delay equal to the swing length
Platforms
TV
Delivery
Use case
Swing، Trend following
Market
Gold، FX majors، Indices، Crypto
Experience level
Intermediate

Compatible brokers

Which brokers this product works with, and which it works best with.

Works with every broker

No broker restriction: it works with any broker that offers the product's platform.

The broker choice is yours; TradeKit is not a broker. Check account terms before depositing. All brokers

Input parameters

Input parameters
ParameterDefaultDescription
Swing lengthBars on each side of a swing; higher means bigger swings and later confirmation 5 Bars on each side of a swing; higher means bigger swings and later confirmation
Break confirmed byConfirm a break with the close or with the wick (Close or Wick) Close Confirm a break with the close or with the wick (Close or Wick)
Show swing labels (HH/HL/LH/LL)Label higher/lower highs and lows true Label higher/lower highs and lows
Show BOSShow breaks of structure in the trend direction true Show breaks of structure in the trend direction
Show CHoCHShow changes of character against the prior trend true Show changes of character against the prior trend
Show unbroken swing levelsPlot the latest swing high and low that are not broken yet true Plot the latest swing high and low that are not broken yet
Break line styleStyle of the break line: Solid, Dashed or Dotted Dashed Style of the break line: Solid, Dashed or Dotted

Install guide

  1. Unzip the download. It contains MarketStructure.pine and a short readme.
  2. Open MarketStructure.pine in a text editor such as Notepad and copy all of it.
  3. In TradingView open a chart and click the Pine Editor tab at the bottom of the screen.
  4. Create a new blank indicator, select all of the default code and paste over it.
  5. Click Add to chart.
  6. Click Save to keep it in your scripts, so you can add it later from the Indicators menu.

Works on the free TradingView plan; your plan’s limit on indicators per chart still applies.

Changelog

  1. v1.0.0 TV New November 30, 2026
    • Published on TradeKit

Buyer reviews

No reviews yet.

Only verified buyers can review. Reviews are moderated before publishing.

Only verified buyers can review. Reviews are moderated before publishing.

Sign in to write a review

FAQ

Why does a swing label appear several bars late?
A high is only certain once several later bars close below it. With length 5 the label is placed 5 bars later, at the swing itself.
What is the difference between BOS and CHoCH?
A BOS breaks in the direction of the current structure, such as a new high in an uptrend. A CHoCH is the first break against it, such as a broken low in an uptrend.
Why is the first break on the chart a BOS?
At the start of the data no structure exists yet, so the first break only sets the direction and is labeled BOS.
Close or Wick?
Close shows fewer false breaks but reacts later. Wick is earlier but counts short wicks above a high as breaks.

Related products

More Indicators and tools from the same family

Compare Compare now