Pure Market Structure (Olympus Cipher)

Pure Market Structure (Olympus Cipher) reads price the way classic market structure does: through swing highs and lows, breaks of those swings, and the absence of breaks. There are no order blocks, gaps, liquidity zones, or other add-ons. Just structure, presented cleanly, with one goal: tell you whether the market is trending up, trending down, or ranging.
WHAT IT SHOWS YOU!
• Zigzag of confirmed swings, with every swing labeled HH, HL, LH, or LL
• MSB (Market Structure Break): the trend has reversed (solid line)
• BOS (Break of Structure): the trend has continued (dashed line)
• Key Low / Key High: the single level whose break flips the trend
• Trend background: green for uptrend, red for downtrend, no color while ranging
• Range boxes around consolidation phases
• Dashboard with the structure state on your chart and four other timeframes
HOW IT WORKS:
1. Swings
A swing high is confirmed once no higher high has printed for "Swing length" bars after it (the same applies in reverse for swing lows). Swings always alternate high-low-high, which keeps the zigzag clean. Each new swing is compared with the previous one of the same type and labeled HH/LH or HL/LL.
2. Trend: Key level instead of every swing
Many structure tools flip the trend whenever any minor swing breaks, which turns strong trends into noise. This script uses a single Key level instead:
• In an uptrend, the Key Low is the most recent swing low that led to the latest break higher.
• Only a candle close below the Key Low is an MSB (reversal). Breaks of smaller lows are treated as pullbacks.
• A close above the highest swing high since the last break is a BOS (continuation), and the Key Low moves up.
Downtrends work the same way in reverse with the Key High.
3. Ranges: failed pushes
A trend is expected to break its last swing before it forms a new one. In an uptrend, if a new swing high forms before price has closed above the previous swing high, that push has failed. When the number of failed pushes reaches "Failed pushes to call a range" (default 1), the market is classified as ranging, and a box is drawn from the highest swing high to the lowest swing low since the last break. A strong trend breaks every swing before the next one forms, so it is never classified as a range.
The range ends when:
• price closes above the range's highest swing high (uptrend continues), or below the Key Low (reversal), or
• a clean HH + HL sequence forms inside the range and price closes above that HH, which starts an uptrend. LH + LL followed by a close below that LL starts a downtrend.
The second rule stops a real trend from staying stuck inside a range when the Key level is far away. It can be switched off.
Optionally, you can also classify the market as ranging when no break has happened for a set number of bars.
SETTINGS:
• Swing length: the size of the swings. Lower values follow minor structure; higher values follow major structure. 10 is a balanced default. Try 15-20 for cleaner trends.
• Break confirmation: Close (recommended) or Wick.
• Failed pushes to call a range: 1 detects ranges early. 2-3 shows only longer sideways phases.
• Exit range on clean trend sequence: lets a clear HH+HL or LH+LL sequence end a range.
• Labels for MSB and BOS can be renamed, and continuation breaks can be hidden.
REPAINTING AND DELAY: PLEASE READ
• A swing can only be confirmed "Swing length" bars after it forms, so zigzag points and HH/HL/LH/LL labels appear on the chart that many bars late, placed back at the swing's bar. This is confirmation delay, not repainting: once drawn, swings do not move.
• With "Wait for bar close" enabled (default), breaks, trend changes, and ranges are decided only on closed bars and do not change afterwards.
• The dotted "developing leg" from the last swing to the current price is not confirmed and updates in real time by design.
• The dashboard uses confirmed higher-timeframe bars only, so its values do not repaint.
ALERTS:
Bullish / Bearish MSB, Bullish / Bearish BOS, Range started, Range breakout up, Range breakout down.
This indicator is a tool for reading price structure. It does not predict the future and is not financial advice. Always test it on your own markets and timeframes before relying on it.
This indicator is open source; feel free to use it. Comments are appreciated.
For any Query, DM me on Tradingview/Discord: discord.com/users/1116790754690482216
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
For any Query, DM me on Tradingview/Discord: discord.com/users/1116790754690482216
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.