Indicators · Market structure on the price chart · explained simply
Theurgy Structure 1.01
Copy the full Pine script and paste it into TradingView’s Pine Editor. Or copy this explanation, open Grok, and paste it with your question.
Theurgy Structure marks the swing highs and lows on a price chart and labels each time price closes through one. It also shades the last zones where a move started (order blocks) and flags equal highs and lows. It draws a map of the trend; it does not give buy or sell signals.

Six questions this page answers
Use the guide below the same way you would judge any tool on a chart:
- What state is the market in?
- What should I do, and at exactly what price?
- How sure is it?
- What proves it wrong?
- Has it worked before on this chart?
- What can’t it tell me?
What it tells you
What state is the market in? Theurgy Structure tracks the trend two ways at once:
- Swing structure (the big picture): a high or low only counts if it is the highest or lowest point for 50 bars after it.
- Internal structure (the smaller moves inside): a high or low counts if it holds for 5 bars after it.
Each layer keeps its own trend: up after price closes above a high, down after price closes below a low. You can read the current values (+1 up, −1 down, 0 not set yet) as “Swing trend” and “Internal trend” in TradingView’s data window. There is also an option to color the candles green or red by the internal trend.
BOS and CHoCH labels
What should I do, and at exactly what price? Theurgy Structure does not say. It labels what price just did:
- BOS (break of structure): price closed through a high or low in the same direction as the current trend. Up trend, new close above the last high = bullish BOS. It says the trend is continuing.
- CHoCH (change of character): price closed through a high or low against the current trend. Down trend, close above the last high = bullish CHoCH. It is the first sign the trend may be flipping.
- Green labels and lines are bullish breaks; red are bearish. Swing breaks use solid lines and bigger labels; internal breaks use dashed lines and tiny labels. The line runs from the broken high or low to the bar that broke it.
- If an internal level is the same as the swing level, only the swing break is drawn.
Order blocks
When a break happens, the script looks back between the broken level and now. For a bullish break it finds the bar with the lowest low; for a bearish break, the bar with the highest high. That bar’s range becomes an order block: a shaded box that stretches to the right. Cyan boxes are bullish (where buying took over), magenta boxes are bearish.
- By default the last 5 internal order blocks show. Swing order blocks are off by default.
- Very wild bars (a range at least twice the 200-bar average range) are skipped, so one spike does not set a box.
- A box disappears once price runs through it: a bearish box when price trades above its top, a bullish box when price trades below its bottom. You can change this to use the close instead.
Other marks
- EQH / EQL (equal highs and lows): a dotted line and label when two nearby highs (or lows) land within 0.1 of an average true range of each other. Many traders watch these as spots where stop orders may be waiting.
- Strong / weak high and low: lines at the top and bottom of the current swing range. In an up trend the low is “strong” (the trend is defending it) and the high is “weak” (likely to be broken). In a down trend it flips.
- Premium / discount zones (off by default): shades the top of the swing range red (premium), the bottom green (discount), and a gray middle band (equilibrium).
- HH / HL / LH / LL (off by default): labels each swing point as a higher high, higher low, lower high or lower low.
Settings
Mode: “Historical” keeps every label; “Present” keeps only the latest one of each kind. You can also change the two pivot lengths, turn on a body filter (an internal bullish break needs a green bar, a bearish break a red bar), set how many order blocks show, and change label sizes.
Alerts
Pick any of these in TradingView’s alert dialog:
- Internal and swing bullish / bearish BOS and CHoCH (8 alerts).
- Internal and swing bullish / bearish order block break (4 alerts).
- Equal Highs and Equal Lows.
What it can’t tell you
How sure is it? There is no confidence score. What proves it wrong? A break the other way: a bullish CHoCH is undone by a bearish break. Has it worked before? This script keeps no scorecard or pretend account.
- Highs and lows are only known after the fact: a swing point shows up 50 bars late, an internal one 5 bars late, and equal highs and lows 3 bars late. Labels are drawn back at the right spot, which can make the past look neater than it felt live.
- Breaks are checked on the live bar, so a label can appear and then vanish if the bar does not close past the level. Trust it once the bar closes.
- Order blocks and equal highs and lows are popular ideas, not guarantees. Price can slice right through a box.
- It only uses this chart’s timeframe. It does not check higher timeframes.
- Theurgy Structure is a TradingView indicator. MystTrades does not show live Theurgy Structure readings.
Version and credit
Theurgy Structure 1.01 by TheurgyLabs (build of Nov 19, 2026). It was first published here as “Theurgy Structure.” Version 1.01 changed the order-block colors to cyan and magenta. Version 1.00 was the first build. It is adapted from “Smart Money Concepts” by LuxAlgo, rewritten for Pine v6 and trimmed: it leaves out fair value gaps and higher-timeframe levels. Like the original, it is shared under the CC BY-NC-SA 4.0 license (credit required, no commercial use, share alike).
For learning and research, not personal investment advice. This page explains the indicator; it does not show live readings or change your TradingView script. Past results do not promise future results.