Charts See the terminal

Premium script

Market Structure

Swings labelled HH, HL, LH and LL with every break of structure marked as BOS or CHoCH, plus optional internal structure and market structure shifts.

Market Structure Sign up for Altrady $12 one-time

Live Market Structure preview · BTC/USDT on Binance · 1h, history up to a day ago

What is Market Structure?

Market Structure labels each confirmed swing against the one before it. A swing high is a higher high (HH) or a lower high (LH), and a swing low a higher low (HL) or a lower low (LL). When price closes beyond the last swing, the script draws a line from that swing to the breaking bar and labels it BOS if the break continues the trend or CHoCH, change of character, if it goes against it.

It carries three tools in one script, each with its own toggle. Market Structure is on by default. Internal Structure adds a second, shorter structure for entries inside the swing trend, and Market Structure Shift marks the CHoCHs that came with a displacement leg. Both are off until you turn them on.

This is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and its code is not published.

Components

Market Structure combines 3 tools in one script. Each one has its own switch in the settings.

  • Market Structure. Swings labelled HH, HL, LH and LL, and every break of them, BOS with the trend and CHoCH against it. On by default.
  • Internal Structure. A second, shorter structure for entries within the swing trend, drawn as iBOS and iCHoCH beside the swing structure's breaks, with an arrow where both break the same way on one bar.
  • Market Structure Shift. A CHoCH whose breaking bar was also a displacement leg in the same direction, drawn as a line at the broken level with an arrow on the breaking bar.

How to use Market Structure

  • HH and HL. Higher highs and higher lows describe an uptrend. Lower highs and lower lows describe a downtrend.
  • BOS. A break of structure in the direction of the trend. The trend is continuing.
  • CHoCH. A break against the trend, the first sign it may be changing. Many traders wait for a CHoCH before looking for trades the other way.
  • Internal versus swing structure. The swing structure gives the trend and the internal structure the entries within it. An arrow marks bars where both break the same way.
  • MSS. A change of character where the breaking bar was also part of a strong displacement leg, a trend change with conviction.

Settings

Components

SettingDefaultRangeWhat it changes
Show Market StructureOn Swings labelled HH / HL / LH / LL, and every break of them: BOS with the trend, CHoCH against it.
Show Internal StructureOff A second, shorter structure (Internal Length) for entries within the swing trend, drawn as iBOS / iCHoCH against the swing structure's breaks, with an arrow where both break the same way on one bar.
Show Market Structure ShiftOff Market Structure Shift (MSS): a CHoCH whose breaking bar was also a displacement leg the same way, a trend change with conviction.

Structure

SettingDefaultRangeWhat it changes
Swing Length5 1 or moreBars either side of a pivot. Larger finds fewer, bigger swings, and confirms them later, since a swing needs this many bars after it.
Significance (ATR x)1.5 0 to 10A swing is ignored unless the leg into it covered this much ATR. ATR rather than a percentage so it transfers between instruments.
TimeframeChart Chart, 15m, 30m, 1h, 4h, 1DRead structure from a higher timeframe while trading a lower one. The chart's own period must divide it exactly. Swings, breaks and the ATR filter are then all measured on that timeframe, not on the chart's. Market Structure only: Internal Structure and Market Structure Shift always read the chart's own bars.
Break OnClose Close, WickClose: a bar must close beyond the swing. Wick: a touch is enough, which also turns every sweep into a break.

Display

SettingDefaultRangeWhat it changes
Show Swing LabelsOn The HH / HL / LH / LL marks on each confirmed swing.
Show BreaksOn The line from the broken swing to the bar that broke it, and its BOS / CHoCH label.
Label SizeNormal Tiny, Small, Normal, Large, Huge
Break Line StyleDashed Solid, Dashed, Dotted
Colour Bars By TrendOff Tint every candle by the prevailing structure. Off by default: it overrides the candle's own up/down colour.
Max Swings50 1 to 500The oldest swing label is removed past this. A structure tool draws one mark per swing forever otherwise, and §2.3's budget is 500 drawings per bar. 500 bars of 1h BTC leave 54 swings, so a long scroll is what makes this mandatory rather than tidy.
Max Breaks20 1 to 200The oldest break line and its label are removed past this. Breaks are capped separately from swings because they age differently: a swing is a mark, a break is a line plus a label and costs twice as much.
Show Trend PaneOff A sub-pane plotting trend (1 / -1 / 0) and each break as a pulse. This is the tool's internal state, and it is what the automated checks read.
Show State PaneOff Internal Structure's break count and Market Structure Shift's shift count, each in its own pane, for whichever of the two is on.

Colours

SettingDefaultRangeWhat it changes
Bullish #089981 Higher highs, higher lows, and up-breaks.
Bearish #f23645 Lower highs, lower lows, and down-breaks.
BOS #787b86 A break that continued the prevailing structure.
CHoCH #ff6d00 A break against it: the change of character.

Internal Structure

SettingDefaultRangeWhat it changes
Internal Swing Length15 2 to 50Bars each side for the higher swing pivots.
Internal Swing Filter (ATR)0 0 to 5
Internal Break BasisClose Close, WickWhat must cross the swing to count as a break.
Internal Length5 2 to 50Bars each side for the internal pivots.
Internal Filter (ATR)0 0 to 5
Internal Show Swing LinesOn The swing structure's break lines, drawn bold for contrast with the internal ones.
Internal Show Swing LabelsOn The swing structure's BOS / CHoCH labels, in this component's style.
Show Internal LinesOn
Show Internal LabelsOn
Internal Show AlignmentOn A marker where internal and swing structure agree in direction.
Internal Max Breaks20 1 to 100Per structure type.
Internal Swing Bullish #089981
Internal Swing Bearish #f23645
Internal Bullish #089981
Internal Bearish #f23645
Internal Alignment #ffeb3b Where both resolutions agree.

Market Structure Shift

SettingDefaultRangeWhat it changes
MSS Swing Length5 2 to 50Bars each side to confirm a swing pivot.
MSS Swing Filter (ATR)0 0 to 5Minimum swing size. 0 accepts all pivots.
MSS Break BasisClose Close, WickWhat must cross the swing to count as a break. Close is the default (§4.3).
MSS Displacement (ATR)2 0.5 to 10Minimum leg size in ATR units for the break to qualify as displacement.
MSS Min Leg Bars1 1 to 10Minimum bars in the displacement leg.
MSS Show LinesOn A horizontal line at the broken level.
MSS Show MarkersOn An arrow at the break bar.
MSS Max Shifts10 1 to 50The oldest MSS is removed past this.
MSS Label #b0b3b8 The MSS label text.
Bullish MSS #089981 A bearish-to-bullish structure shift.
Bearish MSS #f23645 A bullish-to-bearish structure shift.

Alerts: bos, choch, swing, swing_bos, swing_choch, int_bos, int_choch, aligned, mss_bullish, mss_bearish.

How it works

A swing high is a bar whose high stands above a number of bars on either side, Swing Length, five by default, and a swing low the mirror. Swings whose leg did not cover enough of the average true range are ignored, so small wiggles do not count. Each new swing is compared with the previous one of its kind to get its label.

A break happens when a bar closes beyond the most recent swing, or touches it if Break On is set to Wick. Whether it is a BOS or a CHoCH depends on the trend before it. The break line runs from the swing that set the level to the bar that broke it and never moves once drawn.

Internal Structure and Market Structure Shift run their own swing settings on the chart's own bars, while Market Structure can read a higher timeframe. Colour Bars By Trend can tint every candle by the prevailing structure.

Limitations

  • Confirmation lag. A swing needs Swing Length bars after it to exist, so the newest label always appears that many bars late, on the bar it describes. Anything that labels a swing as it happens is labelling something else.
  • Wick breaks catch sweeps. With Break On set to Wick, a sweep that pokes through a swing and comes back counts as a break.
  • Two structures can draw the same break. With Market Structure and Internal Structure both on, a break both find is drawn twice, once in each style.
  • Settings change the story. A shorter Swing Length finds more swings and more breaks. The same chart can show a CHoCH at one setting and none at another.
  • Structure is descriptive. A BOS says the trend continued up to now. It does not say the next swing will hold.

Get Market Structure

Premium scripts are a one-time purchase in the Altrady marketplace and need a paid Altrady plan to run.

  • Market Structure $12 This script on its own.
  • Structure & Wyckoff bundle $29 7 premium scripts, Market Structure included.
  • Altrady Complete Suite $109 All 36 premium scripts.
Sign up for Altrady

Frequently asked questions

Both are a close beyond the last swing. A BOS goes in the direction of the trend and confirms it. A CHoCH goes against it and is the first sign of a possible change.

No. Swings are only labelled once confirmed, Swing Length bars after they happen, and break lines are drawn once both ends are settled. Nothing already on the chart moves.

In this script, a CHoCH whose breaking bar was also part of a displacement leg in the same direction, a leg of at least two average true ranges by default.

Ten. Market Structure: bos, choch and swing. Internal Structure: swing_bos, swing_choch, int_bos, int_choch and aligned when both structures break the same way. Market Structure Shift: mss_bullish and mss_bearish. A component that is switched off fires no alerts.

Yes. Market Structure is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and the code is never shared. You buy it once in the Altrady marketplace, on its own, in the Structure & Wyckoff bundle or in the Altrady Complete Suite, and it needs a paid Altrady plan to run. It is also included with your first annual Premium subscription.

Use the Get it in Altrady button on this page to open its listing in the Altrady marketplace. Once it is in your account, open the indicator picker on any chart in Altrady Charts and add Market Structure like any other indicator. Turn on Internal Structure and Market Structure Shift in its settings panel.

Sign up for Altrady