OPEN-SOURCE SCRIPT
Aggiornato

MST Medio v1.0

1 137
MST Medio — 3-Phase Price Action Confirmation

MST Medio is a structured price action indicator that detects high-probability reversal entries using a 3-phase confirmation process: Break → Confirm → Retest. It waits for a confirmed Higher High / Lower Low, validates the impulse wave, then triggers only when price retests the key level.

No repainting. No lagging indicators. Pure price action logic built on swing structure.

────────────────

How It Works

Phase 1 — Break
Price forms a Higher High (HH) above the previous Swing High, or a Lower Low (LL) below the previous Swing Low. The break must pass two filters:
  • Break Strength — The break distance must exceed a minimum percentage of the previous swing range (configurable, default 0.25×).
  • Impulse Body Filter — The first candle closing beyond the old high/low must have a body ≥ 1.5× the 20-bar average body. This ensures the break is driven by momentum, not a weak drift.

The indicator then identifies the W1 impulse wave — the highest high (BUY) or lowest low (SELL) from the break candle until the first opposing candle.

Phase 2 — Confirm
After the impulse wave, price must pull back and then close beyond the W1 peak (for BUY) or below the W1 trough (for SELL). This confirms that momentum has resumed after the correction.

Invalidation rules:
  • Price returns to the entry level (old SH/SL) before confirmation → structure broken, cancel.
  • Price hits the Stop Loss level → cancel.


Phase 3 — Retest Entry
Once confirmed, the indicator waits for price to retest the original Swing High (BUY) or Swing Low (SELL). This is your entry point — buying at the old resistance turned support, or selling at the old support turned resistance.

Invalidation rules:
  • Price hits Stop Loss → cancel.
  • Price breaks below the W1 trough (BUY) or above the W1 peak (SELL) → cancel.


────────────────

Visual Elements

  • Entry / SL / TP lines (dashed) — Drawn at signal confirmation with labels showing levels and R:R ratio.
  • Risk/Reward zones — Colored boxes: red zone (Entry → SL) and green zone (Entry → TP) for instant visual assessment.
  • Confirm Break label — "▲ Confirm Break" / "▼ Confirm Break" at the wave confirmation candle.
  • Pending state — Dotted lines and phase labels ("Phase 1 BUY", "Phase 2 SELL") showing the indicator is tracking a potential setup before it triggers.
  • Swing markers (optional) — Small triangles at detected pivot highs and lows.


────────────────

Take Profit Logic

TP is placed at the high of the Confirm Break candle (BUY) or the low of the Confirm Break candle (SELL). This represents the point where momentum was confirmed — a natural target that aligns with the structure of the move.

────────────────

Inputs

  • Pivot Lookback (default: 5) — Bars left/right to confirm a swing point. Higher values = fewer but stronger pivots.
  • Break Strength (default: 0.25) — Break distance must be ≥ this multiple of the previous swing range. Set 0 to disable.
  • Impulse Body Filter (default: 1.5) — The break candle body must be ≥ this multiple of the 20-bar average body. Set 0 to disable.
  • Show Entry / SL / TP Lines — Toggle dashed level lines and labels.
  • Show Risk/Reward Zones — Toggle colored risk/reward boxes.
  • Show Pending State — Toggle the dotted lines and phase labels for setups being tracked.
  • Show Confirm Break Label — Toggle the confirmation label.
  • Show Swing Points — Toggle swing high/low markers on the chart.
  • Full color customization for all visual elements.


────────────────

Alerts

  • BUY Signal — Fires when Phase 3 retest is triggered on a bullish setup.
  • SELL Signal — Fires when Phase 3 retest is triggered on a bearish setup.
  • Any Signal — Fires on either direction.


────────────────

Notes

  • Works on all timeframes and all instruments.
  • Non-repainting — All signals use confirmed (closed) pivots. No lookahead.
  • This is a detection tool, not a strategy. Use it alongside your own risk management and confluence analysis.
  • Best suited for trending markets where HH/LL structures form clean impulse waves.
  • The 3-phase confirmation significantly reduces false signals compared to raw breakout detection.
Note di rilascio
v2.0 (2026-02-11)
  • Simplified to 2-phase flow — Removed Phase 3 (Retest). Signal now fires immediately when confirmation is detected (close beyond W1 peak/trough), without waiting for price to return to the entry level.
  • Direct confirmation — When price closes above W1 peak (BUY) or below W1 trough (SELL), Entry/SL/TP are determined instantly. No intermediate "Phase 2" waiting state.
  • Retroactive scan updated — Historical scan from W1 bar now confirms directly without Phase 2 retest check.
  • Pending visualization improved — SL line now shown during pending state. Labels changed from "Phase 1/2" to "Pending BUY/SELL". W1 line always visible while pending.
  • Cleaner state machine — States reduced from 5 (0, 1, 2, -1, -2) to 3 (0 = idle, 1 = pending BUY, -1 = pending SELL).
  • Raw break guards simplified — New break detection no longer blocked by Phase 2 state.


v1.0 (2026-02-04)
  • Initial release.
  • 3-phase price action confirmation: Break → Confirm → Retest.
  • W1 impulse wave detection with configurable Break Strength and Impulse Body filters.
  • Entry/SL/TP lines, Risk/Reward boxes, Confirm Break labels.
  • Pending state visualization with Phase 1/Phase 2 dotted lines.
  • Swing high/low markers.
  • Alerts for BUY, SELL, and Any Signal.
Note di rilascio
v1.3 (2026-02-18)
  • HTF trend note on Entry label — Entry label now shows whether the signal is in the same direction or counter to the higher timeframe trend. Auto-maps current TF to HTF (M5→M15, M15→H1, H1→H4, etc.).
  • New input — "Show HTF Trend Note" toggle (default: ON) in Visual settings.
  • Label format — ✓ Same H1 trend / ✗ Counter H1 trend / ~ H1 unclear.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.