Clean Chart with Internal Trend State
Keeps internal trend calculations off the price canvas to preserve clean candlestick visibility while tracking confirmed directional flips.
Internal trend-flip confirmation, past-only swing zone mapping, and fixed-SL risk-capped chart references.
UMAR'S AL-ANAM MASTER ZONES is a TradingView Pine Script v6 chart overlay designed for uncluttered price-action analysis. Its underlying directional trend calculations remain internal so the chart stays clean. When an internal directional flip occurs, the indicator monitors a configurable confirmation window for a U candle breakout, scans past bars for the local swing extreme, projects a BULL ZONE or BEAR ZONE box with an Entry % slice, and plots E, SL, and TP reference levels.
Verified visually in supplied TradingView capture on XAUUSD 3m; overlay=true supports standard TradingView chart timeframes with asset-appropriate calibration.
Keeps internal trend calculations off the price canvas to preserve clean candlestick visibility while tracking confirmed directional flips.
Evaluates a configurable confirmation window after each trend flip and plots a U marker when a confirmed directional breakout candle closes.
Scans strictly current and past bars (zero future lookahead) to anchor BULL ZONE and BEAR ZONE boxes to the local swing candle high-to-low range.
Overlays a translucent Entry % region inside each swing zone (default 50%, adjustable 1%–100%) to highlight planned entry boundaries.
Calculates TP from base risk and keeps ATR-buffered SL and TP fixed; if initial distance exceeds Maximum SL Distance, Entry shifts toward SL.
Optional bar cooldown spaces consecutive U signals, while FIFO array management cleans up old zones, entry boxes, lines, and labels together.
On confirmed bar close, the hidden trend engine detects a directional state change and arms a breakout confirmation window.
If price breaks above/below the flip candle within the confirmation window and passes cooldown spacing, a bullish or bearish U candle confirms.
When Swing Window is enabled, the script searches backward across Swing Lookback Bars for the lowest low (bullish) or highest high (bearish) candle.
Draws the BULL/BEAR ZONE box, ENTRY % slice, and E, SL, and TP lines with right-side price tags on the chart.
Confirmed U candle breakout marker occurring within the confirmation window after an internal trend flip.
Complete High-to-Low swing candle range projected forward across Zone Extension Bars.
Internal percentage slice inside the swing zone defining the base Entry boundary.
Solid blue Entry line, dashed red ATR-buffered Stop Loss line, and dotted green Risk:Reward Take Profit line.
Top-right 3-row header displaying UMAR'S | AL-ANAM MASTER ZONES | TREND ◆ U CANDLE ◆ SWING ZONES.
User-configurable parameters organized by TradingView settings group.
| Group | Input | Type | Default | Function |
|---|---|---|---|---|
| Calculation Parameters | A1, A2, A3, A4 | Int / Int / Source / Int | 12 / 90 / close / 90 | Core internal engine tuning parameters (labeled A1–A4 to keep internal calculation mechanics protected). |
| U Candle Confirmation | Breakout Confirmation Window | Int | 4 bars (1–50) | Maximum bars after an internal trend flip during which a U breakout candle may confirm. |
| U Candle Confirmation | Show U Candle Label & Colors | Bool / Color | true (#00C853 / #F44336) | Toggles and styles bullish and bearish U candle markers. |
| Swing Zone Settings | Enable Swing Window & Lookback | Bool / Int | true / 10 bars | Searches past bars for the local swing extreme candle to anchor the zone. |
| Swing Zone Settings | Zone Extension & Maximum Zones | Int / Int | 20 bars / 100 zones | Controls forward zone duration and maximum retained drawing sets. |
| Entry / SL / TP | Use Entry Zone Percentage & % | Bool / Float | true / 50.0% | Draws the inner ENTRY % sub-box and sets base Entry placement. |
| Entry / SL / TP | SL ATR Multiplier & Maximum SL Cap | Float / Bool / Float | 0.5 / true / 3.0 | Places SL outside the zone using ATR(14) and shifts Entry toward fixed SL if distance exceeds Maximum SL Distance. |
| Entry / SL / TP | Risk:Reward Target & Show TP | Float / Bool | 2.5 / true | Projects TP from base Entry and base SL distance. |
| U Candle Cooldown | Enable Cooldown & Cooldown Bars | Bool / Int | true / 10 bars | Enforces minimum bar spacing between consecutive U candle confirmations. |
Click any image to open the full-resolution lightbox preview.
Introduced trend-flip U candle detection, swing zones, and initial Entry/SL/TP projections.
Hid internal ribbon plots, protected A1–A4 parameters, fixed SL/TP anchoring under Max SL Cap, and added the Royal Purple brand panel matching the supplied screenshot.