- 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
- 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 fromta.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.
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
| Parameter | Default | Description |
|---|---|---|
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
- Unzip the download. It contains
MarketStructure.pineand a short readme. - Open
MarketStructure.pinein a text editor such as Notepad and copy all of it. - In TradingView open a chart and click the Pine Editor tab at the bottom of the screen.
- Create a new blank indicator, select all of the default code and paste over it.
- Click Add to chart.
- 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
-
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 reviewFAQ
Why does a swing label appear several bars late?
What is the difference between BOS and CHoCH?
Why is the first break on the chart a BOS?
Close or Wick?
Related products
More Indicators and tools from the same family
Risk warning