Iceberg Detector [JOAT]ICEBERG DETECTOR
A hidden-liquidity detector that infers iceberg orders from their footprint on the tape — without needing direct L2 data. The detection pattern is well-known to professional tape readers: the same price level being repeatedly tested by long wicks, with above-average volume, and price each time getting rejected back in the opposite direction. That repeated-rejection pattern is the visible signature of an iceberg — a large resting order broken into smaller slices to hide its true size. This script catches the pattern, clusters the tests, paints the zone, and tells you when the iceberg gets broken or eaten.
Detection — five gates, all required
A bar is a candidate iceberg test only when every one of these is true:
Long wick — wick-to-body ratio above the configurable threshold (default 0.75). The wick is the visible rejection; the body is the failed push.
Local extremum — the wick reached a local high or low over the configurable pivot lookback (default 5 bars). A wick that did not actually probe new territory does not count.
Above-average volume — bar volume must exceed volume average × multiplier (default 1.0×). Real absorption needs real size hitting the tape.
Wick rejection bias — the candle must close in the rejection direction (opposite of the wick).
Cluster within tolerance — at least N (default 2) of these qualifying tests must occur within ATR × tolerance of the same level inside the detection window (default 40 bars).
Only when all five gates pass does the script paint a zone. The wick rejection bias % input controls how strict the rejection-direction filter is; raising it to 70%+ makes the zone confirmation slower but cleaner.
Cluster-aware level building
When two or more qualifying tests fall within ATR-multiplier tolerance of each other, they are clustered into a single zone whose vertical extent (configurable in ATR units) covers the cluster. This means an iceberg sitting at 4382.50–4383.25 is rendered as a single horizontal band, not two separate ticks — which is how a real iceberg would actually appear on the tape.
Visual system
Iceberg zone — a horizontal band rendered in the cool-blue palette (deep void → pale violet gradient) with configurable opacity.
Glow layers — N (configurable, default 4) stacked transparent boxes behind the zone produce a soft glow border.
Pulse animation — for a configurable number of bars after a fresh test, the zone's transparency oscillates to highlight that the iceberg has just been re-tested. Toggleable.
Test ticks — small markers at each individual test bar inside the zone.
Test count badge — small number tag showing how many tests have hit the level.
Right extension — configurable bar count for forward zone projection.
A locked Void palette (cool violet gradient on a deep void ground) gives the chart a distinctive hidden-liquidity identity.
Lifecycle — persist, archive, break
Every iceberg has three life stages:
Active — currently in front of price and being honoured. New tests add ticks and trigger pulse animations.
Broken — price closed through the level by Break Distance × ATR (default 0.5 ATR). The zone moves to the muted broken-archive palette and stays on the chart for brokenStaleBars (default 150) bars so you can see where structure failed.
Stale — older than the archive lifetime, automatically removed.
A maximum-concurrent-icebergs cap (default 12 active) and a max-broken cap (default 8) keep the chart legible.
Dashboard
Monospaced table, positionable to any of nine corners, surfaces:
Active iceberg count, broken count.
Nearest iceberg level with side (resistance / support), distance in ticks or %.
Test count and age of the nearest iceberg.
Last broken event with bars-ago tag.
Alerts
Three alert conditions, each independently controllable:
New Iceberg Detected — fires the bar an iceberg is first confirmed (all five gates pass).
Iceberg Re-Tested — fires when an existing iceberg gets another qualifying test.
Iceberg Broken — fires when price closes through by the break-distance threshold.
How to read it
Two reads, in order of conviction:
Active iceberg in front of price is your immediate liquidity wall. Faded iceberg the market keeps probing without breaking = strong demand-side or supply-side hidden order. Use as a context level — fade touches if your bias is reversal, expect continuation through if your bias is breakout.
Iceberg Broken alert is your highest-conviction directional event. A hidden order has been eaten through, meaning the side that was holding it has either pulled it or been exhausted — either way, the resistance / support is gone, and the move that follows is unencumbered by the absorbed liquidity.
Suggested settings
Defaults (2 minimum tests, 40-bar detection window, 0.5 ATR cluster tolerance, 0.75 wick/body ratio) are tuned for 5m–1H on liquid markets. For lower-timeframe scalping, lower the wick/body ratio to 0.5 and raise the volume multiplier to 1.5×. For higher-timeframe macro reads, raise minimum tests to 3 and widen the detection window to 100+ bars.
Originality
The implementation — the five-gate detection (wick + extremum + volume + rejection % + cluster tolerance), the ATR-cluster level-builder, the cool-palette glow layers, the post-test pulse animation, the break-distance lifecycle with archive, and the test-count badge rendering — is JOAT-original and tuned together. No third-party code reused. The hidden-liquidity / iceberg concept is well-known to tape readers; the detection pipeline here is built specifically for chart-based bar data without requiring L2 access.
Limitations
Pine indicators cannot read L2 order book data. Iceberg Detector infers iceberg presence from the visible tape footprint — long-wick rejection candles, clustered at a level, with above-average volume, all closing in the rejection direction. This is the accepted public-market inference pattern but it is by nature an inference, not a direct observation. The script can produce false positives on instruments with naturally wicky candles and false negatives on instruments where icebergs are filled too quickly to show as multi-bar tests. On low-volume instruments the volume gate may need to be raised to compensate.
—
Open source- The five-gate detection pipeline, the ATR-cluster level-builder, the post-test pulse compositor, and the lifecycle-with-archive state machine are proprietary. Free to use; behaviour is fully described above.
—
-made with passion by jackofalltrades
Indicator

Risk Navigator Levels [JOAT]Risk Navigator Levels is an open-source Pine Script v6 overlay that turns confirmed trend-engine flips into a clean visual trade planning map. It draws an entry line, stop line, TP1, TP2, TP3, R-multiple labels, and optional risk/reward boxes after a confirmed setup.
The script is not a full trading system. Its purpose is visual planning: once its internal engine confirms a new long or short state, it freezes the entry, stop, and target levels so the user can inspect structure, distance, and status without manually drawing every line.
Core Concepts
1. Trend Engine Gate
The engine compares a fast EMA, slower EMA basis, ATR gate, and VWAP. A long setup requires the fast line above the basis, price above the upper gate, price above VWAP, and fast-line slope agreement. Shorts use the mirrored logic.
riseReady = fastLine > baseLine and close > upperGate and close > vwapLine and fastLine > nz(fastLine , fastLine)
fallReady = fastLine < baseLine and close < lowerGate and close < vwapLine and fastLine < nz(fastLine , fastLine)
2. Confirmed Direction Change
The script only creates a new level set when the engine direction changes on a confirmed bar.
confirmedLong = barstate.isconfirmed and engineDir == 1 and previousDir != 1
confirmedShort = barstate.isconfirmed and engineDir == -1 and previousDir != -1
3. Stop Selection
The stop is based on recent swing lookback and an ATR floor. This prevents the stop from being unrealistically tight relative to current volatility.
4. R-Multiple Targets
Once risk is calculated, TP1, TP2, and TP3 are plotted as multiples of that risk. The default values are 1R, 2R, and 3R.
5. Status Tracking
After a setup, the script tracks whether the stop or each target has been touched on confirmed bars and updates labels and dashboard status.
Features
Confirmed setup engine: Uses EMA, ATR gate, VWAP, and slope checks
Frozen entry and stop: Levels are created at setup time
TP1, TP2, TP3 targets: Target levels are R-multiple based
Risk/reward boxes: Optional green and red boxes show distance visually
Status labels: Shows whether SL, TP1, TP2, or TP3 has been touched
Right-edge labels: Keeps levels readable without crowding older bars
Dashboard: Shows mode, engine state, R size, targets, and status
Alerts: Setup, stop touch, and target touch conditions
Input Parameters
Visuals:
Palette Preset: Selects color pair
Level Reach Bars: Forward extension of lines and boxes
Risk/Reward Boxes: Toggles the boxes
Engine:
Source: Price source
Fast Length: Fast EMA length
Base Length: Slow EMA basis length
ATR Length: Volatility length
Confirmation Gate: ATR gate around the basis
Risk:
Stop Lookback: Swing lookback used for stop reference
ATR Stop Floor: Minimum stop distance multiplier
TP1 R / TP2 R / TP3 R: Target multiples
How to Use This Indicator
Step 1: Wait for a Confirmed Setup
The script draws a new plan only after its engine direction changes on a confirmed bar.
Step 2: Inspect R Size
The dashboard R size shows the distance between entry and stop. Large R size means the setup requires wider risk.
Step 3: Monitor Touch Status
Labels and dashboard status update when the stop or targets are touched after the setup bar.
Step 4: Use as a Planning Tool
The levels help visualize trade structure. They do not replace account-level risk controls.
Indicator Limitations
This is a visual planning tool, not a complete execution strategy
The engine can produce late signals during fast reversals
Targets are mathematical R levels, not forecasts
A stop touch and target touch can occur in the same bar on some candles; intrabar order cannot be known from closed OHLC alone
Originality Statement
Risk Navigator Levels is original in its integration of a confirmed trend gate, VWAP location, ATR stop floor, frozen R-level drawing system, and live status tracking. It is built as original Pine v6 code for transparent visual planning.
Disclaimer
This script is provided for educational and informational use only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Levels shown by the script are visual research levels and may not match actual execution conditions. Always use independent analysis and proper risk management.
-Made with passion by jackofalltrades
Indicator

Regression Flux Candles [JOAT]Regression Flux Candles
Overview
Regression Flux Candles renders a parallel candle series on top of price using linear regression applied independently to each of the four OHLC components. The result is a noise-filtered "flux candle" — a linearised representation of current price action that removes the erratic intrabar variation of raw candles and reveals the underlying trend direction with far greater clarity. A signal line (SMA of regression close) produces crossover buy/sell signals. Pivot-anchored support/resistance zones mark structural confluence areas. A six-timeframe MTF trend table provides session bias context.
The Linear Regression Candle Concept
Standard Japanese candlesticks display the raw open, high, low, and close of each bar — capturing every tick-driven fluctuation including news spikes, stop hunts, and market-maker manipulation. Linear regression candles replace each OHLC component with the endpoint of a linear regression line fitted over the last N bars:
- LR Open = ta.linreg(open, length, 0)
- LR High = ta.linreg(high, length, 0)
- LR Low = ta.linreg(low, length, 0)
- LR Close = ta.linreg(close, length, 0)
The regression fits a straight line through the last N values of each component and returns the value of that line at the current bar. The resulting candle series is significantly smoother than raw price and acts like a weighted moving average of price structure without introducing the directional lag of traditional MAs. Bullish flux candles (LR close >= LR open) render in teal; bearish in purple.
Signal Line and Crossover Logic
A simple moving average of the LR close (default 7-bar SMA) acts as a signal line. When the LR close crosses above the signal line, a potential buy signal is generated. When it crosses below, a potential sell signal is generated. Crossovers are filtered by:
- Volume filter: Volume must exceed the 20-bar volume SMA (configurable). This ensures signals occur during genuine participation, not thin-market noise.
- RSI filter: Buy signals are blocked when RSI(14) >= 70 (overbought); sell signals are blocked when RSI(14) <= 30 (oversold). This prevents buying into extended moves and selling into oversold conditions.
- Warmup gate: All signals are suppressed until max(LR_length * 3, EMA_length + 5) bars have elapsed. This prevents the statistical noise of early LR calculations from generating false signals.
- Confirmed-bar gate: Signals only fire on barstate.isconfirmed — the final tick of a closed bar — preventing any repainting.
Trend EMA
A 200-period EMA (configurable length) is plotted as a gold line representing the macro trend bias. Position of price relative to the 200 EMA serves as a context filter that traders can apply manually: long signals above the EMA are higher quality, short signals below it are higher quality.
Pivot S/R Zones
Swing pivot highs and lows (configurable left/right bars) generate semi-transparent S/R boxes:
- Resistance zones (from pivot highs): drawn in the bear colour with 89% transparency
- Support zones (from pivot lows): drawn in the bull colour with 89% transparency
Each zone extends forward by a configurable width in bars (default 40) from the pivot bar, or can be extended infinitely to the right. A maximum of 6 zones (configurable) are maintained; older zones are deleted as new ones form.
Daily Signal Counter
The dashboard tracks how many buy and sell signals have fired on the current trading day, resetting at each new daily session (detected via ta.change(time("D"))). This provides a quick intraday reference for signal frequency — useful for understanding whether a session is particularly active or quiet.
Multi-Timeframe Trend Table
Six independently configurable timeframes are assessed using the same linear regression logic: LR close >= LR open on each HTF = bullish; below = bearish. Each cell displays BULL or BEAR in its directional colour. An alignment counter shows how many of the six timeframes agree with the current LR direction. 5+ aligned = strong directional bias (teal); 1 or fewer = strong counter-trend warning (red); middle values show gold.
Inputs Reference
Regression Engine
- LR Length (11) — lookback for all four linear regression calculations
- Signal SMA Length (7) — SMA applied to LR close for crossover signal line
- Trend EMA Length (200) — macro bias reference line
Filters & Signals
- Volume Filter on Signals — require volume > volume SMA
- Volume SMA Length (20)
- RSI Filter on Signals — block overbought/oversold crossovers
- RSI Length (14)
S/R Zones
- Pivot Left/Right Bars (15/10) — pivot detection sensitivity
- Show S/R Zones
- Extend Zones to Right — infinite extension toggle
- Zone Width (40 bars) — forward extension length when not extending to right
- Max Zones to Show (6)
MTF Dashboard
- Show MTF Table
- TF 1–6 — six configurable timeframes (default: 1, 5, 15, 60, 240, D)
Visual
- Bull / Bear Candle Color — OHLC candle colours for flux candles
- Signal Line Color — signal SMA line colour
- EMA Color — trend EMA line colour
- Show Dashboard
How to Use
1. Apply to any liquid market. Use LR length of 9–15 for intraday charts; 20–30 for swing trading.
2. Watch for flux candle colour transitions: a sustained sequence of teal candles above the signal line confirms an uptrend; purple candles below confirm a downtrend.
3. BUY labels appear below the bar when LR close crosses above the signal line with volume and RSI conditions met. SELL labels appear above the bar on crossunders.
4. Prefer signals where the flux candle direction (teal/purple) aligns with the EMA bias AND the MTF table shows 4+ timeframes in agreement.
5. S/R zones from prior pivots serve as target levels and potential reversal points — align entries near these zones for improved risk/reward.
Non-Repainting Design
All signals require barstate.isconfirmed. MTF data uses lookahead_off. LR calculations use only confirmed historical bars (offset 0 is the current bar's regression endpoint based on past data). Signal labels never move after being stamped on a closed bar.
Limitations
- Linear regression candles reduce volatility information. In sharp, impulsive markets, the flux candle series will understate the actual price range. Raw candles should be viewed alongside the indicator for context.
- Short LR lengths (< 7) make the flux candles nearly identical to raw candles; very long lengths (> 30) introduce significant lag into the signal line crossovers.
- The volume and RSI filters may suppress signals during thin trading hours on forex pairs (e.g., Asian session on EUR/USD pairs). Disabling filters during these sessions is a valid adjustment.
- S/R zones are drawn from the pivot confirmation bar, not the pivot bar itself (due to the right-bar confirmation delay). Zone left edges are placed correctly but appear N bars after the actual pivot.
Disclaimer
This indicator is for educational and informational purposes only. Linear regression candles and crossover signals are technical analysis tools and do not predict future price movement. Always use proper risk management and conduct your own analysis.
Made with passion by officialjackofalltrades
Indicator
