Indicator

Previous Day Breakout IndicatorStrategy Breakdown
1.Previous Day Levels: The strategy uses request.security to look up the previous day's high and low prices.
2.Entry Conditions: To trigger an entry, the strategy checks if the current 5-minute bar and the previous 5-minute bar have both closed beyond the previous day's level (either above the high or below the low). To ensure we only enter precisely on the second bar, we check that the bar 2 bars ago did not close beyond the level.
3.Risk Management: Once in a position, the strategy relies on strategy.exit, utilizing the profit and loss parameters which accept points/ticks.
4.Visuals: The previous day's high and low are plotted on your chart for easy visual reference.
I've tightened the logic in the editor to guarantee that the strategy only looks at the previous day's levels and that the breakout explicitly originates from inside the previous day's range.
The entry condition now strictly requires:
1.The candle 2 bars ago was inside the previous day's range (meaning the breakout is fresh).
2.The previous candle (Bar 1) broke out and closed beyond the Previous Day High/Low.
3.The current candle (Bar 2) also closed beyond the Previous Day High/Low.
The strategy doesn't look at any other levels, support/resistance, or indicators.
What I added:
Projected Daily Candle: The script now constructs a visual representation of the Previous Day's candle (complete with the high/low wicks and the open/close body) and projects it to the right of your current price action.
It updates dynamically on the very last bar.
You can control exactly how far ahead it gets drawn via the "Candle Projection Offset (Bars)" input in the settings.
Continuous Levels: The Previous Day High and Low are continuously plotted as solid lines across the chart so you always know where those exact levels sit.
Entry Signals: Since this is now an indicator and not a strategy, I added plotshape() triangles to visualize the exact moments when your 2-bar breakout entry logic fires. Green triangles appear below the bar for Long setups, and red triangles appear above the bar for Short setups.
What's Changed:
1.Support & Resistance Zones: Instead of basic continuous lines, the Previous Day High and Low are now drawn as gray horizontal boxes spanning from the start of the current day extending out into the future, creating support and resistance "zones".
2.Text Labels: I added the Resistance (PDH) and Support (PDL) text labels directly above and below their respective zones, matching the image.
3.Midpoint Dashed Line: A dashed gray line now automatically calculates the exact center between the high and low (pdH + pdL) / 2 and runs horizontally through the entire daily range.
2.Candle Body Box: Instead of a thick line, the body of the projected candle is now constructed using a box with the text "PD" directly in the center, and the wick is a single vertical line running through it.
Now, the indicator will print a signal any time the price crosses and closes beyond either level for two consecutive bars, regardless of direction.
Specifically:
Long Signals (Green Triangle Up): Trigger if price breaks and holds above the Previous Day High OR if price breaks and holds above the Previous Day Low (e.g., crossing back up into the daily range).
Short Signals (Red Triangle Down): Trigger if price breaks and holds below the Previous Day Low OR if price breaks and holds below the Previous Day High (e.g., crossing back down into the daily range, as you highlighted with the red arrow in your image).
This effectively allows you to trade both the true breakouts and the fakeouts/reversions back inside the range! Check out the chart and let me know if those signals align perfectly with what you had in mind.
How it works now:
I added a new setting in the indicator's input menu called "Signal on Bar #". You can now choose exactly how many consecutive closes must happen beyond the line before the triangle signal prints.
Set to 1: The signal triggers immediately on the very first candle that closes outside the Previous Day High/Low.
Set to 2: (Your original request) The signal waits for two consecutive candles to close outside the level.
Set to 3 or 4: The script demands even more confirmation, waiting for 3 or 4 consecutive candles to close beyond the level without dipping back across it.
If the price dips back inside the range before your chosen number of bars completes, the count resets, preventing false signals. You can tweak this setting right from the gear icon to see how it filters the trades on your chart!
Indicator

CP Algo Pro V2.3CP Algo Pro V2
CP Algo Pro V2 is a technical analysis indicator designed to identify high-probability trading opportunities by combining trend, momentum, and market structure.
Features
Automatically detects BUY and SELL signals.
Displays Entry, Stop Loss, TP1, TP2, and TP3.
Supports both Fast and Normal modes.
Automatically adjusts TP/SL based on the selected Symbol and Timeframe.
Allows manual TP/SL customization.
Includes a built-in daily performance dashboard.
Supports multiple markets, including XAUUSD, XAGUSD, BTCUSD, and custom symbols.
Compatible with PulseWire Alerts for Telegram notifications and Webhook integrations.
Dashboard
Total Trades
TP1 Hit
TP2 Hit
TP3 Hit
SL Hit
Win Rate
TP Statistics
Take-profit statistics are calculated based on the highest target actually reached by price:
If price reaches TP1, TP1 is counted.
If price reaches TP2, both TP1 and TP2 are counted.
If price reaches TP3, TP1, TP2, and TP3 are all counted.
Stop Loss is counted only if price has not reached TP1.
This ensures:
TP1 ≥ TP2 ≥ TP3
Performance statistics accurately reflect the actual progression of price movement.
Disclaimer
CP Algo Pro V2 is designed to assist traders with technical analysis and trade management. It should be used alongside proper risk management and independent market analysis before making any trading decisions. Past performance does not guarantee future results. Indicator

Indicator

Indicator

Indicator

[ A L P H A X ] CADENCE - Elliott Wave + Fibonacci + StructureAlphaX CADENCE — Elliott Wave + Fibonacci + Market Structure Engine: Live W2/W4 Golden Zone Pullbacks, W3 Momentum Breakout, RSI Divergence Exit Warnings & Fibonacci Extension Targets
AlphaX CADENCE is a professional-grade Elliott Wave and Fibonacci confluence system built around the most powerful and time-tested framework in technical analysis — the five-wave impulse and three-wave corrective structure that governs institutional price delivery across all timeframes and all markets. Where most Elliott Wave indicators focus on labeling historical waves after the fact, CADENCE is engineered for live trade execution : it identifies the current wave phase in real time, marks the active golden Fibonacci pullback zone, and fires entry signals at the precise moment price enters the optimal entry window with market structure, higher timeframe bias, volume, and momentum confirmation all aligned. Four setup types — Wave 2 Golden Zone, Wave 4 Golden Zone, Wave 3 Momentum Breakout, and ABC Correction End — cover both pullback and breakout entries within the Elliott Wave framework. A dedicated RSI divergence exit warning system alerts you to potential Wave 5 exhaustion before the reversal strikes. Fibonacci extension targets (TP1 at Wave 1 high, TP2 at 1.618× extension) are computed automatically from the identified impulse leg. Designed for traders who want the rigor of Elliott Wave theory applied with quantitative precision, across crypto, forex, gold, and indices on any timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
〰 The Elliott Wave Framework — Why Institutional Price Moves in Waves
Elliott Wave theory is one of the oldest and most institutionally respected frameworks in technical analysis. Its core observation is that market prices do not move randomly — they move in structured, repeating patterns that reflect the collective psychology of all participants. The primary pattern is the five-wave impulse:
Impulse wave structure (bull):
Wave 0 → Wave 1: The initial impulse move — institutions begin accumulating, price moves sharply higher
Wave 1 → Wave 2: The first pullback — retail traders who missed the initial move sell back gains; Wave 2 never fully retraces Wave 1
Wave 2 → Wave 3: The most powerful wave — institutional participation accelerates, Wave 3 is typically the longest and strongest impulse
Wave 3 → Wave 4: A corrective pullback after Wave 3's extension, typically shallower than Wave 2; Wave 4 never enters Wave 1's territory in a valid impulse
Wave 4 → Wave 5: The final impulse leg, often accompanied by declining momentum and RSI divergence as the move exhausts
Why the golden zone matters: Waves 2 and 4 are the pullback waves — the retracement phases where price temporarily retreats before the next impulse. The Fibonacci golden zone (61.8%–38.2% retracement of the prior wave) is where these pullbacks most frequently terminate and reverse. Entering at the golden zone means entering with the lowest possible risk relative to the impulse target — the tight stop is at the wave invalidation level, and the target is the next wave's extension.
CADENCE is built to detect when the market is in a Wave 2 or Wave 4 pullback, when price has entered the golden zone, and when a qualified rejection candle confirms the reversal — producing entries at the statistically optimal Fibonacci reversal level within a confirmed Elliott Wave structure.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌊 The Wave Engine — Pivot-Based Leg Classification
CADENCE uses a real-time swing pivot detection system to classify the current Elliott Wave phase from confirmed price structure. On every bar, confirmed fractal pivot highs and lows are collected into a rolling swing array (configurable depth, default: 8 swings). The alternating sequence of highs and lows is then pattern-matched against Elliott Wave leg configurations.
3-swing classification (W2 phase):
When the three most recent confirmed swings form the pattern Low → High → Low (for bull impulse), CADENCE identifies:
W0 at the first low (impulse origin)
W1 at the high (impulse peak)
W2 in progress at the current low (the pullback)
If W1 is above W0 (valid impulse direction), the wave phase is classified as W2 PULL — the system is watching for the golden zone entry.
5-swing classification (W4 phase):
When five confirmed swings form Low → High → Low → High → Low (bull), CADENCE identifies all five wave points (W0 through W4). When W3 is above W1 (confirming the wave hierarchy) and W1 is above W0, the phase is classified as W4 PULL — the system is watching for the Wave 4 golden zone entry before the final Wave 5 push.
Wave phase display: The current wave phase is displayed prominently on the dashboard as W2 PULL, W4 PULL, CORR, or SCAN. This single row tells you exactly where CADENCE believes the market is in its current impulse cycle.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📐 Fibonacci Golden Zone — The Optimal Entry Window
The Fibonacci golden zone is the price range between the 38.2% and 61.8% retracement of the prior impulse wave. This zone, sometimes called the "golden pocket," represents the most common termination range for corrective waves within a healthy impulse structure.
Wave 2 golden zone calculation:
Zone top = W1 − (W1 − W0) × 38.2%
Zone bottom = W1 − (W1 − W0) × 61.8%
Three Fibonacci levels displayed: 38.2% (dotted), 50.0% (solid, the equilibrium), 61.8% (dotted)
Wave 4 golden zone calculation:
Computed from the W2 → W3 leg rather than the W0 → W1 leg, reflecting that Wave 4 corrects Wave 3 specifically:
Zone top = W3 − (W3 − W2) × 38.2%
Zone bottom = W3 − (W3 − W2) × 61.8%
Golden zone visualization:
A semi-transparent box spans the golden zone from the prior wave's start bar to 15 bars beyond the current bar. Yellow-green for bull zones, red for bear zones. The box extends forward in real time — you can see the target zone approaching as price pulls back toward it.
In-zone detection:
Price is considered inside the golden zone when the bar's low (bull) or high (bear) reaches within the zone boundaries AND the candle closes on the correct side of the zone. The close-inside condition ensures the touch is a genuine rejection from within the zone rather than a pass-through.
Live Fibonacci levels:
The 38.2%, 50%, and 61.8% retracement lines are plotted from the Wave 1 pivot bar to 15 bars beyond current, updating in real time as the wave structure develops. The 50% line is plotted as a brighter solid line — the golden pocket midpoint.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏷 Four Live Setup Types
CADENCE fires signals through four distinct entry setups, each targeting a specific phase of the Elliott Wave cycle. Each has different risk/reward characteristics and different position within the wave sequence.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
W2 Golden Zone — Wave 2 Pullback Entry
The most frequent high-conviction setup. Fires when price retraces into the 38.2%–61.8% golden zone of Wave 1 during an identified Wave 2 correction.
Full conditions for long:
Bull impulse identified (three-swing pattern W0→W1→W2)
Wave phase is W2 PULL
Market structure is bullish (or HTF is bullish as a fallback)
The bar's low has entered the golden zone (between 38.2% and 61.8% retracement)
The bar closes above the zone bottom — confirming rejection, not breakdown
Wave 2 (the pullback) is holding above Wave 0 (the impulse origin) — the Elliott Wave rule that W2 never fully retraces W1 is validated
The impulse leg (W1 − W0) is at least the minimum size (default: 1.0× ATR) — filtering micro-waves
A qualifying bull trigger candle (rejection wick above 48% of range or bullish engulfing) is present
Stop placement: Below the minimum of W2 and W0 (the prior impulse origin) plus the ATR buffer. If price violates Wave 0, the impulse structure is invalid by Elliott Wave rules.
Targets: TP1 at W1 (the prior wave high); TP2 at the close plus 1.618× the impulse leg distance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
W4 Golden Zone — Wave 4 Pullback Entry
The higher-conviction pullback setup. Wave 4 occurs after Wave 3 — the strongest and longest wave — has completed. The W4 correction offers the final opportunity to enter before Wave 5.
Key differences from W2:
Requires confirmed market structure (structure == 1 for bull, not just HTF fallback) — Wave 4 entries demand structural confirmation
Golden zone is computed from the W2 → W3 leg (correcting Wave 3, not Wave 1)
Requires five confirmed swings (W0 through W4) — a more mature wave count
Why W4 is high-conviction: By the time a Wave 4 is identifiable, the impulse sequence has completed three waves with Wave 3 confirming above Wave 1. The institutional participants who accumulated during Wave 2 are in strong profit and will add to positions during Wave 4. The golden zone for Wave 4 is the most actively defended pullback level in the entire five-wave sequence.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
W3 Momentum Breakout — Wave 3 Entry
The highest-momentum setup. Fires when price breaks above the Wave 1 high (bull) or below the Wave 1 low (bear) during a Wave 2 or Wave 4 pullback phase — the moment Wave 3 begins.
Long conditions:
Wave phase is W2 PULL or W4 PULL (the correction is completing)
Price closes above the last identified swing high (the Wave 1 level) in a single bar
The prior bar was at or below the breakout level
Market structure is bullish
Impulse leg size meets the minimum threshold
The W3 breakout philosophy: The Wave 3 breakout is the moment institutional participation accelerates explosively — the "Wall of Worry" is cleared and the crowd that was short begins covering. Entering at this exact bar captures the beginning of the fastest and largest wave of the impulse. The risk is paying a higher price than the golden zone pullback entries, but the momentum confirmation is unambiguous.
Target for W3 entries: TP1 is at entry + the full impulse leg distance (projecting a Wave 3 equal to Wave 1); TP2 is at the 1.618× extension.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ABC Correction End — Three-Wave Reversal Entry
The counter-trend corrective setup. Disabled by default — the lower-conviction alternate wave scenario. Fires when a three-wave ABC correction retraces to the 61.8% level of the prior impulse with a rejection candle.
ABC conditions (bull):
Three-swing pattern confirms an ABC correction structure (Low → High → Low within a bull structure)
Price reaches the 61.8% retracement of the A leg from the B peak
Close recovers back above the 61.8% level
Bull trigger candle confirms
Why ABC is off by default: ABC entries are counter-corrective — they attempt to catch the end of a pullback at a single Fibonacci level without the full five-wave context. They work well when the prior impulse was clean and the ABC is proportional, but carry higher failure rates in choppy or range-bound conditions. Enable this setup only after studying its behavior on your specific instrument and timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ W5 RSI Divergence Exit Warning System
One of CADENCE's most valuable risk management features is the dedicated Wave 5 exhaustion detection system. When price is making new highs in a bull structure but the RSI is simultaneously making lower highs — a classic bearish divergence — the system plots small orange circles above the relevant bars as exit warnings.
How the divergence is detected:
Using confirmed pivot highs and lows from both price and RSI, CADENCE identifies:
Bearish divergence (bull W5 exhaustion): Price's pivot high exceeds the prior pivot high, but RSI's corresponding pivot is below its prior reading — price strength is not confirmed by momentum
Bullish divergence (bear W5 exhaustion): Price's pivot low is below the prior low, but RSI's reading is above its prior — selling momentum is fading at lower prices
Why W5 divergence is the most important Elliott Wave exit signal: Wave 5 is structurally the most exhausted wave — it occurs after four prior waves have already moved in the impulse direction, and is frequently accompanied by declining institutional participation. RSI divergence at Wave 5 is the most reliable early warning of the corrective ABC wave that follows. The small orange circles appear at the divergence bars — not blocking entry signals (divergence can persist for multiple bars) but providing continuous awareness that the impulse is aging.
These exit warnings fire separate alert conditions — CADENCE W5 Exit Bear and W5 Exit Bull — allowing you to set targeted notifications that prompt profit-taking on active wave trades.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 The 10-Layer Confluence Engine
Every setup is scored through a 10-layer confluence system. The default minimum is 4 of 10, producing a relatively permissive signal environment. Raising the minimum to 6–7 restricts signals to the highest-conviction wave setups only.
Layer 1 — Market Structure (1 point):
The current market structure state (bull or bear from the BOS/CHoCH engine) aligns with the signal direction. A W2 Golden Long in a bullish structure scores this point. A W2 Golden Long against a bearish structure does not.
Layer 2 — Fibonacci Zone (1 point):
Price is inside the applicable golden zone (W2 zone for W2 entries, W4 zone for W4 entries). For W3 and ABC entries, this layer is always credited since those setups do not require Fibonacci zone confirmation.
Layer 3 — Trigger Candle (1 point):
A qualifying bull or bear trigger candle is present — either a rejection pin bar (lower wick above 48% of range for bull) or a bullish engulfing. For W3 momentum entries, this layer is always credited since the breakout bar itself is the trigger.
Layer 4 — HTF Bias (1 point):
The higher timeframe EMA structure agrees with the signal direction. Can be set as a hard block (requireHtf = on) or as a soft scoring layer (default: off). When HTF is disabled, this layer awards 1 neutral point.
Layer 5 — Volume Expansion (1 point):
Current bar volume exceeds the volume moving average by the configured multiplier (default: 1.1×). Confirms institutional participation on the entry bar.
Layer 6 — Non-Chop Market (1 point):
Choppiness Index is below the configured threshold. Also enforced as a hard gate — extreme chop blocks all signals regardless of wave count quality.
Layer 7 — RSI Zone (1 point, optional):
RSI is in the appropriate zone for the signal direction — above the minimum for longs (default: 38), below the maximum for shorts (default: 62). Off by default — when enabled, adds a momentum context filter.
Layer 8 — EMA Trend Filter (1 point, optional):
Price is on the correct side of the configurable EMA. Off by default — when enabled, adds a trend alignment filter.
Layer 9 — RSI Momentum (1 point, optional):
RSI is actively rising (bull) or falling (bear) on the current bar — momentum is accelerating in the signal direction. Off by default.
Layer 10 — Base Credit (1 point):
A flat credit awarded to all qualifying setups — the minimum point that acknowledges the setup type itself has passed its structural requirements. This ensures that even with optional filters disabled, the maximum achievable score is 10.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Fibonacci Extension Targets — Automatic TP Calculation
Every CADENCE signal produces two automatically computed take profit levels based on the identified impulse wave measurement.
TP1 — Wave 1 High / Wave Projection:
For W2 and W4 golden zone entries, TP1 is set at the prior Wave 1 level — the high that preceded the current pullback. This is the minimum structural target: the expectation that Wave 3 or Wave 5 will at least reclaim Wave 1's high. For W3 momentum entries, TP1 is set at entry plus the full impulse leg distance (Wave 3 = Wave 1 in length).
TP2 — 1.618× Extension:
The primary Fibonacci extension target, computed as `entry + impulse_leg × 1.618`. The 1.618 extension (the Golden Ratio) is the most common Wave 3 termination level and a standard Wave 5 target when Wave 3 is extended. This level is configurable (default: 1.618, range: 1.0–2.618).
Visual output: TP1 is plotted as a lime-green dotted line. TP2 is plotted as a bright yellow-green dashed line at width 2. Both extend forward by the configured guide bars (default: 35). The stop loss is plotted as a red dotted line below the wave invalidation level plus ATR buffer.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Live Dashboard
The 9-row real-time dashboard displays the complete wave analysis state.
Wave Phase — W2 PULL, W4 PULL, CORR, or SCAN. The current position within the Elliott Wave cycle. Purple color
Structure — BULL MS (bullish market structure), BEAR MS (bearish), or RANGE (no clear structural direction)
Setup — the current or most recent setup name: W2 GOLDEN, W4 GOLDEN, W3 BREAK, ABC END, ARM LONG (golden zone approached but not yet triggered), ARM SHORT, or —. Color-coded by directional bias
Layers — the current confluence score out of 10. Yellow-green when at or above the minimum threshold
Chop — live Choppiness Index value. Yellow-green when clear, red when above the stand-aside threshold
TP1 — the current or most recent TP1 level. Shows — between signals
TP2 — the current or most recent TP2 level
HTF — the higher timeframe EMA bias: UP, DOWN, or MIX
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Chart Visual System
Live Wave Path Lines — lines connecting the most recent confirmed swing pivots, color-coded yellow-green for bull impulse and red for bear impulse. Shows the current wave sequence structure directly on the price chart
Golden Zone Box — semi-transparent box spanning the 38.2%–61.8% Fibonacci retracement zone from the prior wave. Yellow-green for bull, red for bear. Extends 15 bars forward and updates in real time as the wave structure evolves
Fibonacci Levels — three horizontal dotted/solid lines at 38.2%, 50%, and 61.8% retracement from the Wave 1 pivot bar. The 50% level is the brightest solid line — the golden pocket center
▲ Triangle (below bar, bright yellow-green) — bull entry signal. W2 Golden, W4 Golden, W3 Breakout, or ABC End
▼ Triangle (above bar, bright red) — bear entry signal
● Orange Circle (above bar) — W5 bearish RSI divergence exit warning
● Orange Circle (below bar) — W5 bullish RSI divergence exit warning
Entry Line (bull/bear color dashed) — entry close level extending guideExtend bars forward
Stop Loss Line (red dotted) — structural stop below wave invalidation level plus ATR buffer
TP1 Line (lime dotted) — first target at Wave 1 high or equal-leg projection
TP2 Line (bright yellow-green dashed, width 2) — 1.618× Fibonacci extension target
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Trade with AlphaX CADENCE — Step by Step
Step 1 — Read the Wave Phase
Check the Wave Phase row on the dashboard. W2 PULL or W4 PULL means the system has identified a valid pullback phase — a setup may be approaching
Confirm Structure — BULL MS for long setups, BEAR MS for short. If Structure shows RANGE, the wave context is weaker
Check the golden zone box on the chart. Is it near current price? Is price approaching from above (bull W2 pullback)?
Step 2 — Watch the Golden Zone Approach
When Setup shows ARM LONG, price is approaching the golden zone. Watch for a rejection candle forming inside or at the zone boundary
Check Layers — if it is approaching the minimum threshold, a signal is likely imminent. Check HTF to confirm the macro direction
The Fibonacci levels on the chart show the exact 38.2%, 50%, and 61.8% prices — monitor for price rejection specifically at the 61.8% level (the deepest golden zone entry) for the highest-conviction golden pocket entry
Step 3 — Enter on the Triangle Signal
A ▲ triangle below the bar confirms all wave, Fibonacci, structural, and confluence conditions are met simultaneously. The setup name shows on the dashboard (W2 GOLDEN, W4 GOLDEN, W3 BREAK, ABC END)
The SL line is at the structural wave invalidation level — if price closes below Wave 0 (W2 entries) or below Wave 2 (W4 entries), the Elliott Wave count is invalid. This is a structural stop, not arbitrary ATR
TP1 is at the prior Wave 1 high — the minimum expectation for the next impulse wave
TP2 is at the 1.618× Fibonacci extension — the classical Wave 3 or Wave 5 termination level
Step 4 — Monitor for W5 Exit Warnings
As price advances toward TP2, watch for the orange W5 exit warning circles appearing above (bear divergence) or below (bull divergence) price bars
When orange circles begin appearing regularly as price approaches TP2, consider taking full profit rather than holding for further extension
A W5 divergence warning combined with price near TP2 is the strongest exit signal the system produces
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Identifying Low-Quality Conditions — When Not to Trade
Stand aside when:
Wave Phase shows SCAN or CORR — the system has not yet identified a clear impulse structure with sufficient pivot history. SCAN means fewer than 3 qualified swings are stored; CORR means the three-swing pattern does not satisfy the impulse directional rules. Do not force entries without clear wave context
Chop Index is red on the dashboard — the hard chop gate is active. Elliott Wave patterns are fundamentally trend-following structures and lose their predictive power in extreme chop. All signals are blocked
Structure shows RANGE — no clear bullish or bearish market structure is established. W2 and W4 golden zone entries without structural support are lower quality. Consider waiting for a CHoCH or BOS to establish directional structure before entering
Layers score is at minimum (4/10) with all optional filters disabled — the bare-minimum score means only the most basic conditions are met. In this environment, require a higher layer count (increase minimum to 5–6) or wait for more confluence factors to align
W5 exit warnings are already appearing when entering — if orange circles are appearing before a new entry signal fires, RSI divergence is already present. This suggests the wave is potentially in a late W5 stage rather than a healthy W2 or W4. Do not enter a new position when existing divergence warnings are active
Golden zone is very narrow (W4 zone nearly coincides with stop) — when the 38.2% and 61.8% levels are very close together (small Wave 3 leg), the golden zone provides minimal entry edge. The risk/reward is poor when the zone height is less than 0.5× ATR
The ideal CADENCE setup:
Wave Phase W4 PULL with confirmed 5-swing structure
Market structure BULL MS or BEAR MS — clear directional bias
Price at or near the 61.8% golden zone boundary — the deepest valid pullback
HTF aligned with impulse direction
Volume expanding on the rejection bar
Layers at 7–8 out of 10
No W5 divergence warnings on the current sequence
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features
〰 Real-time Elliott Wave classification — 3-swing (W2 phase) and 5-swing (W4 phase) pattern matching from confirmed fractal pivots, updated on every bar
📐 Adaptive Fibonacci golden zone — 38.2%–61.8% retracement zone computed from the current wave's impulse leg, rendered as a live box and three labeled levels updating in real time
📦 Live wave path visualization — lines connecting the most recent confirmed swing pivots, color-coded by impulse direction, showing the current wave sequence structure
🏷 Four setup types — W2 Golden Zone, W4 Golden Zone, W3 Momentum Breakout, and ABC Correction End (optional) — covering both pullback and breakout entries within the wave framework
📈 Fibonacci extension targets — TP1 at the Wave 1 high (minimum wave projection), TP2 at the configurable Fibonacci extension (default: 1.618×) automatically computed from the identified impulse leg
⚠ W5 RSI Divergence Exit Warning — pivot-based RSI divergence detection produces orange warning circles as price approaches potential Wave 5 exhaustion, with dedicated alert conditions
🧠 10-layer confluence engine — Market Structure, Fibonacci Zone, Trigger Candle, HTF Bias, Volume, Non-Chop, RSI Zone, EMA Filter, RSI Momentum, and Base Credit scored independently
🛡 Wave-anchored structural stop — SL placed below the Elliott Wave invalidation point (Wave 0 for W2 entries, Wave 2 for W4 entries) plus ATR buffer — not an arbitrary distance
📊 Live dashboard — Wave Phase, Structure, Setup, Layers, Chop, TP1, TP2, and HTF updated on every bar
📡 JSON alerts on FIRED — structured alert payload with weapon, side, setup name, entry, SL, TP1, TP2 for webhook integration
🔔 4 alert conditions — CADENCE Long, CADENCE Short, W5 Exit Bear Warning, W5 Exit Bull Warning
⚙ Fully configurable — pivot length, minimum leg size, Fibonacci zone levels, extension target, RSI divergence settings, all four setup enables, confluence minimum, HTF parameters, all optional filters, chop gate, SL buffer, guide bars, wave path and golden box display, dashboard size, and all colors are independently adjustable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
Wave Engine
Swing Pivot Length — fractal sensitivity for pivot detection (default: 5)
ATR Length — ATR calculation lookback (default: 14)
Min Leg Size (xATR) — minimum impulse leg height in ATR multiples for wave classification (default: 1.0)
Swings Stored — rolling swing array depth (default: 8)
Fibonacci Zones
Pullback Zone Low (Fib) — lower Fibonacci level of the golden zone (default: 0.382)
Pullback Zone High (Fib) — upper Fibonacci level (default: 0.618)
TP2 Extension — Fibonacci extension level for the full measured move target (default: 1.618)
Show Active Fib Levels — toggle the 38.2%, 50%, and 61.8% horizontal lines
Market Structure
BOS: Close Only — when on, structure breaks require a close beyond the swing level (default: on)
Live Setups
W2 / W4 Golden Pullback — toggle both golden zone entry setup types
W3 Momentum Breakout — toggle the Wave 3 breakout entry
ABC Correction End — toggle the corrective three-wave reversal entry (default: off)
W5 RSI Divergence Exit Warn — toggle the exit warning system
RSI Length — RSI calculation period (default: 14)
Divergence Lookback — bars for pivot-based RSI divergence detection (default: 14)
Confluence
Min Layers (of 10) — minimum score to fire a signal (default: 4)
Hard HTF Alignment — when on, counter-HTF signals are blocked (default: off)
HTF Trend Bias / HTF Timeframe / HTF Fast / HTF Slow EMA — higher timeframe parameters
Volume Confirm / Volume vs Avg / Volume Avg — volume expansion layer parameters
RSI Momentum Filter — optional RSI direction filter (default: off)
RSI Min (Long) / RSI Max (Short) — RSI zone thresholds when filter is enabled
EMA Trend Filter / EMA Length — optional EMA directional filter (default: off)
Block Extreme Chop / Choppiness Length / Chop Block Above — chop gate parameters
Signal Cooldown (bars) — minimum bars between signals (default: 8)
Entry / Exit Guides
Show SL + TP1 + TP2 — toggle the guide lines
SL Buffer (xATR) — ATR buffer beyond the wave invalidation point (default: 0.25)
Guide Extend (bars) — how many bars forward the guide lines project (default: 35)
Display
Show Live Wave Path — toggle the swing-to-swing connecting lines
Show Golden Zone Box — toggle the Fibonacci retracement zone box
Show Entry Markers — toggle signal triangles
Show Dashboard — toggle the full dashboard
Dashboard Text Size — Standard / Small
Dashboard Position — Top Left / Top Right / Bottom Left / Bottom Right
Colors
Bull / Wave Up — yellow-green for bullish waves, signals, and zones
Bear / Wave Down — red for bearish elements
Fib / Wave Accent — purple for Fibonacci levels, wave path, and neutral zone elements
W3 / Exit Accent — orange for W3 breakout accents and W5 exit warning markers
Stop Line / TP1 Line / TP2 Line — individual guide line colors
Dash Text / Dash BG / Dash Header / Dash Section / Dash Frame — full dashboard color control
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions (4 total + JSON)
Entry Alerts
CADENCE Long — all wave, Fibonacci, structure, and confluence conditions confirmed. JSON payload delivered with setup, entry, SL, TP1, TP2
CADENCE Short — all conditions confirmed for a short wave setup. JSON payload delivered
Exit Warning Alerts
CADENCE W5 Exit Bear — bearish RSI divergence detected at a price pivot high in a bull structure. Wave 5 exhaustion may be approaching
CADENCE W5 Exit Bull — bullish RSI divergence detected at a price pivot low in a bear structure
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Recommended Settings by Instrument & Timeframe
The default configuration is optimized for XAUUSD, major forex pairs, and crypto on M15–H4 :
Pivot Length at 5 — captures meaningful structural swings without excessive sensitivity on intraday timeframes
Min Leg Size at 1.0× ATR — filters micro-waves while capturing the significant legs that represent genuine Elliott impulses
Fibonacci zone from 38.2% to 61.8% — the classic golden zone that encompasses the highest-probability pullback termination range
HTF at 60-minute as a soft scoring layer — adds confluence when aligned without hard-blocking the counter-HTF wave setups that occasionally occur at institutional correction boundaries
ABC Correction End off by default — the corrective pattern carries more interpretation risk and is better enabled only when the user has studied Elliott corrective structures
For other instruments or timeframes, adjust:
M1–M5 scalping — reduce Pivot Length to 3, reduce Min Leg Size to 0.5, increase Cooldown to 5–6 bars, reduce Guide Extend to 15–20
H4–Daily swing trading — increase Pivot Length to 8–10, increase Min Leg Size to 1.5–2.0, increase TP2 Extension to 2.0–2.618, increase Min Layers to 5–6
Crypto (BTC, ETH) — increase Min Leg Size to 1.5 for the larger swing amplitudes, increase Fibonacci zone to 0.382–0.786 for the deeper corrections common in crypto waves
Higher confidence signals only — raise Min Layers to 6–7, enable Hard HTF Alignment, enable EMA Trend Filter and RSI Momentum Filter, disable ABC Correction End
More signals — lower Min Layers to 3, enable ABC Correction End, disable Volume Confirm, reduce Min Leg Size to 0.5
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
〰 Elliott Wave traders — CADENCE is the definitive quantitative implementation of the Elliott Wave trading framework for the AlphaX suite. Every component — swing identification, wave phase classification, golden zone computation, wave invalidation stop, Fibonacci extension target — is automated and applied consistently
📐 Fibonacci traders who want wave context — the Fibonacci zone in CADENCE is not a standalone level but a wave-specific retracement within a confirmed impulse structure. This context dramatically improves the reliability of Fibonacci entries compared to drawing retracement levels manually without wave classification
🎯 Pullback traders — the W2 and W4 golden zone setups are fundamentally the most optimal pullback entry in all of technical analysis — buying the deepest valid retracement within a confirmed trend impulse, with a stop at the structural invalidation point
⚡ Momentum traders — the W3 Momentum Breakout entry targets the beginning of the fastest and largest wave of the impulse sequence, providing explosive breakout entries within a wave-confirmed context
🧠 Systematic traders who want quantified wave analysis — the 10-layer scoring system and deterministic pivot-based classification replace the subjectivity of traditional Elliott Wave labeling with objective, repeatable criteria
📈 Traders who struggle with knowing when to exit trending trades — the W5 RSI divergence exit warning system provides early, systematic notification of impulse exhaustion — the most common and costly mistake in Elliott Wave trading is riding Wave 5 too long
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
All signals are confirmed on bar close — the indicator is non-repainting by design. Pivot detection, wave classification, Fibonacci zone computation, and confluence scoring all finalize on confirmed bars only
Elliott Wave classification requires a minimum of 3–5 confirmed swings in the rolling array. On charts with fewer than 200 bars of history, the wave phase may show SCAN until sufficient pivot history accumulates
The wave path lines and golden zone box are redrawn on the last bar only for chart performance. Historical signal triangles and exit warnings are preserved on their original bars
The minimum leg size filter (default: 1.0× ATR) ensures that only waves with meaningful price movement are classified. Very small swings below the ATR threshold are ignored by the wave engine, preventing micro-structure noise from producing false wave counts
The W5 divergence detection uses pivot-based RSI comparison with a configurable lookback. The detection is based on confirmed pivots and is non-repainting, but the divergence signal appears at the confirmation bar (pivLen bars after the actual pivot), not at the pivot bar itself
When both W2 and W4 conditions are simultaneously met (a rare occurrence in transition periods), W4 takes priority in the signal selection because W4 entries occur in more mature, structurally confirmed wave counts
The indicator does not automatically label historical waves — it focuses on the live wave phase and active entry setups. For historical wave labeling, combine with a standalone Elliott Wave labeling tool
The indicator does not track open positions or P&L and does not connect to any broker or account
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All signals are generated from historical and real-time price data using mathematical calculations — their accuracy or profitability is not guaranteed. Past performance of any signal type does not guarantee future results. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who understand that markets move in waves — and who want a system precise enough to position them at the exact Fibonacci level where the next wave begins. Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

ICT Setup DetectorICT SETUP DETECTOR (ICT-SD)
A mechanical, bias-gated ICT setup scanner for NQ and ES futures intraday
(built and tuned on the 1-minute chart). It marks liquidity, draws the key
daily/session levels, grades directional bias across three timeframes, and
arms four ICT trade setups with fixed targets, stops, and alerts.
This is an INDICATOR, not a strategy — it places no orders. It draws on the
chart and fires alert() messages so you can act (or forward them to a bot).
------------------------------------------------------------
WHAT IT DRAWS
------------------------------------------------------------
LEVELS
- PDH / PDL — previous day high & low
- Overnight H / L — 18:00 to 09:30 ET range
- Midnight Open (00:00 ET) and RTH Open (09:30 ET)
- ORG — Opening Range Gap zone (prior RTH close to today's RTH open)
- Prior Week H / L
BIAS ENGINE (top-right table)
- Reads three timeframes (default 4H / 1H / 15m) plus the ORG gap state
- Modes: Structure (pivot HH/HL), Momentum (EMA 20 vs 50 + close), or Hybrid
- Produces a gate: "Longs OK", "Shorts OK", or "NO TRADE"
- When the gate is on, setups only arm in the permitted direction
KILLZONES (shaded)
- London 03:00-04:00, NY AM 10:00-11:00, NY PM 14:00-15:00 (NY time, DST-aware)
LIQUIDITY SWEEPS
- BSL/SSL grabs of PDH/PDL/ON H/L (breach within N bars + close back through)
- Red "BSL" / green "SSL" triangles
TRADE SETUPS (each has arm -> entry -> exit with TP / SL / time-stop)
- Silver Bullet — sweep, then FVG + displacement inside a killzone
- OTE — 62-79% fib retrace of a swept leg
- OB+FVG — order-block 50% mitigation behind a displacement FVG
- Sweep Reversal (SR) — simple sweep-and-fade scalp (yellow SR-L / SR-S)
15-MINUTE FVG IDENTIFIER
- 3-bar Fair Value Gaps from the 15m timeframe, drawn on your chart
- Non-repainting (only confirmed/closed 15m candles create a box)
- Teal = bullish gap, red = bearish gap, with a dashed CE (mid) line
- Boxes extend right until price fully fills the gap, then freeze/grey
------------------------------------------------------------
HOW TO USE
------------------------------------------------------------
1. Add to an NQ or ES chart on the 1-minute timeframe (point sizing is
auto-detected from the ticker; other symbols fall back to NQ values).
2. Check the bias table (top-right) for the current gate state before acting.
3. Wait for a setup flag/label to arm in the gate-allowed direction. Each
setup shows its FVG/zone box, dashed entry (CE), dotted stop, dotted TP.
4. Targets default to +20 pts (NQ) / +15 pts (ES). Setups auto-skip when the
required stop is wider than the configured max.
5. To get notified: create an alert on this indicator and choose the
"Any alert() function call" condition. Enable the alert types you want
in the Alerts group (armed / entry / exit / bias-flip / new 15m FVG).
------------------------------------------------------------
KEY SETTINGS
------------------------------------------------------------
- Bias gate on/off, and Bias mode (Structure / Momentum / Hybrid)
- Enable/disable each setup individually
- Displacement filter: x ATR(20) and optional volume-spike requirement
- Sweep breach window (how many bars a wick may lead the close-back)
- Targets and "skip if stop >" caps (per NQ / ES)
- Killzone session times, colors, and visualization toggles
- 15m FVG: timeframe, min gap size, CE line, extend-until-mitigated,
remove-vs-grey on fill, max active gaps, and per-direction colors
TUNING
- Too few signals: set Bias mode to Momentum, turn the bias gate off, or
lower the displacement volume multiplier toward 1.0
- Too many signals: raise Displacement x ATR to ~2.0, raise the volume
multiplier to 1.5-2.0, or raise the minimum FVG size
------------------------------------------------------------
NOTES
------------------------------------------------------------
- Designed for NQ/ES on the 1m chart; other symbols/timeframes are untested.
- Live intrabar markers (especially Sweep Reversal) can update until the bar
closes; all alerts fire on bar close, so alerts are stable.
- Educational tool. Not financial advice. Test before trading live.
```
Want me to:
- **Trim it to a short version** (a few lines) for the tooltip/one-liner, or
- **Save it to a file** in the repo (e.g. `pine/ICT-SD-description.txt`) alongside the source? Indicator

DELTA Go Desk**DELTA Go Desk** is a multi-stack signal dashboard and trade management system built for active traders of leveraged ETFs, stocks, crypto, and metals. It's not a single indicator — it's a coordinated decision engine with validated research behind every default setting.
* * *
## 🧠 It knows what you're trading
Load it on SOXL and it automatically applies leveraged ETF parameters — tighter SL multipliers, breakeven ratchet ON, trail mode active. Switch to BTCUSD and it shifts to crypto mode with wider ATR-based stops. Move to AAPL and it routes to stock presets. No manual reconfiguration. The instrument tells the system how to behave.
Auto-routing covers **90+ tickers** including 67 leveraged ETFs, precious metals miners, and full crypto detection via `syminfo.type`.
* * *
## 📊 Three-Stack Signal Architecture
Three independent signal stacks fire from orthogonal indicators — meaning they're built from different data sources so they don't all agree or disagree for the same reason:
* **Stack A** — Primary signal. Full SL/TP/trail labels on chart.
* **Stack B (👀)** — Scout. Confirms or questions Stack A. Configurable label detail.
* **Stack ST** — Structural filter. Trend-aligned bias layer.
Stacks are scored 1–4. An **S-Grade** fires when all three stacks align — the highest-conviction setup the system recognizes.
* * *
## 📐 Exit Architecture Validated by Research
DELTA's exits aren't defaults — they're the result of systematic Python/yfinance backtesting across thousands of trades. Key validated findings:
| Finding | Implication |
| --- | --- |
| Exit management > entry selection | All profitable behavior concentrated in 11+ bar holding bucket |
| ATR-adaptive trailing beats fixed stops | Tested across SOXL, TQQQ, AAPL, AG |
| Random entries matched disciplined entries on exit alone (RESE test) | The edge lives in *how* you exit, not *when* you enter |
| ADX floors do not fix chop | Zero winners at every threshold tested — trend-strength gating closed |
| SOXL's edge is contrarian/early-reversal | Inverse HTF gate is the correct architecture |
Three exit modes: **Traditional** (fixed SL/TP), **Fixed Trail**, and **Adaptive Trail** (ATR-multiplier that widens progressively as the trade matures).
* * *
## 🏗️ What's Built In
* **236 tooltips** — every input documented in WHAT / USE / TIP format
* **44+ confirmation indicators** — organized by type (Momentum / Trend / Structure / Breadth / Volume / Volatility)
* **Live Trade Tracker** — dashboard rows show active TP/SL prices, distance %, breakeven lock status, and direction in real time
* **Trail Alert Suite** — webhook-ready payloads for BE_LOCKED, SL_MOVED, and TRAIL_EXIT events (Telegram or broker bridge)
* **Switchboard** — toggle overlays on/off (EMA, VWAP, PVSRA candles, Pivot Levels, Price Targets, FVG, Liquidity Zones) without touching settings
* **PVSRA Candles** — volume-spread analysis candle override; climax and rising volume highlighted
* **Clean Capture Mode** — second indicator instance suppresses all overlays for clean screenshot export
* **Regime + ADX Filter** — bottom dashboard row shows STRONG/drift regime and live ADX value with configurable threshold
* * *
## 📌 Designed for Seriousness
Every version number is documented. Every default has a research citation. Every removal has a reason. This isn't a set-and-forget indicator — it's a live trading system under active development, with systematic backtesting continuously refining the edge.
The goal: the indicator does the heavy lifting. You make the call.
* * *
*Built by PJ_FatCat — //@PJ_FatCat · DELTA Trading**Base: "DIY Custom Strategy Builder" by zpayab (open-source)**Quantitative research: Silvia (systematic Python/yfinance backtesting engine) Indicator

CRT H4 NomadaScalper [Mntdude65]This is CRT EDGE · H4 · NomadaScalper
Candle Range Theory (CRT) — timed H4 candles, multi-timeframe Turtle Soup, and a self-scoring probability dashboard, built on John Tracy's Time-Based Trading Blueprint.
OVERVIEW
This indicator builds the three timed 4-hour candles the CRT model keys on, maps out the previous candle's high/low across five timeframes (Monthly, Weekly, Daily, H4, H1) with automatic Turtle Soup detection, and scores every setup against the chart's own history — so instead of eyeballing whether "CRT usually works," you get a running, self-updating win-rate for every slot, every session.
Everything is clock-aggregated from the chart's own bars (not repainted from a higher-timeframe security() call), so it stays exact on symbols like CME futures where the native exchange H4 bars don't open at 1/5/9 — the script detects the real native H4 phase and snaps the slots to it automatically.
WHAT IT DRAWS
Timed H4 Candles
— Three 4-hour clock-window candles per day (auto-aligns to 1AM/5AM/9AM on forex-style symbols, 2AM/6AM/10AM on CME futures — matches the real H4 candles Tracy reads, not just a fixed clock guess).
— Full anatomy: range box, body box (bullish/bearish), CRT-High / CRT-Low / 50% lines projected forward with price labels.
— Dashed while forming live, frozen solid at the close.
— Configurable projection window, history depth, and manual override hours if you don't want native alignment.
HTF CRT Levels + Turtle Soup (Tracy multi-timeframe bias)
— Draws the previous completed candle's high/low for Monthly, Weekly, Daily, H4, and H1, each in its own color.
— A Turtle Soup latches when a confirmed candle wicks beyond one of these levels and closes back inside — once per side, per period.
— Bias engine: 3 or more timeframes souped at the lows = BULLISH bias · 3+ at the highs = BEARISH bias · both = CONFLICT (Tracy's rule: stand aside).
— Faded gray "ts·" tags mark these sweeps on the chart, color-coded so you can tell direction at a glance without reading the text: faded red = a high was swept, faded green = a low was swept. Toggle on/off independently.
CRT Box Sweep (★TS)
— A second, distinct sweep detector focused specifically on the CRT box itself (the timed H4 candle's own range), not the HTF levels.
— Marks every candle — not just the first — that wicks beyond the box's high or low and closes back inside, live while the sweeping candle is still forming and finalized the moment it confirms.
— Bold gold "★TS" tag with a user-selectable color, separate toggle from the HTF Turtle Soup marks above.
Session Ranges (Tracy step 3)
— Asia range (8PM–12AM NY) and P12 range (6PM–6AM NY), boxed with the high/low projected forward — a secondary confirmation check against the CRT bias.
CRT EDGE DASHBOARD
A self-computing panel, split into two clearly labeled sections:
LIVE — what has actually happened, right now, on this chart:
— CRT BOX: has this slot's box been swept yet? ▼ red = the box HIGH was swept (bearish) · ▲ green = the box LOW was swept (bullish) · — = neither side yet.
— STATUS: this cycle's live state — forming… / armed · waiting purge / ↓ purged (bearish, high swept) / ↑ purged (bullish, low swept), plus whether price has reached the 50% and/or the full opposite extreme.
HISTORICAL ODDS (all-time %) — a running backtest, not a live target:
— ↑→50% / ↑→HIGH: of all the times this slot's low was purged FIRST (bullish), what % of the time did price also reach the 50% / fully deliver to the CRT-High before the projection window expired.
— ↓→50% / ↓→LOW: the mirror image for a high-purge-first (bearish) scenario.
— Heat-colored by win rate, with a low-sample warning (amber) under 8 occurrences.
Plus a top-line VERDICT row (Tracy's 3+/5 bias rule), an HTF SOUP row showing which of the five timeframes are currently souped, and a footer crediting the underlying concept.
ALERTS
— Standard alertcondition() entries for every candle close and every purge (high/low, per slot) — usable from the classic "Create Alert" dropdown.
— Additional dynamic alert() calls fire alongside them with the actual resolved slot time baked into the message (e.g. the real "2AM" on CME futures rather than a hardcoded "1AM") — select "Any alert() function call" in the Create Alert dialog to receive these.
SETTINGS
— Light/Dark theme (Obsidian & Gold on dark backgrounds).
— Native H4 auto-align on/off, manual slot hours, projection window length, history depth.
— Independent show/hide for every layer: body box, 50% line, labels, each HTF level, HTF Turtle Soup marks, CRT box ★TS marks (with color picker), Asia/P12 sessions, and the dashboard itself (position + size).
HOW TO READ IT
Check the VERDICT row for the multi-timeframe bias.
Watch the LIVE columns (CRT BOX + STATUS) for what's actually unfolding on the current slot.
Use the HISTORICAL ODDS columns as context, not a signal — they tell you how this slot has behaved historically, conditional on a purge already happening.
Cross-check against Asia/P12 session ranges for Tracy's step-3 confirmation.
Best used on chart timeframes of 1m–30m (works up to 4h); a warning label appears if the chart timeframe is too high for the timed candles to resolve.
CREDITS
Concept: John Tracy — Time-Based Trading Blueprint (Candle Range Theory), johntracy.me.
This implementation, the CRT box sweep detection, per-TF sweep coloring, and the probability dashboard: Mntdude65.
This script is provided for educational and informational purposes. It does not constitute financial advice. Past performance (including the historical odds shown on the dashboard) does not guarantee future results. Indicator

Indicator

Indicator

Indicator

[ A L P H A X ] BASTION - Support & Resistance PatternsAlphaX BASTION — Support & Resistance Lattice Engine: Touch-Clustered Zone Detection, HTF Level Blending, Four Interaction Playbooks & Level-to-Level Target System
AlphaX BASTION is a professional-grade support and resistance system built around the concept of a lattice — a dynamic, self-updating grid of strength-scored price zones that are continuously constructed from fractal pivot clusters, blended with higher timeframe levels, decayed over time as they lose relevance, and scored by touch frequency and institutional significance. Unlike static horizontal line indicators or basic pivot systems, BASTION treats every support and resistance level as a living structure with a birth date, a touch history, an HTF weight, and a decay clock. Where most S/R systems simply identify levels and leave the trader to decide what to do, BASTION goes one step further: it monitors every active level for four specific micro-pattern interactions — DEFEND, SWEEP, RETEST, and COIL — and fires precision entry signals when those interactions occur at qualified levels with sufficient confluence. The target for every signal is not an arbitrary ATR multiple or measured move — it is the next Bastion level in the signal direction, the natural institutional delivery destination from one defended wall to the next. Designed for traders across crypto, forex, gold, and indices on any timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏰 The Lattice — A Self-Building Defended Price Map
The word "lattice" captures the core concept precisely: BASTION constructs an interconnected grid of defended price levels that represents the current institutional support and resistance landscape. This lattice is not drawn manually, not imported from a fixed timeframe, and not redrawn from scratch on every bar. It is built incrementally — growing as new pivots form, strengthened as levels are retested, and pruned as levels age beyond their relevance window.
How the lattice is constructed:
On every bar, BASTION detects confirmed fractal pivot highs and lows (using a configurable pivot length, default: 5 bars each side). Each new pivot is fed into the lattice's merge algorithm:
If the new pivot is within the merge tolerance (default: 0.22× ATR) of an existing level, it merges with that level — the level's midpoint shifts to the weighted average of all contributing pivots, the touch count increments, the zone boundaries expand if necessary, and the last touch timestamp updates
If the new pivot is farther than the merge tolerance from any existing level, a new level is created with the pivot as its midpoint, zone height of ±0.18× ATR above and below, touch count of 1, and the current bar as its birth bar
When the number of levels per side exceeds the configured maximum (default: 4), the oldest level is dropped from the end of the array
Level decay:
Levels that have not been touched in more than the configured decay period (default: 250 bars) are pruned automatically. This ensures the lattice reflects current institutional market memory rather than accumulating ancient, irrelevant levels that clutter the chart and produce false signals.
Why touch clustering produces better levels than standard S/R: A single pivot high at a price is a weak level — it represents one instance of sellers overwhelming buyers. The same price area touched three times across different sessions represents a genuine institutional order cluster — the level where significant participants have repeatedly defended their position. BASTION's weighted averaging and touch counting system identifies these genuine defended levels and distinguishes them from noise pivots.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📡 HTF Level Blending — Multi-Timeframe Institutional Walls
Every Bastion level is either a current timeframe pivot cluster or a higher timeframe structural level . When Show HTF Swing Levels is enabled (default: on), BASTION pulls pivot highs and lows from the configured HTF (default: H4) and feeds them into the same merge algorithm as current timeframe pivots.
HTF levels receive a special weight in the strength calculation: +2 additional strength points beyond their touch count. This reflects the institutional significance differential — a resistance level formed on H4 represents a zone where a much larger institutional participant defended their position, and carries proportionally more weight than a current timeframe pivot at the same price.
HTF levels are visually distinguished: HTF-sourced zones are rendered with a slightly different purple color (slateblue rather than the standard purple), and HTF-contributing midlines use a thicker dashed line (width 2 vs 1 for standard levels). This allows you to immediately identify which levels have higher timeframe structural backing.
How HTF blending works in practice: When an H4 resistance level is at 2490.00 and a current timeframe resistance forms at 2491.50 — within the merge tolerance — they merge into a single strengthened level. The merged level receives the touch count of both the HTF pivot and any current timeframe retests, plus the HTF weight bonus, making it one of the strongest levels in the lattice. This is the precise behavior of real institutional support and resistance: the H4 level acts as the anchor, and intraday touches confirm it.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💪 Level Strength Scoring
Every level in the lattice has a dynamically computed strength score used to qualify signals and sort level priority.
Strength components:
Touch count — the primary strength component. Each time a new pivot merges into the level, touch count increments. A level with 4 touches is significantly stronger than one with 1
HTF bonus (+2) — levels that have HTF pivot contributions receive 2 additional strength points, reflecting their higher institutional significance
Recency bonus (+1) — levels born within the last 80 bars receive 1 additional point. Fresh levels that were recently created and immediately retested carry more immediate institutional relevance than older levels with the same touch count
Minimum strength gate: Signals are blocked from firing at levels with strength below the configured minimum (default: 2 touches). This single filter eliminates the single most common false signal in S/R trading — entering at an untested level that has not proven itself as a genuine defended zone.
Strength display on dashboard: The nearest support and resistance levels are displayed on the dashboard with their strength scores in brackets — e.g., "2450.50 " means the level at 2450.50 has a strength score of 4. At a glance, you know which levels are most defended.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎮 The Four Interaction Playbooks
The lattice provides the structural map. The playbook engine defines what to do when price arrives at a lattice level. Four specific micro-pattern interactions are monitored continuously — each representing a different way price can interact with a defended wall and a different entry scenario.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DEFEND — Wick Rejection at Level
The most common and cleanest S/R interaction. A wick rejection candle forms when price tests the level and is immediately repelled — buyers overwhelm sellers at support, or sellers overwhelm buyers at resistance, within a single candle.
Long conditions (support DEFEND):
The current bar's low is within the proxAtr distance of the nearest support level
The lower wick exceeds the configured minimum (default: 52% of bar range) — a dominant rejection wick
The close is in the upper quarter of the bar (above bodyBot + 25% of range)
The close is above the zone bottom — price rejected from inside the zone
The DEFEND signal tells you: The support level absorbed the selling pressure on this bar with a clear institutional response. The wick is the signature of buyers stepping in aggressively at the defended zone. This is the most textbook S/R signal available and the highest-frequency of the four playbooks.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SWEEP — Liquidity Grab + Reclaim
The institutional stop-hunt interaction. Price breaches the zone boundary to trigger stop orders, then immediately reverses and closes back inside the zone.
Long conditions (support SWEEP):
The current bar's low extends below the zone bottom by more than the minimum sweep depth (default: 0.12× ATR) — stop orders below support have been triggered
The bar closes above the zone midline — the reclaim is decisive, not just touching the boundary
The bar closes bullish (close above open) — institutional buying drove the recovery
Why SWEEP is the highest-conviction signal: A liquidity sweep at a lattice level combines two layers of institutional evidence. The level itself has been defended multiple times (touch count) and has institutional order significance. The sweep event confirms that institutions actively used the liquidity pool below the level to fill their buy positions — the same sweep-and-reclaim dynamic that underlies MAGNET, but now occurring specifically at a pre-qualified lattice level with known strength.
The SWEEP playbook carries a confluence bonus (+1 layer point) because of this elevated institutional evidence.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RETEST — Break Then Hold (S/R Flip)
The classic support-becomes-resistance and resistance-becomes-support interaction. Price previously broke through the level from the other side, and is now returning to test the flipped level.
Long conditions (support RETEST):
Within the lookback window (default: 12 bars), the close was below the zone bottom — a genuine prior breakdown
The current bar's low is within the zone and the close is above the zone midline — the retest from above is holding
The current bar closes bullish
The RETEST signal captures: The moment when a broken resistance becomes confirmed new support. When a level that previously acted as resistance is broken, retail traders who were long above the level are stopped out or become sellers. When price returns to test the level from above — and the close holds above the midline — the same institutional level that attracted sellers is now attracting buyers who missed the initial breakout. This is the "second chance" entry that offers excellent risk/reward relative to the original breakout candle.
The RETEST playbook also carries a confluence bonus (+1 layer point).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COIL — Compression into Level
The pre-breakout compression interaction. Price has been ranging with narrow ATR bars approaching the level — a coiling squeeze that frequently precedes an explosive directional move.
Long conditions (support COIL):
The last N bars (default: 4) each have an ATR of less than 0.75× the overall ATR — the market is compressing with below-average volatility
The close is within the proxAtr distance of the support level — the compression is occurring directly at the lattice level
The close is above the zone midline — the compression is occurring on the correct side of the level
The COIL signal captures: The energy-building phase at a defended level. When price approaches a lattice level with declining volatility over multiple bars, it indicates the institutional response to that level is suppressing price movement — buyers and sellers are in equilibrium at the level, but the institutional bias (toward defending it as support or resistance) creates a coiled spring. The first decisive bar after the coil frequently produces a large directional move.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Level-to-Level Target System — The Bastion's Unique Approach
Every other entry system in the AlphaX suite uses ATR multiples, Fibonacci measured moves, or pattern heights to compute take profit targets. BASTION uses none of these. The target for every BASTION signal is the next Bastion level in the direction of the trade.
For a long signal at support: The target is the nearest resistance level above the entry price in the current lattice. This is the next defended wall — the level where sellers are expected to step in and potentially cap the move.
For a short signal at resistance: The target is the nearest support level below the entry price — the next defended wall where buyers are expected to step in.
Why level-to-level targeting is superior to measured moves for S/R trading: The market does not move from support to an arbitrary ATR multiple above. It moves from support to resistance — from one institutional wall to the next. Using the actual lattice level as the target ensures the trade is exited at the next genuine institutional interaction point rather than at an arbitrary mathematical distance. This aligns the trade's exit with the same institutional framework that generated the entry.
NEXT WALL TGT on dashboard and chart: The target level is displayed on the dashboard as NEXT WALL TGT and plotted as a yellow-green dashed line on the chart labeled "NEXT WALL." When no opposing lattice level is currently qualified (the target would be beyond the available lattice), the system shows — rather than fabricating a target.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 The 7-Layer Confluence Engine
Every playbook signal is evaluated through a 7-layer scoring system. Signals below the minimum layer count (default: 4) are suppressed.
Layer 1 — Level Strength (1 point):
The interacted level meets the minimum strength threshold (touch count + HTF bonus + recency bonus ≥ minimum). Levels that do not meet this floor cannot produce signals regardless of playbook quality.
Layer 2 — HTF Trend Bias (1 point):
The higher timeframe EMA structure (default: 60-minute, 21/55 EMA) agrees with the signal direction. Bull signals require HTF bull, bear signals require HTF bear. When HTF bias is disabled, this layer is neutral (0 points). Note that the HTF bias is also enforced as a hard condition in the signal firing logic — signals opposing the HTF are blocked entirely when useHtfBias is on.
Layer 3 — Volume Expansion (1 point):
Current bar volume exceeds the volume moving average by the configured multiplier (default: 1.08×). Confirms institutional participation on the interaction bar.
Layer 4 — Non-Chop Market (1 point):
Choppiness Index is below the configured threshold (default: 62). Also enforced as a hard gate — extreme chop blocks all signals. S/R interactions during extreme chop frequently produce false breakouts and fake rejections.
Layer 5 — Playbook Bonus (1 point):
SWEEP and RETEST playbooks receive 1 additional point reflecting their elevated institutional evidence. DEFEND and COIL do not receive this bonus — they are valid but carry less structural confirmation than a sweep reclaim or S/R flip.
Layer 6 — Bar Range Quality (1 point):
The current bar's range is at least 0.35× ATR — the interaction bar has sufficient price action to produce a genuine signal. Doji and near-doji bars in critical zones do not score this point.
Layer 7 — Session Active (1 point):
The current bar is within the configured active session window when the session filter is enabled. When the filter is off, this layer always contributes its point.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Live Dashboard
The 14-row real-time dashboard displays the complete state of the lattice and the current signal context.
LATTICE
Nearest Sup — the price of the nearest support level below current price, with its strength score in brackets (e.g., "2450.50 "). Yellow-green color
Nearest Res — the price of the nearest resistance level above current price with strength score. Red color
Zone Count — the total number of active support and resistance levels in the lattice (e.g., "3 sup · 4 res"). Provides awareness of how populated the current lattice is
PLAYBOOK
State — the current playbook state: the active playbook name (DEFEND, SWEEP, RETEST, COIL) when a signal just fired; WATCH WALLS during the inter-signal period
Bias — ▲ LONG or ▼ SHORT when a signal fired; NEAR RES, NEAR SUP, or MID-RANGE based on current price position relative to the lattice when idle
Next Wall Tgt — the price of the next opposing lattice level — the level-to-level target for the current trade
FILTERS
HTF Bias — ▲ BULL, ▼ BEAR, or — FLAT
Chop — live Choppiness Index value. Orange when above the stand-aside threshold
Volume — EXPAND (above threshold) or QUIET
Playbooks On — abbreviations of all currently enabled playbooks (DEF SWP RET COIL) for quick reference
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Chart Visual System
Resistance Zone Boxes (purple / slateblue) — semi-transparent boxes spanning each resistance level from its birth bar to 15 bars beyond current. Standard purple for current timeframe levels, slateblue for HTF-blended levels
Resistance Midlines (purple dashed) — the exact midpoint of each resistance zone. Width 1 for standard, width 2 for HTF levels
Support Zone Boxes (yellow-green) — semi-transparent yellow-green boxes for all active support levels
Support Midlines (yellow-green dashed) — support zone midpoints. Width 2 for HTF levels
⬡ Diamond (below bar, bright yellow-green) — BASTION long signal. Playbook fired at a support level with qualifying confluence
⬡ Diamond (above bar, bright red) — BASTION short signal
Playbook Label — appears above or below the signal diamond showing "BASTION LONG/SHORT" + playbook name + level price
SL Guide (red dotted) — stop loss below the zone bottom plus ATR buffer (long) or above zone top plus ATR buffer (short), extending 30 bars forward with "SL" label
NEXT WALL Guide (yellow-green dashed) — the level-to-level target extending 30 bars forward with "NEXT WALL" label
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Trade with AlphaX BASTION — Step by Step
Step 1 — Read the Lattice
Check the NEAREST SUP and NEAREST RES rows on the dashboard. Note the strength scores in brackets. Levels with strength 4+ are the most defended — prioritize interactions at these levels
Look at the Zone Count row — a lattice with 3–4 levels on each side represents a well-populated market map. A sparse lattice (1–2 levels per side) means fewer reference points and potentially lower signal quality
Check whether the nearest support or resistance has HTF origin — the slateblue color on the chart or the higher strength score indicates institutional level significance
Step 2 — Monitor Price Approaching a Level
When the dashboard Bias row shows NEAR RES or NEAR SUP, price is approaching a lattice level within the proximity threshold. Watch for a playbook interaction to develop
Identify which playbook is most likely: Is price approaching with narrow bars (COIL)? Did price recently spike below (SWEEP potential)? Has the level previously been broken (RETEST setup)? Is price arriving with a clear wick forming (DEFEND setup)?
Check HTF Bias and Chop on the dashboard — both must be favorable before a signal can fire
Step 3 — Enter on the Diamond Signal
A ⬡ diamond below the bar confirms a qualifying long interaction. The playbook label shows which of the four setups fired and at which exact level
The SL guide shows the stop level — placed below the zone bottom plus ATR buffer (long) or above zone top plus buffer (short). This is the structural invalidation point: if price closes through the zone boundary in the wrong direction, the level has failed to defend
The NEXT WALL guide shows the target level — the next opposing lattice wall
SWEEP and RETEST signals carry the highest confluence (extra playbook layer point) — size these entries at full allocation. DEFEND and COIL at standard allocation
Step 4 — Manage to the Next Wall
The trade targets the NEXT WALL level shown on the chart. As price approaches that level, watch for rejection signals in the opposing direction — if BASTION fires a signal at the target level against your trade, this is a natural exit point
Monitor the lattice continuously — new levels may form during the trade that become relevant intermediate targets or stop adjustment points
If the lattice map shifts significantly (a level is pruned by decay or a strong new level forms), reassess the trade's target
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Identifying Low-Quality Conditions — When Not to Trade
Stand aside when:
Chop Index is orange on the dashboard — the hard gate is active. No signals fire in extreme chop. S/R levels lose their predictive power when the market is oscillating — every touch becomes ambiguous
Zone Count shows 1–2 levels per side — a sparse lattice means the system has insufficient structural reference. The market may be trending strongly through all levels or may be too early in the session to have built meaningful clusters. Wait for the lattice to populate
Nearest level strength is 1 — the minimum strength gate will block signals at untested levels, but if the nearest levels all show , the lattice is populated with fresh, unproven levels. Increase the minimum level strength in settings to require at least 2–3 touches
HTF Bias shows FLAT — no higher timeframe directional conviction. Counter-trend S/R interactions in a flat HTF environment fail at a higher rate because neither institutional buyers nor sellers have committed to a directional view
NEXT WALL TGT shows — — no opposing qualified level exists in the lattice above (for longs) or below (for shorts). Without a level-to-level target, the trade lacks a natural exit framework. Consider skipping signals when no next wall target is available
Playbook is COIL at a level with strength 2 — a coil at a weak, lightly-tested level carries the lowest probability of the signal matrix. COIL at high-strength (4+) levels with HTF backing is a quality setup; COIL at minimum-strength levels is marginal
The ideal BASTION setup:
Support or resistance level with strength 4+ (multiple touches, ideally HTF-blended)
HTF Bias aligned with the trade direction
SWEEP or RETEST playbook (highest confluence bonus)
Volume expanding on the interaction bar
Chop Index well below threshold
Clear NEXT WALL target on the opposing side of the lattice
Signal layers at 6–7 out of 7
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features
🏰 Dynamic S/R lattice — self-building, self-pruning grid of touch-clustered support and resistance zones. New pivots merge into existing levels, incrementing touch counts and adjusting zone boundaries automatically
📡 HTF level blending — H4 (or any configurable HTF) pivot levels fed into the same lattice with a strength bonus, producing a multi-timeframe S/R map in a single indicator
💪 Level strength scoring — touch count + HTF bonus + recency bonus produces a composite strength score for every level. Minimum strength gate blocks signals at untested levels
⏱ Level decay — zones older than the configurable decay period are automatically pruned, keeping the lattice relevant to current institutional market memory
🎮 Four interaction playbooks — DEFEND (wick rejection), SWEEP (liquidity grab + reclaim), RETEST (S/R flip), COIL (compression) — each detecting a different institutional level interaction scenario
🎯 Level-to-level target system — take profit targets the next opposing lattice wall rather than an arbitrary ATR multiple or measured move. The most institutionally grounded target method available
🛡 Zone-anchored stop loss — stop placed beyond the zone boundary plus configurable ATR buffer, at the structural invalidation point for each interaction type
🧠 7-layer confluence engine — Level Strength, HTF Trend Bias, Volume, Non-Chop, Playbook Bonus, Bar Range Quality, Session Active
📊 Live lattice dashboard — Nearest Support/Resistance with strength scores, Zone Count, active Playbook, Bias, Next Wall Target, and all filter states
🎨 Phase-coded zone visualization — resistance zones in purple/slateblue, support zones in yellow-green. HTF levels distinguished by color shade and line width
🔔 2 alert conditions + runtime alerts — Bastion Long and Bastion Short with level price and target in the alert message
⚙ Fully configurable — pivot length, zone merge and half-height tolerances, max levels per side, level decay, HTF timeframe for levels, all four playbook enables, proximity, wick minimum, sweep depth, retest lookback, coil bars, minimum level strength, confluence minimum, HTF bias timeframe and EMAs, volume filter, chop gate, session, cooldown, SL buffer, and all colors are independently adjustable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
S/R Lattice
Swing Pivot Length — fractal sensitivity for pivot detection (default: 5)
Zone Merge (xATR) — ATR distance within which new pivots merge into existing levels (default: 0.22)
Zone Half-Height (xATR) — ATR distance above and below each level midpoint defining the zone boundaries (default: 0.18)
Max Levels per Side — maximum active resistance and support levels maintained simultaneously (default: 4 each)
Level Decay (bars) — bars since last touch after which a level is pruned from the lattice (default: 250)
ATR Length — ATR calculation lookback (default: 14)
Show S/R Zones — toggle lattice boxes and midlines
Blend HTF Swing Levels — toggle higher timeframe level incorporation
HTF for Levels — the higher timeframe from which pivot levels are imported (default: H4)
HTF Pivot Length — pivot length for HTF level detection (default: 5)
Interaction Playbooks
DEFEND — Wick Rejection at Level — toggle the rejection wick playbook
SWEEP — Liquidity Grab + Reclaim — toggle the sweep and reclaim playbook
RETEST — Break then Hold — toggle the S/R flip retest playbook
COIL — Compression into Level — toggle the narrow-bar compression playbook
Max Distance to Level (xATR) — ATR distance from level within which an interaction is considered proximate (default: 0.35)
Min Rejection Wick % — minimum wick fraction of bar range for DEFEND (default: 0.52)
Min Sweep Depth (xATR) — minimum extension below/above zone boundary for SWEEP (default: 0.12)
RETEST Lookback (bars) — bars to scan for the prior breakout in RETEST detection (default: 12)
COIL Min Narrow Bars — consecutive narrow-ATR bars required for COIL (default: 4)
Min Level Strength (touches) — minimum composite strength for a level to generate signals (default: 2)
Confluence
Min Layers (of 7) — minimum confluence score to fire a signal (default: 4)
HTF Trend Bias / HTF Bias TF / HTF Fast / Slow EMA — trend bias filter parameters
Volume Expansion / Volume vs Avg / Volume Avg Length — volume layer parameters
Block Extreme Chop / Choppiness Length / Chop Block Above — chop gate parameters
Session Filter / Active Session — trading hours restriction
Signal Cooldown (bars) — minimum bars between signals (default: 6)
Level-to-Level Guidance
Show SL + Next Level Target — toggle the stop and target guide lines
SL Beyond Sweep/Zone (xATR) — ATR buffer beyond the zone boundary for stop placement (default: 0.35)
Show Playbook Label — toggle the signal label showing playbook name and level price
Display
Show Entry Markers — toggle the ⬡ diamond signal shapes
Show Dashboard — toggle the full dashboard
Dashboard Position — Top Left / Top Right / Bottom Left / Bottom Right
Colors
Bull / Support — yellow-green for support zones and bullish signal elements
Bear / Resistance — red for resistance zones and bearish signal elements
S/R Lattice — purple for standard lattice zones and midlines
HTF Level — slateblue for HTF-blended level zones and midlines
Sweep Accent — orange for SWEEP playbook accents and chop warnings
Stop Guide / Next Level Target — stop and target line colors
Dash Text / Dash BG / Dash Header / Dash Section / Dash Frame — full dashboard color control
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions (2 total + runtime)
Entry Alerts
Bastion Long — qualifying long interaction fired at a support level. Alert message includes playbook name, level price, and next wall target
Bastion Short — qualifying short interaction fired at a resistance level
Runtime alerts (via the alert() function) fire simultaneously with the chart signals, also containing the playbook, level price, and target in the message for immediate actionability.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Recommended Settings by Instrument & Timeframe
The default configuration is optimized for XAUUSD, major forex pairs, and crypto on M5–H1 :
Pivot Length at 5 — balanced sensitivity for intraday lattice construction
Zone Merge at 0.22× ATR — appropriate for gold's tick structure; tighter than typical forex parameters
Level Decay at 250 bars — approximately 20 hours on M5; sufficient to maintain intraday relevance without accumulating ancient levels
HTF for Levels at H4 — the most widely respected swing timeframe for gold and forex institutional structure
Minimum Level Strength at 2 — requires at least two confirmed touches before a level can generate signals
For other instruments or timeframes, adjust:
M1–M3 scalping — reduce Pivot Length to 3, reduce Zone Merge to 0.15, reduce Level Decay to 100–150 bars, reduce Cooldown to 3, reduce COIL Min Narrow Bars to 2–3
H4–Daily swing trading — increase Pivot Length to 8–10, increase Zone Merge to 0.35, increase Level Decay to 500+, set HTF for Levels to Weekly, increase Min Level Strength to 3
Crypto (BTC, ETH) — increase Zone Merge to 0.28–0.35 for wider tick structure, increase Min Sweep Depth to 0.18, increase Level Decay to 300
Indices (NAS100, US30) — use session filter for cash market hours, increase Zone Merge to 0.25, increase Min Level Strength to 3 for index structure
More signals — lower Min Layers to 3, reduce Min Level Strength to 1, increase Max Distance to Level to 0.50
Highest-quality only — raise Min Layers to 5–6, increase Min Level Strength to 3+, enable only SWEEP and RETEST playbooks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
🏰 Support and resistance traders — BASTION is the most complete and systematic S/R implementation in the AlphaX suite. Every aspect of the S/R trading approach — level identification, strength scoring, interaction detection, stop placement, target identification — is automated and quantified
📡 Multi-timeframe S/R traders — the HTF level blending system automatically incorporates H4 (or any configurable timeframe) swing levels into the same lattice, producing a multi-timeframe S/R map without requiring manual level drawing across timeframes
💧 Liquidity sweep traders — the SWEEP playbook at lattice levels is the highest-conviction signal type in BASTION, combining the stop-hunt reversal concept from MAGNET with the pre-qualified, strength-scored level framework of the lattice
🎯 Traders who want structurally meaningful targets — the level-to-level target system is the most institutionally grounded TP approach available — targeting the next defended wall rather than an arbitrary distance
🧠 Systematic traders who want quantified S/R — touch counts, strength scores, decay parameters, and confluence layers replace entirely subjective level identification with objective, repeatable criteria
📈 Traders across all asset classes — the ATR-normalized zone parameters adapt naturally to gold, forex, crypto, and indices without manual recalibration between instruments
⚠ Traders who draw too many or too few S/R levels manually — BASTION manages level count automatically through the Max Levels per Side setting and the decay system — always showing the most current and most relevant levels without chart clutter
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
All signals are confirmed on bar close — the indicator is non-repainting by design. Lattice construction, level strength, playbook detection, and confluence scoring all finalize on confirmed bars only
The lattice is built incrementally from the first bar of chart history. On initial chart loads, the lattice will be sparse for the first 50–100 bars as pivots begin to form and levels begin to cluster. Signal quality improves as the lattice populates
The level decay mechanism (default: 250 bars) means that on very active instruments with frequent pivots, the lattice refreshes relatively quickly. On slower instruments or higher timeframes, levels persist longer. Adjust the decay period to match your instrument's typical S/R memory window
HTF level blending uses Pine Script's request.security — HTF pivots are confirmed on the HTF's own bar close schedule, not the current timeframe. This is non-repainting and consistent with all standard security requests
When multiple playbooks fire at the same level on the same bar, the signal with the highest layer count is selected. The dashboard's playbook abbreviations show which playbooks are currently enabled
Maximum 500 lines, 500 labels, and 60 boxes are rendered. The lattice visualization uses boxes and lines for each level, the signal uses a label, and the guide uses lines and labels. On very active charts with maximum level counts, older elements may be removed by PulseWire rendering limits
The indicator does not track open positions or P&L; and does not connect to any broker or account
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All signals are generated from historical and real-time price data using mathematical calculations — their accuracy or profitability is not guaranteed. Past performance of any signal type does not guarantee future results. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who understand that price does not move in a vacuum — it moves between walls, and the key to reading the market is knowing where those walls are, how strong they are, and exactly what price does when it arrives at them. Indicator

Indicator

Strategy

Indicator

Indicator
