OPEN-SOURCE SCRIPT
MST Medio v1.0

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:
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:
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:
────────────────
Visual Elements
────────────────
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
────────────────
Alerts
────────────────
Notes
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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.