OPEN-SOURCE SCRIPT
Sigma Structure [RWCS]

What it is:
Sigma Structure is a confluence-based trading indicator that unifies three distinct analytical layers into a single, cohesive view: a Z-Score oscillator measuring price deviation from its 20 EMA, a normalized MACD histogram for momentum context, and an Order Block detection engine that identifies structural demand and supply zones directly on the price chart. The result is an indicator that tells you not just when price is statistically extended, but where that extension is occurring relative to meaningful price structure — giving every signal a location and every location a statistical weight.
How it works:
1. Z-Score layer: Price is measured as the number of standard deviations it sits above or below its 20-period EMA. This produces an oscillator that reads consistently across any asset or timeframe — a reading of +2 on Bitcoin means the same thing structurally as +2 on the S&P or EURUSD. The line color intensifies from faded to full aqua as it moves above zero, and faded to full fuchsia below, so the degree of extension is immediately legible at a glance. Fixed bands at ±1, ±2, and ±3 sigma define the statistical landscape.
2. MACD layer: A standard MACD histogram is computed normally, then linearly scaled so its rolling peak aligns with the ±3σ band. No calculation is modified — only the display axis is shared with the Z-Score. This means crossovers, divergences, and momentum shifts read identically to a standard MACD, but now live in the same visual space as the bands, letting you see momentum and mean-reversion context simultaneously.
3. Order Block layer: The indicator scans for order blocks using a sequential candle method — a bearish candle followed by a configurable number of consecutive bullish candles (demand), or a bullish candle followed by consecutive bearish candles (supply). Detected zones are drawn directly on the price chart as shaded regions with solid top boundaries and dashed bottom boundaries, color-coded aqua for demand and fuchsia for supply. Zones extend rightward bar by bar and self-invalidate the moment price closes through them, so what you see on the chart is always live and relevant.
4. Confluence signals: Two signal types fire when the Z-Score and Order Block layers align. An OB Reversal label appears when price is inside an Order Block while the Z-Score is at or beyond ±2σ — the statistical extension and the structural level are confirming each other as a fade opportunity. An OB Continuation label appears when price pulls back into an Order Block and the Z-Score reclaims zero — the trend is reasserting after a mean-reversion dip into demand or supply.
5. Volatility divergence: A background highlight layer compares price's rolling highs and lows against the rolling highs and lows of realized volatility (standard deviation of log returns). When price makes a new low without a corresponding expansion in realized volatility, a bullish divergence is flagged. The inverse flags bearish divergence. These are not entry signals on their own — they indicate moments where price action and volatility are telling different stories and warrant closer attention.
Possible ways to use it:
1. Reversal setups: When the Z-Score reaches ±2σ or beyond and price simultaneously tags an active Order Block zone, the statistical extension and structural level are aligned. The OB Reversal label marks these bars. Look for MACD histogram compression or a zero cross in the same window for additional confirmation before acting.
2. Trend continuation entries: In trending markets, price frequently pulls back into demand or supply zones and finds support exactly where it should. When the Z-Score crosses back through zero inside an active zone, the OB Continuation label fires — this is your structural retest with momentum confirmation.
3. Divergence as a filter: The volatility divergence highlights flag potential exhaustion in price moves that lack volatility confirmation. Use these as a reason to tighten risk or wait for the OB/Z-Score confluence before entering, rather than chasing the move.
4. EMA trend bias: The fast and slow EMA overlay on the price chart provides a quick structural read. Aligning your OB Reversal or Continuation signals in the direction of the EMA cross adds a higher-timeframe trend filter without requiring a second indicator.
5. Alert-driven scanning: Three configurable alerts cover the ±2σ Trade Zone cross, OB Reversal confluence, and OB Continuation setup. Set these across a watchlist to surface actionable conditions without manual chart monitoring.
Settings guide:
1. EMA / Std Dev Length: Both default to 20, matching a standard Bollinger Band configuration. Increase for smoother, slower signals on higher timeframes.
2. MACD Norm Lookback: Controls how far back the indicator looks to find the MACD histogram's peak for scaling. Higher values produce more stable scaling; lower values make the histogram more reactive to recent momentum.
3. Sequential Candles for OB: The number of consecutive candles required after the origin candle to confirm a block. Higher values produce fewer, higher-quality zones.
4. Max Active Zones: How many demand and supply zones can coexist on each side. Older zones are removed when the limit is reached.
5. Divergence Lookback: The rolling window for comparing price extremes against volatility extremes. Shorter values produce more frequent signals; longer values are more selective.
Disclaimer:
This indicator is published for educational and informational purposes only. Nothing presented here constitutes financial advice, a solicitation, or a recommendation to buy or sell any financial instrument. All trading involves risk, including the possible loss of principal. Past performance of any indicator or methodology is not indicative of future results. You are solely responsible for your own trading decisions. Always conduct your own research and consult a qualified financial professional before making any investment decisions.
Sigma Structure is a confluence-based trading indicator that unifies three distinct analytical layers into a single, cohesive view: a Z-Score oscillator measuring price deviation from its 20 EMA, a normalized MACD histogram for momentum context, and an Order Block detection engine that identifies structural demand and supply zones directly on the price chart. The result is an indicator that tells you not just when price is statistically extended, but where that extension is occurring relative to meaningful price structure — giving every signal a location and every location a statistical weight.
How it works:
1. Z-Score layer: Price is measured as the number of standard deviations it sits above or below its 20-period EMA. This produces an oscillator that reads consistently across any asset or timeframe — a reading of +2 on Bitcoin means the same thing structurally as +2 on the S&P or EURUSD. The line color intensifies from faded to full aqua as it moves above zero, and faded to full fuchsia below, so the degree of extension is immediately legible at a glance. Fixed bands at ±1, ±2, and ±3 sigma define the statistical landscape.
2. MACD layer: A standard MACD histogram is computed normally, then linearly scaled so its rolling peak aligns with the ±3σ band. No calculation is modified — only the display axis is shared with the Z-Score. This means crossovers, divergences, and momentum shifts read identically to a standard MACD, but now live in the same visual space as the bands, letting you see momentum and mean-reversion context simultaneously.
3. Order Block layer: The indicator scans for order blocks using a sequential candle method — a bearish candle followed by a configurable number of consecutive bullish candles (demand), or a bullish candle followed by consecutive bearish candles (supply). Detected zones are drawn directly on the price chart as shaded regions with solid top boundaries and dashed bottom boundaries, color-coded aqua for demand and fuchsia for supply. Zones extend rightward bar by bar and self-invalidate the moment price closes through them, so what you see on the chart is always live and relevant.
4. Confluence signals: Two signal types fire when the Z-Score and Order Block layers align. An OB Reversal label appears when price is inside an Order Block while the Z-Score is at or beyond ±2σ — the statistical extension and the structural level are confirming each other as a fade opportunity. An OB Continuation label appears when price pulls back into an Order Block and the Z-Score reclaims zero — the trend is reasserting after a mean-reversion dip into demand or supply.
5. Volatility divergence: A background highlight layer compares price's rolling highs and lows against the rolling highs and lows of realized volatility (standard deviation of log returns). When price makes a new low without a corresponding expansion in realized volatility, a bullish divergence is flagged. The inverse flags bearish divergence. These are not entry signals on their own — they indicate moments where price action and volatility are telling different stories and warrant closer attention.
Possible ways to use it:
1. Reversal setups: When the Z-Score reaches ±2σ or beyond and price simultaneously tags an active Order Block zone, the statistical extension and structural level are aligned. The OB Reversal label marks these bars. Look for MACD histogram compression or a zero cross in the same window for additional confirmation before acting.
2. Trend continuation entries: In trending markets, price frequently pulls back into demand or supply zones and finds support exactly where it should. When the Z-Score crosses back through zero inside an active zone, the OB Continuation label fires — this is your structural retest with momentum confirmation.
3. Divergence as a filter: The volatility divergence highlights flag potential exhaustion in price moves that lack volatility confirmation. Use these as a reason to tighten risk or wait for the OB/Z-Score confluence before entering, rather than chasing the move.
4. EMA trend bias: The fast and slow EMA overlay on the price chart provides a quick structural read. Aligning your OB Reversal or Continuation signals in the direction of the EMA cross adds a higher-timeframe trend filter without requiring a second indicator.
5. Alert-driven scanning: Three configurable alerts cover the ±2σ Trade Zone cross, OB Reversal confluence, and OB Continuation setup. Set these across a watchlist to surface actionable conditions without manual chart monitoring.
Settings guide:
1. EMA / Std Dev Length: Both default to 20, matching a standard Bollinger Band configuration. Increase for smoother, slower signals on higher timeframes.
2. MACD Norm Lookback: Controls how far back the indicator looks to find the MACD histogram's peak for scaling. Higher values produce more stable scaling; lower values make the histogram more reactive to recent momentum.
3. Sequential Candles for OB: The number of consecutive candles required after the origin candle to confirm a block. Higher values produce fewer, higher-quality zones.
4. Max Active Zones: How many demand and supply zones can coexist on each side. Older zones are removed when the limit is reached.
5. Divergence Lookback: The rolling window for comparing price extremes against volatility extremes. Shorter values produce more frequent signals; longer values are more selective.
Disclaimer:
This indicator is published for educational and informational purposes only. Nothing presented here constitutes financial advice, a solicitation, or a recommendation to buy or sell any financial instrument. All trading involves risk, including the possible loss of principal. Past performance of any indicator or methodology is not indicative of future results. You are solely responsible for your own trading decisions. Always conduct your own research and consult a qualified financial professional before making any investment decisions.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.