Verdict Calibrator Edge vs Base RateOverview
A meta-tool that answers one honest question about any signal: does it actually beat chance?
Point it at another indicator's output (via the source input) or use a built-in reference signal, and it forward-tests every long/short call with a triple-barrier outcome, compares the hit rate to the unconditional base rate of the same move, and only calls an edge "proven" when a confidence-interval lower bound clears that base rate. It splits the result by side (long vs short) and by regime (trend vs range).
It grades a signal; it does not make one.
Why this exists
Most "win rate" readouts are misleading. 60% right means nothing until you know how often the same move happened anyway — if price rose 60% of the time regardless, your signal has an edge of exactly zero. And a 60% on 12 samples is noise, not evidence.
This tool is built so it can only ever say "no proven edge" when there isn't one. The base-rate comparison and the significance gate make false confidence structurally hard to produce.
Why these parts are ONE tool
Signal as a parameter. Connect any plot on your chart through the source input, or pick a built-in reference. The signal is an input, not baked in — so you can audit your indicators, not just this one. The ten built-ins span the families traders actually use:
FamilyBuilt-insTrend-followMA cross · MACD cross · Supertrend flipMomentumRSI 50-cross · Stochastic crossBreakoutDonchian breakout · VWAP crossMean-reversionRSI 30/70 reversal · Bollinger fadeControlRandom (coin flip)
The random control — the tool's own self-test. A deterministic coin flip that by construction has no edge. Grade it and the verdict should read "Not proven" with an Edge near zero. If a random signal ever comes back "PROVEN", the harness is broken — distrust the tool, not the market. No other calibrator on PulseWire ships with a falsification test built in. It is also the single fastest way for a sceptical user to satisfy themselves that this thing is honest.
Triple-barrier outcome. From each signal: did price reach +target, −target, or neither within the horizon? A well-defined outcome, not a vague "did it go up eventually".
Base-rate comparison. The honest yardstick — the unconditional rate of the same outcome, matched to the signal's own side and regime mix. Edge = Hit% − Base%, never raw Hit%.
Significance gate. A score-interval lower bound must clear the base rate before an edge is called proven — which matters most at small samples, exactly where point estimates lie.
Regime and side split. Edge is reported for long vs short and trend vs range separately, because a real edge usually lives in one and not the other.
Remove any one and the tool can be fooled into reporting confidence it hasn't earned.
How to use it
Pick the signal (external source or a built-in), set the outcome (horizon + target in ATR), and read the verdict: PROVEN +X% ★ / Not proven / Gathering data.
The two plotted lines are the running Hit % (of the signal) and Base % (unconditional) — the gap between them IS the edge, and you can watch it stabilise as samples accumulate. Switch the dashboard to Pro to see where the edge lives (long/short, trend/range).
If it says "no proven edge", believe it. That's the tool working, not failing.
Data & scope
Works on any symbol and timeframe — it needs only OHLC, no volume. Give it enough history to reach the minimum sample count, or the verdict will honestly read "Gathering data". Because the base rate is measured on the same chart, the yardstick always matches the instrument you're on.
Non-repainting & honest limits
Confirmed-bar reads; samples log at the signal bar and resolve on closed bars.
This is an in-sample, forward-from-signal study aid — NOT a walk-forward backtest. No costs or slippage. Overlapping forward windows correlate samples (the minimum-gap setting mitigates this; it does not eliminate it). Small-n edges are provisional even when starred. A proven in-sample edge is not a guarantee out-of-sample. Nothing here predicts price.
Concept credits
Built on standard, published techniques — triple-barrier forward labelling (M. López de Prado), base-rate / skill-vs-chance evaluation (a long tradition in forecast verification), the efficiency-ratio regime read (Perry Kaufman), and the Wilson score interval for a proportion (Edwin B. Wilson). The signal-agnostic intake, the coupling and the plain-language verdict are this script's own. No third-party Pine code is reused.
Disclaimer
Research and educational tool only. Not financial advice, no recommendation, no guarantee of results. Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability. Indicator

Fibonacci Levels Engine [StrixEDGE]What It Does
Fibonacci Levels Engine automatically detects the most recent swing high and swing low within a configurable lookback window, draws the standard Fibonacci retracement grid (0 %, 23.6 %, 38.2 %, 50 %, 61.8 %, 78.6 %, 88.6 %, 100 %) plus the 127.2 % and 161.8 % extensions, and projects every level into the future so you can see where price is heading relative to the structure.
What separates this indicator from a plain Fibonacci overlay is the Edge Analysis layer — three original components that work together to tell you how meaningful a given Fibonacci zone is right now, not just where it sits on the chart:
1. Edge Score (0–100) — A composite confluence gauge displayed in the dashboard.
2. Proximity Heatmap — Dynamic line opacity that makes levels glow as price approaches them.
3. ATR Volatility Band — A band around the Golden Zone midpoint that adapts to current volatility.
How It Works
Core: Swing Detection & Fibonacci Grid
The indicator scans the last N bars (default 20, configurable 5–300) to find the highest high and lowest low. It determines trend direction by comparing which extreme occurred first: if the swing low is further back in time than the swing high, the structure is bullish (price moved from low to high); otherwise it is bearish. Fibonacci ratios are then calculated from that range and drawn as horizontal levels from the swing origin to a user-defined projection length (default 30 bars into the future).
Two shaded zones highlight areas of interest:
- Golden Zone (0.618–0.786) — the highest-probability retracement area in classical Fibonacci theory.
- Deep Zone (0.786–0.886) — often the last line of defense before a full retracement.
Both zones, the 50 % midline, and the extension levels can be toggled on or off independently.
Edge Score — Confluence Gauge
The Edge Score combines three independent measurements into a single 0–100 reading:
RSI Momentum Alignment | 0–35 | In a bullish structure, a low RSI (below 35) scores highest because it signals oversold conditions near support. In a bearish structure, a high RSI (above 65) scores highest. Intermediate RSI values receive proportionally lower scores. |
| Proximity to Golden Zone | 0–35 | Measures the absolute distance between the current close and the Golden Zone midpoint as a ratio of the total Fibonacci range. The closer price is to the midpoint, the higher the score. |
| EMA Trend Alignment | 0–30 | Checks the stacking order of the 8, 21, and 55-period EMAs. A fully aligned stack (e.g., EMA 8 > EMA 21 > EMA 55 in a bullish structure) scores 30; partial alignment scores 20; misalignment scores 10. |
The resulting score is classified as STRONG (≥ 75), MODERATE (≥ 50), WEAK (≥ 25), or LOW (< 25) and displayed with a color-coded label in the dashboard. A high Edge Score means RSI, price proximity, and trend direction are all converging at the Fibonacci zone — not just that price touched a line.
Proximity Heatmap
Every Fibonacci level's line opacity is recalculated on each bar based on how far the current close is from that level. When price is near a level, the line becomes more opaque (visually brighter); when price is far away, the line fades. This is computed as a transparency value derived from the ratio of (distance to level) / (total Fibonacci range), scaled between 10 and 75. The effect lets you instantly see which levels are "active" without scanning numbers — the relevant lines stand out on their own.
ATR Volatility Band
A translucent band is drawn around the Golden Zone midpoint, extending ± 0.5 × ATR (default 14-period). This addresses a practical problem: a Fibonacci level is a single price, but real entries need a buffer that accounts for market noise. The band widens in volatile conditions and contracts in quiet ones, giving you a dynamic "fair value area" inside the Golden Zone rather than a fixed line.
Dashboard Panel
A compact table in the top-right corner of the chart displays:
- Trend — Current structural direction (Bull / Bear) with color coding.
- Edge — The composite Edge Score and its label.
- RSI — Current RSI value, color-coded for overbought/oversold extremes.
- G-Zone — Live status showing ✅ with the midpoint price when the close is inside the Golden Zone
or ⏳ Waiting when it is outside.
- ATR — Current Average True Range value.
- Range — The total Fibonacci range (swing high minus swing low).
Dashboard text size is adjustable (Tiny / Small / Normal / Large).
How to Use It
Identify the structure — Add the indicator to your chart. The dashboard immediately tells you whether the current swing structure is bullish or bearish and shows the Edge Score.
Watch the Golden Zone — When price pulls back toward the 0.618–0.786 area, check the dashboard: a high Edge Score (50+) means RSI and trend EMAs are aligned with the retracement, which increases the odds of a bounce. The G-Zone row will switch from ⏳ to ✅ when price enters the zone.
Use the Volatility Band for entries — Rather than placing a limit order on the exact 0.618 or 0.786 line, use the ATR band as your entry zone. It automatically adjusts to current volatility, giving you a wider buffer in choppy markets and a tighter one in clean trends.
Read the heatmap — Glowing lines tell you which levels price is currently interacting with. If a line is bright and the Edge Score is high, that level carries more weight. If the line is faded, price is far away and the level is not in play.
Settings Overview
- Pivot Lookback (5–300, default 20) — Number of bars scanned for swing high/low detection.
- Right Projection (5–200, default 30) — How far levels extend into the future.
- Golden Zone / Deep Zone / 50 % / Extensions — Toggle individual level groups.
- Edge Score Panel — Show or hide the dashboard.
- ATR Volatility Band — Show or hide the dynamic band.
- Proximity Heatmap — Enable or disable the distance-based line opacity effect.
- ATR / RSI Length — Periods for the ATR and RSI calculations used in the Edge Score and Volatility Band.
- Style — Full color customization for bullish/bearish, zones, bands, levels, labels, and line width.
Set alerts — Four built-in alert conditions are included:
- Price enters the Golden Zone (0.618–0.786)
- Price enters the Deep Zone (0.786–0.886)
- Edge Score reaches 75 or above (strong confluence)
- Price crosses the 0 % or 100 % level (breakout / full retracement) Indicator

Gap Reclaim Readiness [AGPro Series]# Gap Reclaim Readiness
🧠 Core Idea
Can price reclaim a gap edge with enough acceptance to make the structure worth monitoring?
📌 Overview / What it does
Gap Reclaim Readiness is a chart-first gap edge decision-support script built to evaluate whether price has returned to a gap boundary and reclaimed it with enough structural quality.
The script maps active gap zones, identifies the reclaim edge, builds a focused reclaim pocket, scores the reclaim from 0 to 100, and summarizes the current state inside a compact AG Pro panel.
It does not predict price direction, automate trades, or provide guaranteed signals. It is designed to organize gap-edge context, reclaim quality, fill risk, and continuation state into a clean visual workflow.
🎯 Purpose & Design Philosophy
Many gap tools focus only on whether a gap exists or whether it has been filled.
This script was built for the more practical question: after a gap forms, does price respect and reclaim the edge strongly enough to deserve attention?
It helps traders who use price action, gap reactions, continuation structure, and intraday context, while supporting a patient decision-making process instead of impulsive reaction.
⚡ Why This Script Is Different
Most tools focus on detecting gaps or tracking gap fill.
This script does NOT behave like a generic gap fill tracker.
Instead, it focuses on the reclaim edge: whether price returns to the boundary, accepts it, loses it, or fails to develop a clean reclaim context.
⚙️ Methodology
1. Gap Context Detection
2. Reclaim Edge Mapping
3. Reclaim Pocket Construction
4. Reaction And Acceptance Evaluation
5. 0-100 Reclaim Score
6. Fill Risk And Continuation State
7. Visual Output And Panel Summary
🗺️ How to Read the Chart
The gap zone marks the structural area created by a qualifying gap or displacement-style gap event.
The reclaim edge marks the key boundary price must respect to form a valid reclaim context.
The reclaim pocket highlights the area around the edge where reaction quality is evaluated.
READY RECLAIM labels appear when the reclaim context meets the required score threshold.
Target rails show projected continuation references after a qualified reclaim.
The panel summarizes Gap Edge, Reclaim Score, Fill Risk, Continuation, and Action.
🚦 Signals & States
• READY → A qualified gap edge reclaim has formed.
• MONITOR → A gap structure exists and the script is watching for reclaim behavior.
• WAIT → No active reclaim context is currently valid.
• INVALIDATED → Price failed back through the reclaim edge.
• EXPIRED → The reclaim window closed without a qualified reclaim.
🔔 Alerts Logic
Bullish Gap Reclaim Ready triggers when price reclaims a bullish gap edge with enough score.
Bearish Gap Reclaim Ready triggers when price reclaims a bearish gap edge with enough score.
Gap Reclaim Invalidated triggers when price fails back through the reclaim edge.
Gap Reclaim Expired triggers when the reclaim window closes without a qualified reclaim.
Alerts are attention markers, not trade instructions.
🧩 Confluence Logic
The reclaim score combines edge interaction, close acceptance, time quality, relative volume, gap size, and available continuation room.
When several of these conditions align, the context becomes stronger.
When they do not align, the script remains in WAIT, MONITOR, INVALIDATED, or EXPIRED state.
📊 When to Use
• Intraday price action workflows
• Gap reaction analysis
• Breakout and reclaim structures
• Continuation after displacement
• Markets where gap edges or price void boundaries matter
⚠️ When NOT to Use
Avoid relying on this script in extremely illiquid markets, very noisy low-volume symbols, holiday sessions, or conditions where gaps and displacement structures are not meaningful.
It should also not be used as a standalone decision tool without broader market context.
🎛️ Key Inputs
• Gap Mode controls how strict the gap detection logic is.
• Minimum Gap Size filters weak structures.
• Displacement Gap Fallback helps continuous markets where classic open gaps are rare.
• Reclaim Pocket ATR controls the depth of the reclaim pocket.
• Minimum Ready Score controls how strong the reclaim must be before READY appears.
• Fill Risk Threshold controls when a reclaim context becomes too filled or exhausted.
• Visual settings control labels, zones, right-side tags, panel location, and font size.
🖥️ Interface & Visual Design
The interface is designed to keep the chart readable while making the active reclaim structure easy to understand.
The panel uses the AG Pro blue header style and summarizes the current state without covering the whole chart.
Zones, pockets, labels, and target rails are designed to show structure first and avoid unnecessary noise.
🧪 Practical Usage Workflow
1. Identify whether the panel shows an active gap edge.
2. Check the reclaim pocket and nearby price reaction.
3. Read the reclaim score and fill risk.
4. Confirm whether the action state is READY, MONITOR, WAIT, INVALIDATED, or EXPIRED.
5. Combine the output with broader structure, liquidity, trend, and risk context.
🔍 Interpretation Guidelines
A higher reclaim score means the gap edge reaction is cleaner according to the script logic.
A high fill risk means the gap context may already be too consumed.
READY means the reclaim condition deserves attention, not that price must continue.
WAIT means there is no valid active reclaim context.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an auto-trading system.
It does not provide guaranteed signals.
It does not replace risk management or independent analysis.
⚠️ Limitations & Transparency
Gap behavior changes across markets, timeframes, liquidity conditions, and volatility regimes.
Continuous markets may create fewer classic gaps, so adaptive displacement logic is included to support broader usability.
Different symbols and timeframes may require different sensitivity settings.
🧠 Market Context Notes
Gap reclaim behavior is often stronger when aligned with trend, liquidity response, volume participation, and clean structure.
Weak reclaim attempts can fail quickly when price loses the edge or when the gap becomes fully consumed.
🔐 Non-Promise Statement
No script can guarantee future price behavior.
This tool provides structured visual context only.
📉 Risk Disclosure
Trading involves risk.
Users remain responsible for their own decisions.
This script is for educational and analytical purposes only and does not provide financial advice or guaranteed trading outcomes.
Indicator

Volume Trap Reversal Planner [AGPro Series]Volume Trap Reversal Planner
🧠 Core Idea
Did a volume spike trap one side of the market and reverse with enough confirmation to deserve attention?
📌 Overview / What it does
Volume Trap Reversal Planner is a chart-first reversal planning tool built around high-volume trap behavior.
Instead of treating every volume spike or wick sweep as a reversal signal, the script checks whether price expands through a recent reference, prints unusual relative volume, fails to hold the move, recovers back through the reference, and then confirms with a follow-through candle.
The output includes volume trap pockets, reclaim rails, risk edges, target-room bands, compact event labels, alerts, and a clean AGPro decision panel. It does not predict price, automate trades, or claim that every trap will reverse.
🎯 Purpose & Design Philosophy
The script was built for traders who want to separate meaningful high-volume trap events from ordinary noisy spikes.
Many reversal tools focus only on a wick, a candle pattern, or a support/resistance touch. This planner focuses on the decision layer after a volume trap forms: whether the trap is confirmed, where the risk edge sits, where target-room review begins, and what the next action state should be.
The design supports a structured review mindset: identify the trap, wait for confirmation, monitor the risk edge, and read the context through a 0-100 score instead of reacting to a single candle.
⚡ Why This Script Is Different
Most tools focus on volume spikes as standalone events or classify every sweep as a reversal attempt.
This script does NOT operate as a generic stop-run scanner, a broad liquidity sweep map, or a simple volume climax labeler.
Instead, it combines relative volume, wick sweep behavior, close recovery, confirmation candle quality, follow-through, risk edge placement, and target-room context into one planner-style reversal model.
⚙️ Methodology
1. Context Detection
The script builds a rolling high/low reference range and watches for unusual volume expansion near those references.
2. Trap Mapping
When price sweeps beyond the reference with elevated volume and recovers back inside, the script maps the volume trap pocket.
3. Reversal Evaluation
The planner evaluates wick quality, recovery strength, confirmation candle structure, follow-through distance, and the active risk edge.
4. Visual Output
The result is translated into a 0-100 reversal score, a next-action state, on-chart labels, risk/target guides, and a compact AGPro panel.
🗺️ How to Read the Chart
Zones = volume trap pockets created by a high-volume sweep and recovery.
Labels = trap watch, reversal ready, trap failed, or target review states.
Colors = bull-side reversals use teal, bear-side reversals use pink, watch states use amber, and review/target context uses indigo.
Panel = current trap side, volume spike multiple, reversal score, risk edge, and next action.
🚦 Signals & States
• VOL TRAP WATCH → a high-volume trap candidate formed and needs confirmation.
• REVERSAL READY → the trap received confirmation and reached the required score.
• TRAP FAILED → price closed beyond the risk edge and the active trap context weakened.
• TARGET REVIEW → price reached the target-room review band for the active plan.
🔔 Alerts Logic
Alerts trigger when a volume trap watch appears, when reversal confirmation reaches the required score, when the active trap fails through the risk edge, or when price reaches the target-room review band.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when volume spike quality, wick sweep behavior, close recovery, confirmation candle structure, and follow-through align in the same direction.
The score is intentionally multi-factor so a single dramatic candle does not dominate the interpretation.
📊 When to Use
• 4H charts for the cleanest public visual balance
• Markets with reliable volume data
• High-volume reactions around recent highs or lows
• Reversal review after failed breakout or failed breakdown attempts
• Active intraday or swing charts where trap behavior is visible
⚠️ When NOT to Use
• Very low-liquidity symbols
• Markets with unreliable or missing volume data
• Extremely noisy ranges where every candle sweeps both sides
• News-driven volatility where candle structure can distort normal context
🎛️ Key Inputs
• Trap Reference Lookback → controls the rolling high/low range used for trap detection.
• Volume Spike RVOL → adjusts how much relative volume is required.
• Sensitivity → changes sweep, wick, and volume selectivity.
• Confirmation Mode → controls how strict the confirmation candle must be.
• Risk / Target Logic → controls risk edge buffers and target-room bands.
• Visual Settings → control zones, rails, labels, panel location, theme, and font sizes.
🖥️ Interface & Visual Design
The interface is built around a clean AGPro panel and chart-first visual hierarchy.
Trap pockets show where the volume trap occurred. Labels identify the current state without overcrowding the chart. Risk and target guides make the output easier to interpret as a planning tool rather than a raw signal board.
🧪 Practical Usage Workflow
1. Read the panel and check the active trap side.
2. Inspect the volume trap pocket and reclaim rail.
3. Wait for reversal confirmation instead of reacting to the spike alone.
4. Compare the current state with the risk edge and target-room band.
5. Interpret the score within broader market context.
🔍 Interpretation Guidelines
A high score means the trap structure, volume spike, recovery, and confirmation are aligned more cleanly.
A watch state means the event is still developing.
A failed state means the active trap context has weakened or invalidated according to the script's rules.
Use the output as structured context, not as a standalone decision.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not an auto-trading system
• Not a guaranteed reversal signal
• Not a generic liquidity sweep scanner
⚠️ Limitations & Transparency
Volume quality varies by symbol, exchange, and asset class.
Different timeframes may produce different trap pockets and confirmation states.
High volatility can make traps appear and fail quickly.
The script is rule-based and cannot know news, order flow intent, execution quality, or broader discretionary context.
🧠 Market Context Notes
Volume traps often matter most when they occur at obvious participation points, such as recent highs, recent lows, failed breakouts, or failed breakdowns.
The strongest use case is not the spike itself. The strongest use case is the sequence after the spike: recovery, confirmation, risk edge, and follow-through.
🧾 Use Case Examples
When price sweeps below a recent low on elevated volume, closes back above the reference, and confirms upward within the allowed window, the planner can mark a bullish reversal context.
When price sweeps above a recent high on elevated volume, fails to hold, and confirms downward, the planner can mark a bearish reversal context.
🧱 System Philosophy
Volume Trap Reversal Planner belongs to the AGPro planner-style workflow: detect the event, score the evidence, define the risk edge, map the review zone, and guide the next chart-reading step.
🔐 Non-Promise Statement
No trap, score, label, or alert can guarantee a reversal.
No script can provide certainty.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own decisions, risk management, and market interpretation.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
Use the script to study how high-volume failed moves behave after sweeping recent references. The most useful insights come from comparing confirmed traps, failed traps, and ignored spikes across different markets and timeframes.
Indicator

Trend Re-Entry Planner [AGPro Series]Trend Re-Entry Planner
🧠 Core Idea
Is an active trend pullback creating a clean re-entry planning context, or is the reset becoming too risky?
📌 Overview / What it does
Trend Re-Entry Planner is a chart-first trend continuation planning tool designed to evaluate pullbacks inside an active trend structure. The default profile is tuned for 1H charts, where re-entry pockets, trigger candles, invalidation edges, and target-room context usually remain more readable.
The script builds a re-entry pocket from the current impulse range, scores the quality of the pullback, maps a trend defense line, shows an invalidation edge, and estimates target-room context. The goal is to help users judge whether a pullback is becoming organized enough for review or whether the trend context should be rebuilt.
It does not predict price, automate entries, or turn every pullback into a signal. It is a rule-based planning framework for evaluating trend re-entry structure.
🎯 Purpose & Design Philosophy
This script was built for traders who already track trend continuation but want a cleaner way to decide whether a pullback is worth attention.
Many trend tools show direction. Many pullback tools mark a reaction. This script focuses on the planning layer between those two ideas: trend side, pullback depth, reset quality, trigger behavior, target room, risk edge, and next action.
The design supports a disciplined workflow: evaluate context first, then decide whether the setup is ready, confirmed, invalidated, or still waiting.
⚡ Why This Script Is Different
Most tools focus on trend direction, moving average crosses, or broad pullback labels.
This script does NOT clone SuperTrend pullback grading, generic trend continuation signals, or low-volume pullback zones.
Instead, it uses an EMA trend stack and impulse-based re-entry pocket to build a planning view around the current pullback. The output is not just a marker. It is a decision panel with a 0-100 re-entry score, pullback depth, risk edge, target-room context, and next-action state.
⚙️ Methodology
1. Context Detection
The script identifies active bullish or bearish trend structure using an EMA stack and directional slope.
2. Reference Mapping
It maps the current impulse range and builds a concept-native re-entry pocket from that range.
3. Reaction Evaluation
The engine scores trend slope, pullback depth, reset quality near the mid EMA, trigger candle behavior, and target-room availability.
4. Visual Output
The script displays the re-entry pocket, invalidation edge, target-room guide, event labels, sparse context labels, and a premium AG Pro planning panel.
🗺️ How to Read the Chart
Zones = the re-entry pocket and target-room area used for planning context.
Labels = READY, CONFIRMED, INVALIDATED, FOLLOW-THROUGH, and sparse context states.
Colors = teal for bullish continuation context, pink for bearish or invalidation context, yellow for watch/review states, and indigo for target-room or follow-through emphasis.
Panel = the compact decision dashboard showing trend side, re-entry score, pullback depth, risk edge, and action.
🚦 Signals & States
• WATCH → the pullback is developing but still needs confirmation or cleaner structure.
• READY → the re-entry context has enough quality for closer review.
• CONFIRMED → a qualifying trigger candle appears after the pullback context improves.
• FOLLOW-THROUGH → the confirmed context produces a stronger continuation marker.
• INVALIDATED → price crosses the active invalidation edge and the plan should be rebuilt.
🔔 Alerts Logic
Alerts trigger when the script detects READY, CONFIRMED, INVALIDATED, or FOLLOW-THROUGH states.
Each alert is an attention marker tied to the rule-based state engine. Alerts are not trade instructions and do not guarantee that continuation will occur.
🧩 Confluence Logic
The context becomes stronger when trend slope, pullback depth, mid-EMA reset quality, trigger candle behavior, and target-room availability align.
The script intentionally requires multiple conditions instead of labeling every trend pullback as meaningful.
📊 When to Use
• 1H charts with active directional structure
• Directional markets with clear trend structure
• Pullbacks after a visible impulse move
• Continuation review workflows
• Trend-following plans where risk edge and target room matter
⚠️ When NOT to Use
• Low-liquidity symbols with unreliable price movement
• Extremely choppy markets with frequent trend-stack flips
• News-driven volatility where pullback structure changes too quickly
• Markets where the active impulse range is stale or unclear
🎛️ Key Inputs
• Sensitivity → adjusts how selective the re-entry score model is.
• Planning Profile → keeps the default behavior tuned for hourly re-entry planning or allows manual/higher-timeframe adjustment.
• Impulse Lookback → controls the range used to build the re-entry pocket.
• Re-Entry Depth settings → define the shallow, ideal, and deep areas of the pocket.
• Thresholds → control WATCH, READY, and CONFIRMED state requirements.
• Visual settings → control zones, EMA stack, labels, panel theme, panel location, and font sizes.
🖥️ Interface & Visual Design
The interface is built around a clean AG Pro panel and chart-first planning visuals.
The re-entry pocket and target-room guide are intentionally restrained so price remains readable. Labels are limited and spaced to keep the chart informative without becoming crowded.
The first panel row uses the standard AGPro merged blue header format.
🧪 Practical Usage Workflow
1. Read the panel to identify trend side and current action.
2. Check whether price is interacting with the re-entry pocket.
3. Evaluate the score, pullback depth, and risk edge.
4. Wait for READY or CONFIRMED state before treating the context as review-worthy.
5. Rebuild the plan if the invalidation edge is crossed.
🔍 Interpretation Guidelines
Think in terms of planning quality, not certainty.
A higher score means the current pullback has more constructive re-entry characteristics according to the script's rule set. A lower score means the pullback is less organized, has poor target room, lacks a clear trigger, or has moved too close to invalidation.
Use the script as a structure-reading tool within broader market context.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not an auto-trading system
• Not guaranteed signals
• Not a SuperTrend pullback clone
• Not a generic support/resistance zone map
⚠️ Limitations & Transparency
The script is rule-based and depends on visible chart data.
Timeframe differences, volatility shifts, low liquidity, and sudden news events can change how re-entry structure appears.
The score reflects the internal model only. It does not know future order flow, future liquidity, or future market intent.
🧠 Market Context Notes
Trend re-entry quality is usually clearer when a market has directional structure, a readable impulse, and enough room before nearby obstacles.
When a trend is mature, overly extended, or choppy, the same pullback behavior may carry less useful information.
🧾 Use Case Examples
When price pulls into the re-entry pocket during a bullish EMA stack and then prints a constructive trigger candle, the script may shift from WATCH to READY or CONFIRMED.
When price crosses the invalidation edge, the script marks the context as INVALIDATED so the user can rebuild the plan instead of forcing the old structure.
🧱 System Philosophy
AGPro planning tools are designed to turn chart structure into a clearer decision workflow.
This script follows that philosophy by focusing on context, readiness, risk edge, and next action rather than simple signal output.
🔐 Non-Promise Statement
No script can guarantee continuation, reversal, profit, or accuracy.
This tool provides structured context only. Users should combine it with their own analysis, timeframe review, and risk management process.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own decisions, position sizing, trade management, and risk control.
This script does not provide financial advice and does not guarantee trading outcomes.
📚 Educational Note
Trend Re-Entry Planner is intended to help users study how pullbacks behave inside active trend structure and how planning context can be organized more clearly.
Indicator

Opening Pullback Planner [AGPro Series]Opening Pullback Planner
🧠 Core Idea
Is the first pullback after the open constructive, failing, or too stale to plan around?
📌 Overview / What it does
Opening Pullback Planner is a session pullback decision tool built around the first meaningful retracement after the opening drive. Instead of treating the open as only a breakout moment, it waits for the drive reference to lock, then maps the pullback area where continuation quality can be evaluated.
The script produces an opening pullback box, continuation trigger, failure line, target-room guide, 0-100 continuation score, risk-edge reading, compact event labels, alerts, and a clean AG Pro planning panel.
It does not predict price direction, automate trades, or mark every opening range breakout. Its purpose is to organize the pullback phase after the opening drive so traders can judge whether the first reset is constructive, failing, invalidated, or no longer worth attention.
🎯 Purpose & Design Philosophy
Many session tools focus on the first opening break, the opening range, or the first impulse. The problem is that a strong open often becomes difficult to plan only after price pulls back.
Opening Pullback Planner was built to fill that gap. It helps traders who study intraday continuation, first-pullback behavior, session execution, and risk-defined planning after the initial move.
The design philosophy is simple: lock the opening drive, map the first pullback box, evaluate recovery quality, define the failure line, and keep the next action readable without turning the chart into a crowded signal board.
⚡ Why This Script Is Different
Most tools focus on opening range breakouts, first-drive strength, fixed session boxes, or generic pullback signals.
This script does NOT clone Opening Drive Quality, does NOT act as an ORB breakout tool, and does NOT draw generic support/resistance zones.
Instead, it focuses on the first pullback after the opening drive. It asks whether the pullback is deep enough to matter, shallow enough to preserve structure, recovering with acceptable close quality, holding a measurable failure line, and offering enough target room for continued review.
⚙️ Methodology
1. Context Detection
The script builds an opening reference from either a fixed session window or the first bars of the day. This creates the drive structure that the pullback plan will use.
2. Reference Mapping
After the opening reference locks, the script maps a drive-native pullback box, continuation trigger, failure line, and target-room guide.
3. Reaction Evaluation
The engine evaluates pullback depth, close recovery, relative volume, volatility fit, room-to-risk, and drive quality to create a 0-100 continuation score.
4. Visual Output
The chart shows the pullback box with centered text, continuation and failure references, target-room guide, compact event labels, optional markers, and the AG Pro panel.
🗺️ How to Read the Chart
Opening Pullback Box = the first pullback review area derived from the locked opening drive.
Continuation Trigger = the level price must reclaim or break after the pullback for continuation context to strengthen.
Failure Line = the invalidation reference where the active pullback plan loses structural integrity.
Target Guide = a projected target-room reference based on the opening drive range.
Labels = event markers for drive retain, pullback test, constructive recovery, trigger readiness, pullback risk, failure line, stale plan, and target check.
Colors = teal for bullish continuation context, pink for bearish or invalid context, amber for caution, and indigo for structural emphasis.
Panel = the decision layer showing Pullback State, Drive Side, Continuation Score, Risk Edge, and Action.
🚦 Signals & States
• DRIVE RETAIN → the opening drive quality is strong enough to map a pullback plan.
• PULLBACK TEST → price has entered the opening pullback box.
• CONSTRUCTIVE → pullback depth and recovery quality are acceptable inside the model.
• TRIGGER READY → price has moved through the continuation trigger after a valid pullback.
• PULLBACK RISK → the pullback is becoming too deep, slow, or weak for clean continuation review.
• FAILURE LINE → the active pullback plan has lost structural integrity.
• PULLBACK STALE → the first pullback plan did not resolve inside the review window.
• TARGET CHECK → price reached the projected target-room guide.
🔔 Alerts Logic
The script includes alerts for:
• Opening Pullback Plan Armed → a qualified opening drive mapped the first pullback plan.
• Opening Pullback Test → price is testing the pullback box.
• Constructive Opening Pullback → the pullback is recovering constructively.
• Opening Pullback Continuation Trigger → the continuation trigger is active after the pullback.
• Opening Pullback Failure Line Broken → the plan has broken its failure reference.
• Opening Pullback Plan Expired → the first pullback plan became stale before confirmation.
• Opening Pullback Target Check → price reached the target-room guide.
Alerts are attention markers. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when the opening drive has acceptable quality, the first pullback reaches the planned box without violating the failure line, recovery closes improve, volume does not collapse during recovery, and target room remains clean.
The context becomes weaker when the pullback is too deep, recovery is poor, the plan takes too long to resolve, or price violates the failure line.
📊 When to Use
• Intraday session planning after the opening move.
• First-pullback continuation review.
• Daily chart review when the higher-timeframe fallback is enabled.
• Markets where the opening drive often creates a useful early reference.
• Stocks, indices, futures, crypto, or FX charts where the selected opening session is meaningful.
• Review workflows where risk edge and target room need to be visible.
⚠️ When NOT to Use
• Very low-liquidity markets.
• Extremely noisy opens with unstable spreads.
• News-driven bars that distort the opening reference.
• Higher timeframes where session pullback structure is not meaningful.
• Markets where the selected opening window does not represent real participation.
🎛️ Key Inputs
• Opening Reference Mode → chooses between a fixed session window and first bars of day.
• Opening Drive Window → defines the drive reference used before pullback mapping begins.
• Higher Timeframe Fallback → keeps daily, weekly, and monthly charts visually useful by mapping broader opening references.
• Sensitivity → adjusts how strict the planner is with pullback recovery and score requirements.
• Constructive Score Threshold → controls when constructive pullback labels can appear.
• Pullback Box Shallow / Ideal / Deep → define the preferred retracement area.
• Continuation Trigger Buffer ATR → adjusts the trigger line beyond the drive extreme.
• Failure Line Buffer ATR → adjusts the invalidation reference beyond the pullback box.
• Target Guide Range Multiple → controls the projected target-room guide.
• Visual settings → control box, lines, labels, markers, projection, label limits, and font size.
• Panel settings → control panel visibility, location, theme, and font size.
🖥️ Interface & Visual Design
The interface is chart-first and decision-focused. The main visual object is one opening pullback box with centered state text, supported by a continuation trigger, failure line, and target guide.
The panel follows the AGPro public-release standard with one merged blue header row containing only the script name. The five panel rows are Pullback State, Drive Side, Continuation Score, Risk Edge, and Action.
Labels are compact, capped, and offset away from candles so the chart stays active without becoming crowded.
🧪 Practical Usage Workflow
1. Let the opening reference lock.
2. Read the panel to see whether the drive retained enough quality.
3. Watch whether price tests the opening pullback box.
4. Evaluate the continuation score, recovery state, risk edge, and failure line.
5. Treat alerts and labels as review prompts, not instructions.
🔍 Interpretation Guidelines
A strong continuation score means the pullback is controlled, recovering cleanly, preserving the failure line, and keeping useful room to the projected target guide.
A constructive label means the first pullback is behaving better inside the model. It does not mean continuation must occur.
A failure-line label means the plan has lost the structure it needed for this specific pullback framework.
The best use comes from combining the panel state with broader market context, liquidity, volatility, higher-timeframe structure, and personal risk rules.
🚫 What This Script Is NOT
• Not a prediction engine.
• Not financial advice.
• Not auto trading.
• Not guaranteed signals.
• Not a generic support/resistance map.
• Not an order block or FVG scanner.
• Not an Opening Drive Quality clone.
• Not a full opening range breakout system.
⚠️ Limitations & Transparency
Timeframe selection affects the opening reference and the pullback box. A 5-minute chart and a 15-minute chart can produce different plans.
Session definitions matter. The selected opening window should match the asset and market being studied.
Higher-timeframe fallback mode is a broader chart-reference layer. It should be read as a weekly, monthly, or yearly opening-pullback framework rather than a literal intraday open.
Volatility changes can expand or compress risk, target, and pullback behavior.
Low liquidity, abnormal spreads, and high-impact news can reduce the usefulness of any opening pullback model.
🧠 Market Context Notes
The first pullback after the open can be useful because it tests whether the opening move still has sponsorship. A shallow pullback may show strength but offer limited risk clarity. A deep pullback may offer a better reset but also higher failure risk.
This script keeps that decision visible by separating drive retention, pullback quality, continuation trigger, failure line, and target room.
🧾 Use Case Examples
When price locks a bullish opening drive, pulls back into the mapped box, holds above the failure line, and recovers toward the continuation trigger, the panel may shift toward a constructive or ready state.
When price enters the pullback box but keeps closing weakly or pushes beyond the deep boundary, the planner may mark pullback risk.
When price breaks the failure line, the opening pullback plan is no longer structurally intact inside this model.
🧱 System Philosophy
Opening Pullback Planner follows the AGPro Series decision-engine approach: a script should help the trader evaluate validity, strength, risk, target room, and next action instead of only printing another signal.
The tool is built to make one session behavior easier to read: the first pullback after the opening drive.
🔐 Non-Promise Statement
No script can provide certainty.
No opening pullback model can guarantee continuation, reversal, or profitability.
This script provides structured context only.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own decisions.
This script does not provide financial advice, investment advice, or guaranteed trading outcomes.
📚 Educational Note
Use this script as an educational planning and visualization tool. The strongest use comes from reading the first opening pullback together with broader market structure, liquidity, volatility, and personal risk rules.
Indicator

Candle Expansion Readiness [AGPro Series]Candle Expansion Readiness
🧠 Core Idea
Is the current candle expansion meaningful enough to monitor, or is it only a noisy wide candle?
📌 Overview / What it does
Candle Expansion Readiness is a chart-first candle quality planner built to evaluate whether an active expansion candle has enough structure to deserve attention.
Instead of treating every wide candle as important, the script studies body efficiency, wick control, relative volume, ATR-normalized expansion, recent range behavior, and close location. These components are converted into a 0-100 Expansion Readiness Score with a clear state: READY, WATCH, FADE RISK, or WAIT.
The script produces expansion candle labels, a forward follow-through box, risk edge, target guide, failure/fade states, alerts, and a clean AGPro planning panel. It does not predict future price movement, automate decisions, or guarantee that an expansion candle will continue.
🎯 Purpose & Design Philosophy
This script was built for traders who want a cleaner way to judge expansion candles before reacting to them.
The gap it fills is practical: many candle tools mark a candle after it appears, but they do not explain whether that candle is efficient, supported, close-positioned, and monitorable. Candle Expansion Readiness turns that moment into a structured planning question.
The design supports a decision-first workflow: read the candle quality, check whether follow-through is developing, identify the risk edge, and decide whether the context deserves more attention.
⚡ Why This Script Is Different
Most tools focus on large candles, volume spikes, engulfing patterns, institutional candle labels, or general breakout signals.
This script does NOT clone Institutional Candle Detector, does not classify candles into institutional taxonomies, does not build an absorption system, and does not act as a generic breakout-volume tool.
Instead, it evaluates the current expansion candle as a readiness event. The output is not a trade command. It is a planning state that helps users separate monitorable expansion from weak, noisy, or fading candle behavior.
⚙️ Methodology
1. Context Detection
The script reads the active candle side from candle direction and close behavior, or lets the user force bullish or bearish readiness mode.
2. Reference Mapping
It maps the expansion candle, risk edge, follow-through window, and target guide.
3. Reaction Evaluation
The model scores body efficiency, wick control, relative volume, ATR expansion, recent range expansion, and directional close location.
4. Visual Output
The result appears through compact labels, candle glow, a forward follow-through box, risk edge, target guide, deterministic alerts, and the AGPro planning panel.
🗺️ How to Read the Chart
Zones = the follow-through box shows the monitored area from the expansion risk edge toward the target guide. Its label is centered inside the box.
Labels = compact markers show READY, WATCH, DOWNGRADE, CONFIRMED, INVALID, or FADED context.
Colors = green highlights stronger bullish readiness or confirmation, pink highlights bearish or invalidated context, amber highlights caution, and indigo highlights watch behavior.
Panel = the panel summarizes Candle Efficiency, Volume Support, Expansion Score, Follow-Through, and Action.
🚦 Signals & States
• READY → candle expansion quality is strong enough to monitor.
• WATCH → candle quality is improving but confirmation is incomplete.
• FADE RISK → the candle expanded, but wick or close behavior is weak.
• CONFIRMED → follow-through reached the active target guide.
• INVALIDATED → price crossed the active risk edge.
• FADED → the follow-through window expired without confirmation.
• WAIT → no strong enough expansion context is active.
🔔 Alerts Logic
Alerts trigger when the planner enters READY state, downgrades from READY or WATCH, crosses the active risk edge, confirms at the target guide, or fades after the follow-through window.
These alerts are attention markers only. They are not trade instructions, entry signals, or automated strategy commands.
🧩 Confluence Logic
The readiness state becomes stronger when body efficiency, close location, relative volume, ATR expansion, and wick control align on the same candle.
When those elements align and the follow-through box remains active without risk-edge violation, the candle context becomes cleaner. When the score is high but follow-through fails, the planner intentionally downgrades the context instead of ignoring the failure.
📊 When to Use
• Active intraday or swing charts where candle expansion matters.
• Breakout attempts where candle quality needs review.
• Continuation moves that require follow-through monitoring.
• Reversal attempts where the trader wants to know whether the impulse candle is efficient or noisy.
• Liquid symbols with reliable OHLC and volume data.
⚠️ When NOT to Use
• Very low-liquidity markets with unreliable candles.
• Extremely noisy sessions where wide candles fail repeatedly.
• Symbols with poor or missing volume data if volume support is central to your workflow.
• News-driven spikes where normal candle-quality rules may lose relevance.
• As a standalone entry system without broader market context.
🎛️ Key Inputs
• Sensitivity → controls how strict the readiness model is.
• Expansion Lookback → compares the current candle to recent range behavior.
• READY Threshold → minimum 0-100 score required for READY state.
• Confirmation Mode → controls whether close quality alone is enough or whether volume/edge confirmation is required.
• Follow-Through Bars → defines how long the script monitors the active expansion.
• Risk Edge Buffer ATR → moves the invalidation reference slightly beyond the candle edge.
• Visual settings → control boxes, risk edge, target guide, candle glow, labels, panel theme, and font sizes.
🖥️ Interface & Visual Design
The interface is designed to stay chart-first.
The panel gives the current decision state without becoming a crowded dashboard. The follow-through box creates a clean visual planning area, while compact labels keep the chart active without burying price candles.
The first panel row follows the AGPro merged blue header standard and shows only the script name.
🧪 Practical Usage Workflow
1. Read the Expansion Score and Action row.
2. Check whether the candle is READY, WATCH, or FADE RISK.
3. If READY appears, inspect the follow-through box and risk edge.
4. Watch whether price confirms, fades, or invalidates.
5. Interpret the result within your broader structure, liquidity, and risk plan.
🔍 Interpretation Guidelines
Think of the script as a candle expansion planner, not a signal caller.
A READY candle deserves attention because its structure is cleaner than average. A WATCH candle needs more evidence. A FADE RISK candle warns that expansion exists, but the candle quality is not clean. INVALIDATED and FADED states are part of the workflow because failed expansion is useful information.
🚫 What This Script Is NOT
• Not a prediction engine.
• Not financial advice.
• Not auto trading.
• Not guaranteed signals.
• Not an institutional candle detector.
• Not an order block, fair value gap, or support/resistance map.
⚠️ Limitations & Transparency
• Timeframe differences can change how expansion candles appear.
• Volatility spikes can temporarily distort candle-quality readings.
• Volume data may differ by exchange, broker, symbol, and feed.
• Follow-through is evaluated through a fixed monitoring window.
• Market conditions can shift after a READY candle appears.
🧠 Market Context Notes
Candle expansion is most useful when interpreted with liquidity, structure, volatility, and location.
The script focuses on the candle itself and the immediate follow-through plan. Traders should still consider broader trend context, nearby levels, session behavior, and event risk.
🧾 Use Case Examples
When a bullish candle closes near its high with strong body efficiency and relative volume, the script may mark READY and project a follow-through box above the risk edge.
When a wide candle has heavy wick behavior and poor close location, the script may flag FADE RISK instead of treating the candle as clean expansion.
When a READY candle fails back through its risk edge, the active plan becomes INVALIDATED.
🧱 System Philosophy
AGPro tools are designed to support structured chart reading. The goal is to convert market behavior into clean, rule-based context that helps traders think more clearly.
Candle Expansion Readiness follows that philosophy by turning a single expansion candle into a monitored planning state.
🔐 Non-Promise Statement
No script can provide certainty.
This tool organizes candle expansion context, but it does not guarantee continuation, reversal, profit, or any specific market outcome.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own analysis, execution, position sizing, and risk management.
Nothing in this script or description is financial advice.
📚 Educational Note
Use the script to study how clean expansion candles behave across different symbols and timeframes. The value is in comparing candle quality, follow-through, and failure behavior over time.
Indicator

Reclaim Breakout Planner [AGPro Series]Reclaim Breakout Planner
🧠 Core Idea
Is a recently broken structural level being lost and reclaimed in a way that creates a valid breakout planning area?
📌 Overview / What it does
Reclaim Breakout Planner is a chart-first breakout planning tool built around structural pivot reclaim behavior. It detects when price breaks beyond a confirmed pivot level, temporarily moves back through that broken level, and then closes back on the breakout side with measurable acceptance quality.
The script produces a 0-100 Acceptance Score, an active Reclaim State, an Acceptance Pocket, a Risk Edge, a Target Corridor, controlled chart labels, and a compact AG Pro panel. The goal is to help traders organize reclaim context after a structural breakout attempt.
This script does not predict price direction, automate trades, or mark every pivot as important. It filters for a specific sequence: structural level break -> temporary level loss -> reclaim close -> planning state.
🎯 Purpose & Design Philosophy
Many breakout tools stop after price crosses a level. Many retest tools treat any return to the level as meaningful. This script was built for the narrower question that often matters after a breakout: did price briefly lose the broken level and then reclaim it with enough quality to deserve attention?
It is designed for traders who want a cleaner decision-support layer around breakout acceptance, not another crowded support/resistance map. The mindset is planning first: evaluate validity, score quality, locate risk, estimate target room, and decide whether the context deserves monitoring.
⚡ Why This Script Is Different
Most tools focus on the breakout candle or the retest touch.
This script does NOT clone VWAP Reclaim Quality, Previous Day Sweep & Reclaim, EMA reclaim maps, session VWAP reaction tools, or a simple breakout retest readiness model.
Instead, it focuses on structural pivot reclaim after a level is briefly lost. The reclaim must come from a confirmed pivot break, a temporary move back through the broken level, and a close back on the breakout side. That creates a distinct reclaim-planning workflow rather than a generic level scanner.
⚙️ Methodology
1. Context Detection
The script identifies confirmed pivot highs and pivot lows as structural levels. These levels are not VWAP, previous-day highs/lows, session anchors, order blocks, or fixed support/resistance zones.
2. Breakout Arming
When price closes beyond a pivot level by an ATR-normalized amount, the planner arms a reclaim watch. A bullish watch begins after a close above resistance. A bearish watch begins after a close below support.
3. Reclaim Evaluation
The script waits for price to temporarily lose the broken level and then close back through it. It scores the event using reclaim close distance, retest depth, volume support, trend alignment, and wick rejection.
4. Visual Output
Accepted reclaims create an Acceptance Pocket, Risk Edge, Target Corridor, event labels, sparse context labels, and panel state. The visuals are designed to stay readable without leaving the chart empty.
🗺️ How to Read the Chart
Acceptance Pocket = the reclaimed structural level area where the breakout side is being tested.
Risk Edge = the failed-side reference beyond the pocket. It is a planning boundary, not a trading instruction.
Target Corridor = a projected review area based on the reclaim risk distance and the selected R multiple.
Labels = compact event and context markers such as Bull Reclaim, Bear Reclaim, Retest Watch, and Failed Reclaim. Target Review labels are optional because the target corridor already marks the review area.
Colors = bullish reclaim context uses teal, bearish reclaim context uses pink, caution/watch states use gold or indigo, and risk/failure context uses red.
Panel = shows Reclaim State, Acceptance Score, Risk Edge, Target Room, and Action.
🚦 Signals & States
• Scan Structure → no active reclaim plan exists yet.
• Bull Retest Watch → price broke above a structural pivot and is waiting for a valid reclaim sequence.
• Bear Retest Watch → price broke below a structural pivot and is waiting for a valid reclaim sequence.
• Acceptance Watch → reclaim exists, but the score is not strong enough for the highest planning state.
• Plan Review → reclaim quality is strong enough to monitor as structured planning context.
• Risk Edge Test → price is testing the failed-side boundary.
• Failed Reclaim → the active reclaim plan closed beyond the risk edge.
• Target Review → price reached the projected target corridor area.
🔔 Alerts Logic
Bullish Reclaim Breakout Plan triggers when a bullish structural reclaim is accepted and the score is above the alert threshold.
Bearish Reclaim Breakout Plan triggers when a bearish structural reclaim is accepted and the score is above the alert threshold.
Reclaim Risk Edge Failed triggers when an active reclaim plan closes beyond the risk edge.
Reclaim Target Corridor Reached triggers when price reaches the projected target corridor.
Alerts are attention markers. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when a confirmed pivot breakout, temporary level loss, reclaim close, supportive volume, trend alignment, and wick rejection appear together. The score compresses those components into one readable 0-100 Acceptance Score.
📊 When to Use
• After structural breakouts where price returns to the broken level
• During trending or transitioning markets where reclaim behavior matters
• When evaluating whether a breakout level is being accepted after a brief failure
• When a trader needs risk edge and target-room context around a reclaim sequence
⚠️ When NOT to Use
• Very low-liquidity symbols with unreliable volume and erratic candles
• Extremely noisy ranges where pivots form too frequently
• News-driven candles where ATR-normalized structure can be distorted
• Markets where price is far from any meaningful structural pivot
🎛️ Key Inputs
• Reclaim Side → selects Auto, Bullish Only, or Bearish Only.
• Pivot Strength → controls how selective structural levels are.
• Minimum Break Close ATR → defines how far beyond the pivot price must close before a reclaim watch is armed.
• Minimum Level Loss ATR → requires price to temporarily move back through the broken level before reclaim evaluation.
• Acceptance Pocket ATR → controls the visual and logical reclaim pocket size.
• Retest Window Bars → controls how long the reclaim watch remains valid.
• Risk Edge Buffer ATR → adjusts the failed-side planning boundary.
• Target Corridor R Multiple → controls the projected target review area.
• Label and Panel Settings → control chart label density, optional target review labels, font size, panel location, and panel theme.
🖥️ Interface & Visual Design
The interface is intentionally compact. The chart carries the main decision layer through acceptance pockets, risk edges, target corridors, and event labels. The panel acts as a quick readout for state, score, risk, target room, and next action.
The first panel row follows the AGPro style with a merged blue title row. Label density is controlled by cooldown and maximum visible label settings so the chart remains premium and readable.
🧪 Practical Usage Workflow
1. Read the panel state.
2. Check whether the planner is scanning, watching a retest, or showing an accepted reclaim.
3. Inspect the Acceptance Pocket and Risk Edge.
4. Compare the Acceptance Score with the active state.
5. Use the Target Corridor as a review area, not as a guaranteed objective.
🔍 Interpretation Guidelines
A high score means the reclaim sequence is cleaner under the script's rules. It does not mean the market must continue.
A weak score means the reclaim lacks enough acceptance quality, volume support, trend alignment, or wick rejection.
A failed reclaim means the planning structure has weakened and should be re-evaluated in broader market context.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not auto trading
• Not guaranteed signals
• Not a VWAP reclaim tool
• Not a previous-day sweep reclaim script
• Not a generic support/resistance map
• Not an order block or FVG scanner
⚠️ Limitations & Transparency
Timeframe selection affects pivot behavior. Lower timeframes may create more reclaim sequences, while higher timeframes may produce fewer but more important structural levels.
Volatility can widen pockets and risk edges. During extreme volatility, reclaim signals can appear later or fail faster.
Volume quality may be less reliable on markets where reported volume is synthetic, incomplete, or inconsistent.
🧠 Market Context Notes
Reclaim behavior often matters when a market tests whether a broken level is becoming accepted. A clean reclaim can show that a breakout area is still being defended. A failed reclaim can show that the attempted breakout lost structure.
The script treats that behavior as planning context, not certainty.
🧾 Use Case Examples
When price closes above a pivot high, dips back below the broken level, then closes back above it with rejection wick and supportive volume, the planner may create a bullish reclaim plan.
When price closes below a pivot low, trades back above the broken level, then closes back below it with rejection behavior, the planner may create a bearish reclaim plan.
🧱 System Philosophy
AGPro tools are designed to help traders organize context, not chase isolated signals. This script follows that principle by turning reclaim behavior into a structured planning workflow with score, state, risk edge, target room, and action text.
🔐 Non-Promise Statement
No script can guarantee continuation, reversal, or future price behavior. Reclaim structure can fail, especially in fast, illiquid, or news-driven markets.
📉 Risk Disclosure
Trading involves risk. This script is for educational and analytical use only. It does not provide financial advice, investment advice, or guaranteed trading outcomes. Users remain responsible for their own decisions.
📚 Educational Note
Use the script to study how reclaimed structural levels behave across symbols, timeframes, and volatility environments. The best use is disciplined observation, comparison, and context building.
Indicator

Indicator

Risk Management Calculator [tradeviZion]Risk Management Calculator - Script Description
📖 Overview
The Risk Management Calculator helps you find the optimal risk per trade based on your strategy's win rate, risk-to-reward ratio, and your tolerance for drawdowns and blowout risk. Instead of guessing a fixed 1–2%, it uses established formulas (Edge, Kelly criterion, and Risk of Ruin) to suggest a risk % that balances growth with survival.
Designed for swing traders, day traders, and systematic traders who want to size positions mathematically rather than by rule of thumb.
One risk % does not fit all. Your edge and tolerance for consecutive losses determine the best risk per trade.
Edge & Kelly - Computes your strategy edge and Full/Half/Quarter Kelly fractions
Risk of Ruin - Shows blowout probability at 1% to 10% risk, or solves for max risk given your target RoR
Consecutive Losses - Probability P(k) and drawdown at k losses for your chosen k values
Consecutive Losses Cone - Visual pane with P(k) and DD curves (2%, 3%, 5%, Rec, Max DD), k marker (vertical line + dot), best risk % for your selected k. Labels on curves; hover for tooltips. Optional legend in table.
---
⚙️ How It Works
⚪ Edge
Your edge is the expected value per unit risked. Positive edge means the strategy is profitable in expectation.
Edge = winRate × R:R − lossRate
Example: 30% win rate, 1:3 R:R → Edge = 0.30×3 − 0.70 = 0.20 (positive expectancy).
⚪ Risk of Ruin
The probability of losing your entire account. The formula uses your edge and risk fraction:
RoR ≈ ((1 − edge) / (1 + edge))^(1 / r)
where r is risk per trade. Assumes a long series of independent bets with stable edge. Lower risk per trade reduces RoR. Doubling risk increases RoR more than linearly. Approximation; may break down with skewed returns or finite horizons.
⚪ Kelly Criterion
The Kelly fraction maximizes long-run geometric growth. Full Kelly is often too aggressive; Half or Quarter Kelly is commonly used.
Full Kelly = (R:R × winRate − lossRate) / R:R
⚪ Consecutive Losses
Probability of k losses in a row:
P(k) = (1 − winRate)^k
Drawdown after k losses:
DD(k) = 1 − (1 − risk)^k
⚪ Best Risk
In Solve mode, the script finds the maximum risk % such that RoR ≤ your target. The Consecutive Losses Cone also computes a best risk % that keeps drawdown at your selected k within your Cone Max DD % limit, and uses the stricter of the two.
---
🎯 How to Use
Add the indicator to your chart (any symbol; it uses inputs only)
Enter your Account Capital , Win Rate % , and Risk-to-Reward Ratio from your backtest or live stats
Choose Mode : Solve for max risk % to get recommended risk, or Show RoR for given risk % to analyze a specific risk level
Review the Summary (Edge, Kelly, Recommended risk, Risk amount) and RoR Comparison table
Check the Consecutive Losses section to see P(k) and drawdown at your k values
Use the Probability Cone to visualize curves and the best risk % for your Cone Risk Marker k and Cone Max DD % . Hover cone labels for tooltips. Enable Cone Legend for a table legend.
---
⚙️ Settings
Core Parameters
Account Capital - Your trading capital. Used to show risk amount in dollars (e.g., 2% = $200 on $10,000).
Win Rate % - Percentage of winning trades (e.g., 30 = 30% winners, 70% losers).
Risk-to-Reward Ratio - Profit per unit risk (e.g., 3 = 1:3 R:R).
Target RoR % - Maximum acceptable Risk of Ruin. Lower = safer. Used when Mode is Solve for max risk % .
Target RoR Mode
Mode - Solve for max risk % : finds max risk within Target RoR. Show RoR for given risk % : shows RoR at Reference Risk %.
Reference Risk % - Risk % to analyze when Mode is Show RoR .
Consecutive Losses
k₁ to k₅ - Number of consecutive losses to analyze. Example: k₁=5 shows P(5) and drawdown at 5 losses in a row.
Table Settings
Color Theme - Dark, Light, Ocean Blue, Forest Green, etc.
Table Text Size - Tiny, Small, Normal, Large.
Tables Position - Left, Middle, or Right. All three tables stack vertically: Risk Management Calculator (top), Consecutive Losses Cone (middle), Consecutive Losses (bottom).
Display
Summary - Edge, Kelly, Recommended risk, Risk amount.
RoR Comparison - RoR at 1%, 2%, 3%, 5%, 7%, 10%.
Consecutive Losses - P(k) and DD table for k₁–k₅.
Probability Cone - P(k) and DD curves in a separate pane.
Cone Max k - Max consecutive losses on cone x-axis (20–100).
Cone Risk Marker k - k value highlighted with vertical line and dot.
Cone Max DD % - Max acceptable drawdown at marker k. Best risk respects this limit.
Cone Legend - Optional legend in the cone table (P(k) curve, DD curves, Rec%, best risk, k marker). Hover chart labels for the same info.
P(k) Color, DD Color, DD Rec% Color - Colors for cone curves. DD Rec% also used for best risk curve when RoR-limited (green); theme color when DD-limited.
---
⚠️ Disclaimer
This indicator is for educational and informational purposes only . It does not constitute investment advice. Past performance and backtested statistics do not guarantee future results. The RoR formula is an approximation and may not hold under skewed returns or finite horizons. Always do your own research and consider consulting a qualified financial advisor before trading.
Indicator

Hidden Markov Model: Baum-Welch [UAlgo]Hidden Markov Model: Baum-Welch is a regime detection and reversal signaling indicator that applies a 3 state Hidden Markov Model to normalized log returns and continuously adapts its parameters using an online Baum Welch expectation maximization routine. The script is designed to classify the market into three latent regimes, then express that classification as real time probabilities for Bull, Range, and Bear conditions.
The indicator runs in its own pane ( overlay=false ) and outputs:
Probability curves for the three regimes
A dominant regime score scaled to 0 to 1
A regime strip visualization for quick bias reading
Adaptive background coloring based on the dominant regime and confidence
Optional regime shift markers
Optional buy and sell reversal markers driven by strict multi condition logic
The core idea is that price behavior can be modeled as transitions between hidden states that each have their own return distribution. The script fits a Gaussian emission model for each state, estimates state transition probabilities, and updates the posterior probability of each state on every bar. It retrains the full model at fixed intervals, while using a faster one step forward update between retrains for efficiency.
This implementation is not a simple threshold oscillator. It is a full mini HMM engine built in Pine with:
Scaled forward and backward algorithms
Expectation step producing gamma and xi posteriors
Maximization step updating initial distribution, transition matrix, state means, and state variances
Safeguards such as variance floors and transition floors to maintain numerical stability
The output is a regime aware probability system that can be used for bias, context, and reversal confirmation rather than simple entry signals.
Educational tool only. Not financial advice.
🔹 Features
🔸 1) Three State Hidden Markov Model Regime Engine
The model uses three hidden states and continuously estimates the probability of being in each state:
Bull regime
Range regime
Bear regime
This gives a probabilistic regime map rather than a single hard classification.
🔸 2) Baum Welch Training with Scheduled Retraining
The script retrains its parameters using an EM routine at a user defined interval in bars. Each retrain runs a configurable number of EM iterations. Between retrains, the indicator performs a one step forward Bayesian update of the posterior state probabilities.
This structure balances adaptability with performance.
🔸 3) Normalized Log Return Observations
The observation series is a z score normalized log return:
Log returns convert price changes into additive units
An EMA and rolling standard deviation normalize the series to stabilize the HMM fit
This helps the HMM learn regimes based on relative return behavior rather than raw price scale.
🔸 4) Automatic Bull, Range, and Bear Role Assignment
The model learns state means. The script then assigns roles by ranking those learned means:
The state with the lowest mean becomes the Bear state
The state with the highest mean becomes the Bull state
The remaining state is treated as Range
This keeps regime labeling consistent even as the internal state ordering shifts during training.
🔸 5) Probabilities and Dominant Regime Visualization
The script plots:
Bull probability curve
Range probability curve
Bear probability curve
It also plots an area for the dominant probability and a regime strip that makes it easy to see the dominant regime quickly without reading the full curves.
🔸 6) Regime Score Line (Bull minus Bear)
A continuous score is calculated as Bull probability minus Bear probability, then scaled to a 0 to 1 range. This score becomes the main regime momentum signal used for rebound and reversal logic.
🔸 7) Adaptive Background Coloring by Regime and Confidence
The pane background color changes based on the dominant regime. Transparency adapts according to confidence, so strong regime certainty produces a more visible background while low certainty remains subtle.
🔸 8) Strict Signal Filters for Bias and Reversal
The indicator provides bias filters:
Bull bias when Bull probability and confidence exceed thresholds and the dominant regime is Bull
Bear bias when Bear probability and confidence exceed thresholds and the dominant regime is Bear
It also provides reversal style buy and sell signals based on a multi condition framework described in the calculations section.
🔸 9) Reversal Logic Combining Extremes, Rebounds, and Transition Edge
Reversal signals are not generated by a single crossover. The script requires:
An extreme score pivot
An extreme regime probability at that pivot
A rebound trigger through predefined rebound levels
A minimum probability and confidence filter
A transition asymmetry and edge condition that favors switching toward the target regime
A momentum condition requiring Bull probability rising and Bear probability falling for buys, and the inverse for sells
A time window limit so reversals must occur within a limited number of bars after the extreme
This creates a high selectivity reversal engine.
🔸 10) Transition Matrix Insight and Switch Edge Metrics
The script computes predicted transition probabilities toward Bull and Bear using the current posterior and the transition matrix. It also measures transition asymmetry between Bull to Bear and Bear to Bull and uses these values as part of reversal confirmation.
This adds structural information that classic oscillators do not capture.
🔸 11) Anti Duplicate Reversal Signals
Once a pivot extreme has been used to generate a reversal signal, it is marked as consumed so the same pivot cannot repeatedly trigger additional buy or sell signals. This helps avoid signal repetition.
🔸 12) Full Informational Label Output
A live info label prints:
Current regime
Current signal text
Confidence
Bull, Range, Bear probabilities
Log likelihood
Key trigger thresholds
Reversal settings and edge settings
This provides transparency into what the model is currently seeing and why signals are or are not appearing.
🔹 Calculations
1) Observation Series: Normalized Log Returns
The script uses log returns:
logRet = math.log(close / nz(close , close))
Then normalizes them with an EMA mean and rolling standard deviation:
retMean = nz(ta.ema(logRet, normLength), 0.0)
retStd = math.max(nz(ta.stdev(logRet, normLength), 0.0), 1e-6)
obs = (logRet - retMean) / retStd
This creates an observation series with more stable scale properties across time.
2) Rolling Observation Window
The HMM is trained on a rolling window of length windowLen . Only the most recent processRecentBars are processed to control load:
startBar = last_bar_index - processRecentBars
activeRange = bar_index >= (startBar < 0 ? 0 : startBar)
If active, the observation is appended and the oldest one is removed:
if array.size(obsWindow) < windowLen
array.push(obsWindow, obs)
else
array.shift(obsWindow)
array.push(obsWindow, obs)
The model is ready only when the window is full.
3) Model Initialization
The script initializes a 3 state model with:
Uniform initial state probabilities
A transition matrix seeded with high persistence and equal small jump probabilities
State means initialized around zero with a configured separation
State variances initialized to a configured starting value
Key logic:
Stay probability equals initialPersistence
Jump probability equals the remaining probability split across other states
This gives the HMM a stable starting point before training.
4) Emission Model: Gaussian per State
Each state emits observations using a Gaussian density:
math.exp(-0.5 * d * d / varS) / math.sqrt(TWO_PI * varS)
Variance uses a floor:
float varS = math.max(array.get(this.vr, s), varMin)
This prevents variance collapse and numeric instability.
5) Forward Algorithm with Scaling
The script computes the forward probabilities alpha and applies scaling coefficients c to prevent underflow. It then recovers log likelihood from the scaling coefficients:
this.logLik := -sum(log(c ))
This is essential because HMM sequences quickly underflow without scaling.
6) Backward Algorithm with Scaling
The backward probabilities beta are computed using the scaling values from the forward pass, ensuring alpha and beta remain numerically stable across the entire window.
7) Expectation Step: Gamma and Xi
Gamma represents posterior probability of being in state i at time t . Xi represents posterior probability of transitioning from i to j between t and t+1 .
Xi is normalized per time step:
xij = xi_raw / denom
Gamma is computed as the sum of xi across outgoing transitions for each state:
gamma(t, i) = sum_j xi(t, i, j)
8) Maximization Step: Updating Parameters
Initial probabilities update from gamma at time 0:
pi = gamma(0, i)
Transition probabilities update from xi sums divided by gamma sums, with a transition floor and row normalization:
Each transition is clamped to transitionFloor
Each row is normalized to sum to 1
Means update as weighted averages of observations using gamma weights.
Variances update as weighted squared deviation sums with a variance floor.
9) Retraining Schedule and Online Updates
The model retrains when:
It is not initialized yet
Or the bar index matches the retrain interval
shouldRetrain = ready and (not modelInitialized or bar_index % retrainEveryBars == 0)
On retrain, Baum Welch is run for emIterations .
Between retrains, the script performs a one step forward update of the posterior:
hmm.forwardOne(posterior, obs, varianceFloor, posteriorTmp)
This provides continuous posterior updates without full retraining on every bar.
10) Role Mapping to Bull, Range, Bear
The script assigns which internal state corresponds to Bear and Bull by looking at the learned means:
Bear state is the state with the minimum mean
Bull state is the state with the maximum mean
Range is the remaining state index
This mapping updates dynamically as the model learns.
11) Regime Score and Confidence
The regime score is:
score = pBull - pBear
It is then scaled to 0 to 1:
score01 = 0.5 + 0.5 * score
Confidence is:
confidence = max(pBull, pRange, pBear)
This confidence drives background alpha and signal gating.
12) Probability Filters for Bias
Bull filter requires:
Bull probability above bullProbTrigger
Confidence above signalConfidenceMin
Bear filter requires similar conditions for Bear probability.
Bias validity adds the requirement that the dominant regime role matches the direction:
Bull bias requires dominantRole equals 1
Bear bias requires dominantRole equals minus 1
13) Extreme Pivot Logic for Reversal Candidates
The script looks for pivots in the score line:
ta.pivotlow(score01, pivotStrength, 1)
ta.pivothigh(score01, pivotStrength, 1)
It stores the most recent pivot low and pivot high along with the associated Bull or Bear probability at the pivot bar.
A low extreme is valid if:
Score at pivot is below dipScoreLevel
Bear probability at pivot exceeds extremeProbMin
A high extreme is valid if:
Score at pivot is above topScoreLevel
Bull probability at pivot exceeds extremeProbMin
14) Rebound Triggers
After an extreme, the script waits for rebound triggers:
Up rebound:
ta.crossover(score01, reboundUpLevel)
Down rebound:
ta.crossunder(score01, reboundDownLevel)
Rebound must occur within the reversal window bars from the extreme pivot.
15) Transition Edge and Asymmetry Logic
The script computes predicted probabilities of switching toward Bull or Bear using the transition matrix and current posterior. It also computes transition asymmetry between the Bull to Bear and Bear to Bull transitions.
A bullish switch condition requires:
Switch edge greater than hmmEdgeMin
Transition asymmetry favoring Bear to Bull at or above transitionAsymMin
Bull probability greater than Bear probability
A bearish switch condition uses the mirrored logic.
This adds a model based confirmation that a regime switch is plausible, not only that the score bounced.
16) Momentum Confirmation
Bull momentum requires:
Bull probability rising
Bear probability falling
Bear momentum requires the opposite.
These conditions prevent signals when probabilities are flat or conflicting.
17) Final Reversal Signal Construction
Buy reversal requires:
Valid low extreme
Not consumed
Inside reversal window
Rebound up
Bull probability and confidence filter
Bullish HMM switch condition
Bull momentum
Sell reversal requires the mirrored set of conditions.
The sell is suppressed if a buy is simultaneously true so conflicting signals do not print on the same bar.
18) Visualization Output
The script plots:
Probability curves for each regime
A dominant probability area
A thick score line colored by regime
A regime strip column plot
Fills between Bull and Bear curves and between rebound levels
Adaptive background
Optional markers for regime shifts
Reversal markers as glow plus label style plots
The info label consolidates the most important current state and threshold data for transparency. Indicator

Dominance Signal Apex [CHE]]Dominance Signal Apex — Triple-confirmed entry markers with stateful guardrails
Summary
This indicator focuses on entry timing by plotting markers only when three conditions align: a closed-bar Heikin-Ashi bias, a monotonic stack of super-smoother filters, and the current HMA slope. A compact state machine provides guardrails: it starts a directional state on closed-bar Heikin-Ashi bias, maintains it only while the smoother stack remains ordered, and renders a marker only if HMA slope agrees. This design aims for selective signals and reduces isolated prints during mixed conditions. Markers fade over time to visualize the age and persistence of the current state.
Motivation: Why this design?
Common triggers flip frequently in noise or react late when regimes shift. The core idea is to gate entry markers through a closed-bar state plus independent filter alignment. The state machine limits premature prints, removes markers when alignment breaks, and uses the HMA as a final directional gate. The result is fewer mixed-context entries and clearer clusters during sustained trends.
What’s different vs. standard approaches?
Reference baseline: Single moving-average slope or classic MA cross signals.
Architecture differences:
Multi-length two-pole super-smoother stack with strict ordering checks.
Closed-bar Heikin-Ashi bias to start a directional state.
HMA slope as a final gate for rendering markers.
Time-based alpha fade to surface state age.
Practical effect: Entry markers appear in clusters during aligned regimes and are suppressed when conditions diverge, improving selectivity.
How it works (technical)
Measurements: Four recursive super-smoother series on price at short to medium horizons. Up regime means each shorter smoother sits below the next longer one; down regime is the inverse.
State machine: On bar close, positive Heikin-Ashi bias starts a bull state and negative bias starts a bear state. The state terminates the moment the smoother ordering breaks relative to the prior bar.
Rendering gate: A marker prints only if the active state agrees with the current HMA slope. The HMA is plotted and colored by slope for context.
Normalization and clamping: Marker transparency transitions from a starting to an ending alpha across a fixed number of bars, clamped within the allowed range.
Initialization: Persistent variables track state and bar-count since state start; Heikin-Ashi open is seeded on the first valid bar.
HTF/security: None used. State updates are closed-bar, which reduces repaint paths.
Bands: Smoothed high, low, centerline, and offset bands are computed but not rendered.
Parameter Guide
Show Markers — Toggle rendering — Default: true — Hides markers without changing logic.
Bull Color / Bear Color — Visual colors — Defaults: bright green / red — Aesthetic only.
Start Alpha / End Alpha — Transparency range — Defaults: one hundred / fifty, within zero to one hundred — Controls initial visibility and fade endpoint.
Steps — Fade length in bars — Default: eight, minimum one — Longer values extend the visual memory of a state.
Smoother Length — Internal band smoothing — Default: twenty-one, minimum two — Affects computed bands only; not drawn.
Band Multiplier — Internal band offset — Default: one point zero — No impact on markers.
Source — Input for HMA — Default: close — Align with your workflow.
Length — HMA length — Default: fifty, minimum one — Larger values reduce flips; smaller values react faster.
Reading & Interpretation
Entry markers:
Bull marker (below bar): Closed-bar Heikin-Ashi bias is positive, smoother stack remains aligned for up regime, and HMA slope is rising.
Bear marker (above bar): Closed-bar Heikin-Ashi bias is negative, smoother stack remains aligned for down regime, and HMA slope is falling.
Fade: Transparency progresses over the configured steps, indicating how long the current state has persisted.
Practical Workflows & Combinations
Trend following: Focus on marker clusters aligned with HMA color. Add structure filters such as higher highs and higher lows or lower highs and lower lows to avoid counter-trend entries.
Exits/Stops: Consider exiting or reducing risk when smoother ordering breaks, when HMA color flips, or when marker cadence thins out.
Multi-asset/Multi-TF: Suitable for liquid crypto, FX, indices, and equities. On lower timeframes, shorten HMA length and fade steps for faster response.
Behavior, Constraints & Performance
Repaint/confirmation: State transitions and marker eligibility are decided on closed bars; live bars do not commit state changes until close.
security()/HTF: Not used.
Resources: Declared max bars back of one thousand five hundred; recursive filters and persistent states; no explicit loops.
Known limits: Some delay around sharp turns; brief states may start in noisy phases but are quickly revoked when alignment fails; HMA gating can miss very early reversals.
Sensible Defaults & Quick Tuning
Start here: Keep defaults.
Too many flips: Increase HMA length and raise fade steps.
Too sluggish: Decrease HMA length and reduce fade steps.
Markers too faint/bold: Adjust start and end alpha toward lower or higher opacity.
What this indicator is—and isn’t
A selective entry-marker layer that prints only under triple confirmation with stateful guardrails. It is not a full system, not predictive, and does not handle risk. Combine with market structure, risk controls, and position management.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Best regards and happy trading
Chervolino Indicator

Strategy

Optimal Buy Day (Zeiierman)█ Overview
The Optimal Buy Day (Zeiierman) indicator identifies optimal buying days based on historical price data, starting from a user-defined year. It simulates investing a fixed initial capital and making regular monthly contributions. The unique aspect of this indicator involves comparing systematic investment on specific days of the month against a randomized buying day each month, aiming to analyze which method might yield more shares or a better average price over time. By visualizing the potential outcomes of systematic versus randomized buying, traders can better understand the impact of market timing and how regular investments might accumulate over time.
These statistics are pivotal for traders and investors using the script to analyze historical performance and strategize future investments. By understanding which days offered more shares for their money or lower average prices, investors can tailor their buying strategies to potentially enhance returns.
█ Key Statistics
⚪ Shares
Definition: Represents the total number of shares acquired on a particular day of the month across the entire simulation period.
How It Works: The script calculates how many shares can be bought each day, given the available capital or monthly contribution. This calculation takes into account the day's opening price and accumulates the total shares bought on that day over the simulation period.
Interpretation: A higher number of shares indicates that the day consistently offered better buying opportunities, allowing the investor to acquire more shares for the same amount of money. This metric is crucial for understanding which days historically provided more value.
⚪ AVG Price
Definition: The average price paid per share on a particular day of the month, averaged over the simulation period.
How It Works: Each time shares are bought, the script calculates the average price per share, factoring in the new shares purchased at the current price. This average evolves over time as more shares are bought at varying prices.
Interpretation: The average price gives insight into the cost efficiency of buying shares on specific days. A lower average price suggests that buying on that day has historically led to better pricing, making it a potentially more attractive investment strategy.
⚪ Buys
Definition: The total number of transactions or buys executed on a particular day of the month throughout the simulation.
How It Works: This metric increments each time shares are bought on a specific day, providing a count of all buying actions taken.
Interpretation: The number of buys indicates the frequency of investment opportunities. A higher count could mean more consistent opportunities for investment, but it's important to consider this in conjunction with the average price and the total shares acquired to assess overall strategy effectiveness.
⚪ Most Shares
Definition: Identifies the day of the month on which the highest number of shares were bought, highlighting the specific day and the total shares acquired.
How It Works: After simulating purchases across all days of the month, the script identifies which day resulted in the highest total number of shares bought.
Interpretation: This metric points out the most opportune day for volume buying. It suggests that historically, this day provided conditions that allowed for maximizing the quantity of shares purchased, potentially due to lower prices or other factors.
⚪ Best Price
Definition: Highlights the day of the month that offered the lowest average price per share, indicating both the day and the price.
How It Works: The script calculates the average price per share for each day and identifies the day with the lowest average.
Interpretation: This metric is key for investors looking to minimize costs. The best price day suggests that historically, buying on this day led to acquiring shares at a more favorable average price, potentially maximizing long-term investment returns.
⚪ Randomized Shares
Definition: This metric represents the total number of shares acquired on a randomly selected day of the month, simulated across the entire period.
How It Works: At the beginning of each month within the simulation, the script selects a random day when the market is open and calculates how many shares can be purchased with the available capital or monthly contribution at that day's opening price. This process is repeated each month, and the total number of shares acquired through these random purchases is tallied.
Interpretation: Randomized shares offer a comparison point to systematic buying strategies. By comparing the total shares acquired through random selection against those bought on the best or worst days, investors can gauge the impact of timing and market fluctuations on their investment strategy. A higher total in randomized shares might indicate that over the long term, the specific days chosen for investment might matter less than consistent market participation. Conversely, if systematic strategies yield significantly more shares, it suggests that timing could indeed play a crucial role in maximizing investment returns.
⚪ Randomized Price
Definition: The average price paid per share for the shares acquired on the randomly selected days throughout the simulation period.
How It Works: Each time shares are bought on a randomly chosen day, the script calculates the average price paid for all shares bought through this randomized strategy. This average price is updated as the simulation progresses, reflecting the cost efficiency of random buying decisions.
Interpretation: The randomized price metric helps investors understand the cost implications of a non-systematic, random investment approach. Comparing this average price to those achieved through more deliberate, systematic strategies can reveal whether consistent investment timing strategies outperform random investment actions in terms of cost efficiency. A lower randomized price suggests that random buying might not necessarily result in higher costs, while a higher average price indicates that systematic strategies might provide better control over investment costs.
█ How to Use
Traders can use this tool to analyze historical data and simulate different investment strategies. By inputting their initial capital, regular contribution amount, and start year, they can visually assess which days might have been more advantageous for buying, based on historical price actions. This can inform future investment decisions, especially for those employing dollar-cost averaging strategies or looking to optimize entry points.
█ Settings
StartYear: This setting allows the user to specify the starting year for the investment simulation. Changing this value will either extend or shorten the period over which the simulation is run. If a user increases the value, the simulation begins later and covers a shorter historical period; decreasing the value starts the simulation earlier, encompassing a longer time frame.
Capital: Determines the initial amount of capital with which the simulation begins. Increasing this value simulates starting with more capital, which can affect the number of shares that can be initially bought. Decreasing this value simulates starting with less capital.
Contribution: Sets the monthly financial contribution added to the investment within the simulation. A higher contribution increases the investment each month and could lead to more shares being purchased over time. Lowering the contribution decreases the monthly investment amount.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Indicator

Indicator

Indicator

vertical_pricer
USAGE
1. Select the type of contract (call or put), the long strike, and the width.
2. Select the volatility model
3. The standard deviation is shown, enter it into the input.
The tool gives a theoretical price of a vertical spread, based on a
historical sample. The test assumes that a spread of equal width was sold on
every prior trading day at the given standard deviation, based on the
volatility model and duration of the contract. For example, if the 20 dte
110 strike is presently two standard deviations based on the 30 period
historical volatility, then the theoretical value is the average price all
2SD (at 20 dte) calls upon expiration, limited by the width of the spread and
normalized according to the present value of the underlying.
Other statistics include:
- The number of spreads in the sample, and percentage expired itm
- The median value at expiration
- The Nth percentile value of spreads at expiration
- The number of spreads that expired at max loss
Check the script comments and release notes for further updates, since Tradingview doesn't allow me to edit this description. Indicator

Indicator

Edge-Preserving FilterIntroduction
Edge-preserving smoothing is often used in image processing in order to preserve edge information while filtering the remaining signal. I introduce two concepts in this indicator, edge preservation and an adaptive cumulative average allowing for fast edge-signal transition with period increase over time. This filter have nothing to do with classic filters for image processing, those filters use kernels convolution and are most of the time in a spatial domain.
Edge Detection Method
We want to minimize smoothing when an edge is detected, so our first goal is to detect an edge. An edge will be considered as being a peak or a valley, if you recall there is one of my indicator who aim to detect peaks and valley (reference at the bottom of the post) , since this estimation return binary outputs we will use it to tell our filter when to stop filtering.
Filtering Increase By Using Multi Steps Cumulative Average
The edge detection is a binary output, using a exponential smoothing could be possible and certainly more efficient but i wanted instead to try using a cumulative average approach because it smooth more and is a bit more original to use an adaptive architecture using something else than exponential averaging. A cumulative average is defined as the sum of the price and the previous value of the cumulative average and then this result is divided by n with n = number of data points. You could say that a cumulative average is a moving average with a linear increasing period.
So lets call CMA our cumulative average and n our divisor. When an edge is detected CMA = close price and n = 1 , else n is equal to previous n+1 and the CMA act as a normal cumulative average by summing its previous values with the price and dividing the sum by n until a new edge is detected, so there is a "no filtering state" and a "filtering state" with linear period increase transition, this is why its multi-steps.
The Filter
The filter have two parameters, a length parameter and a smooth parameter, length refer to the edge detection sensitivity, small values will detect short terms edges while higher values will detect more long terms edges. Smooth is directly related to the edge detection method, high values of smooth can avoid the detection of some edges.
smooth = 200
smooth = 50
smooth = 3
Conclusion
Preserving the price edges can be useful when it come to allow for reactivity during important price points, such filter can help with moving average crossover methods or can be used as a source for other indicators making those directly dependent of the edge detection.
Rsi with a period of 200 and our filter as source, will cross triggers line when an edge is detected
Feel free to share suggestions ! Thanks for reading !
References
Peak/Valley estimator used for the detection of edges in price. Indicator

Indicator

Indicator
