OPEN-SOURCE SCRIPT
Razor Fractal Mirror

Historical analog projection and market-state intelligence
Razor Fractal Mirror scans the recent history of the current chart for past price structures that resemble what's happening right now, then projects how those historical structures resolved forward in time — as a probabilistic scenario, not a prediction.
What It Does
1. Structure Matching
The indicator normalizes the last Pattern Length bars (log-return or percent-change shape, user's choice) and compares that shape against thousands of historical windows going back up to the configured Historical Search Depth. Each candidate is scored on three components:
• Shape correlation — how closely the normalized price path matches
• Normalized error — RMSE between the current and candidate paths
• Regime compatibility (optional) — whether the candidate occurred in a similar trend/volatility regime, measured via EMA distance and ATR-normalized volatility
These three scores combine into a single composite similarity score, weighted by user-configurable inputs.
2. Analog Selection
The engine keeps the three strongest, non-overlapping matches — minimum spacing is enforced so it isn't just picking adjacent bars of the same move — that clear the minimum similarity threshold.
3. Forward Projection
For each matched analog, the indicator replays what price actually did in the bars after that historical structure, rescaled proportionally to the current price. These are blended into a similarity-weighted consensus path, with the individual analog paths shown as secondary "mirror" lines and a confidence cloud representing the spread between them.
4. Mirror Quality Scoring
A composite 0–100 score (graded A+ through D) built from average similarity, regime match, path stability (agreement between analogs plus cloud compactness), and outcome reliability (historical reward-to-risk and target-hit rates from those same analogs).
5. Decision Layer
Combines Mirror Quality, analog agreement, projected move size (in ATR), and optional multi-timeframe bias fusion (four configurable timeframes) into a state: ACTIONABLE, WATCH, or AVOID. Includes early and confirmation checkpoints plus a calculated invalidation level.
6. Live Lifecycle Tracking
Once a mirror is locked, the indicator tracks price adherence to the projected path bar-by-bar, flags drift or invalidation in real time, and records the eventual outcome into a rolling forecast library. That library feeds an adaptive "analog reputation" score that adjusts future decision scoring based on how this specific setup's projections have actually performed — and reports whether the model is trending IMPROVING, STABLE, or DEGRADING.
7. Projection Anchoring
Three modes control how projections behave once drawn: Locked Snapshot (freezes the projection at capture so it doesn't repaint as price moves), Hybrid (controlled refresh), and Live Projection (recalculates continuously).
Why It's Useful
Most "pattern matching" tools just eyeball similar-looking chart shapes. This engine quantifies similarity mathematically (correlation, error, and regime fit), requires multiple independent historical analogs to agree before calling a setup actionable, and — critically — tracks its own projections against real subsequent price action so traders can see adherence, drift, and invalidation as they happen rather than only in hindsight.
Why It's Unique
• Analog selection uses a three-factor composite score, not simple pattern-shape correlation alone.
• Self-tracking forecasts: locked projections are graded against real outcomes and feed an adaptive reputation score — the tool has a memory of its own track record.
• Snapshot anchoring prevents repainting of the displayed projection, addressing a common criticism of analog and projection-style indicators.
• Multi-timeframe fusion cross-checks the projected direction against bias and confidence readings from four additional timeframes before flagging a setup actionable.
Important Notes
Historical similarity does not guarantee a repeated outcome. Projections are analytical scenarios derived from historical analog behavior, not financial advice or a guarantee of future price action. Always combine with proper risk management and a trade plan.
Razor Fractal Mirror scans the recent history of the current chart for past price structures that resemble what's happening right now, then projects how those historical structures resolved forward in time — as a probabilistic scenario, not a prediction.
What It Does
1. Structure Matching
The indicator normalizes the last Pattern Length bars (log-return or percent-change shape, user's choice) and compares that shape against thousands of historical windows going back up to the configured Historical Search Depth. Each candidate is scored on three components:
• Shape correlation — how closely the normalized price path matches
• Normalized error — RMSE between the current and candidate paths
• Regime compatibility (optional) — whether the candidate occurred in a similar trend/volatility regime, measured via EMA distance and ATR-normalized volatility
These three scores combine into a single composite similarity score, weighted by user-configurable inputs.
2. Analog Selection
The engine keeps the three strongest, non-overlapping matches — minimum spacing is enforced so it isn't just picking adjacent bars of the same move — that clear the minimum similarity threshold.
3. Forward Projection
For each matched analog, the indicator replays what price actually did in the bars after that historical structure, rescaled proportionally to the current price. These are blended into a similarity-weighted consensus path, with the individual analog paths shown as secondary "mirror" lines and a confidence cloud representing the spread between them.
4. Mirror Quality Scoring
A composite 0–100 score (graded A+ through D) built from average similarity, regime match, path stability (agreement between analogs plus cloud compactness), and outcome reliability (historical reward-to-risk and target-hit rates from those same analogs).
5. Decision Layer
Combines Mirror Quality, analog agreement, projected move size (in ATR), and optional multi-timeframe bias fusion (four configurable timeframes) into a state: ACTIONABLE, WATCH, or AVOID. Includes early and confirmation checkpoints plus a calculated invalidation level.
6. Live Lifecycle Tracking
Once a mirror is locked, the indicator tracks price adherence to the projected path bar-by-bar, flags drift or invalidation in real time, and records the eventual outcome into a rolling forecast library. That library feeds an adaptive "analog reputation" score that adjusts future decision scoring based on how this specific setup's projections have actually performed — and reports whether the model is trending IMPROVING, STABLE, or DEGRADING.
7. Projection Anchoring
Three modes control how projections behave once drawn: Locked Snapshot (freezes the projection at capture so it doesn't repaint as price moves), Hybrid (controlled refresh), and Live Projection (recalculates continuously).
Why It's Useful
Most "pattern matching" tools just eyeball similar-looking chart shapes. This engine quantifies similarity mathematically (correlation, error, and regime fit), requires multiple independent historical analogs to agree before calling a setup actionable, and — critically — tracks its own projections against real subsequent price action so traders can see adherence, drift, and invalidation as they happen rather than only in hindsight.
Why It's Unique
• Analog selection uses a three-factor composite score, not simple pattern-shape correlation alone.
• Self-tracking forecasts: locked projections are graded against real outcomes and feed an adaptive reputation score — the tool has a memory of its own track record.
• Snapshot anchoring prevents repainting of the displayed projection, addressing a common criticism of analog and projection-style indicators.
• Multi-timeframe fusion cross-checks the projected direction against bias and confidence readings from four additional timeframes before flagging a setup actionable.
Important Notes
Historical similarity does not guarantee a repeated outcome. Projections are analytical scenarios derived from historical analog behavior, not financial advice or a guarantee of future price action. Always combine with proper risk management and a trade plan.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
