OPEN-SOURCE SCRIPT
Atualizado

MIG and MC

357
发布简介(中文)
MIG and MC 指标帮助日内交易者快速识别微型缺口(Micro Gap)与微型通道(Micro Channel)。脚本支持过滤开盘跳空、合并连续缺口,并自动绘制
FPL(Fair Price Line)延伸线,既可追踪缺口是否被填补,也能直观标注潜在的趋势结构。为了确保跨周期一致性,最新版本对开盘前后和跨日场景做了专门处理

主要特性

- 自动检测并显示看涨/看跌微型缺口,支持按需合并连续缺口。
- 自定义是否忽略开盘缺口、缺口显示范围与 FPL 样式。
- FPL 触及后即停止延伸,辅助研判缺口是否真正回补。
- 内置强收盘与缺口过滤的微型通道识别,可选多种严格程度。
- 适用于 1/5/9 分钟等日内周期,也适用于更长周期。

Recommended English Description
The MIG and MC indicator highlights Micro Gaps and Micro Channels so you can track true intraday imbalances without noise. It merges
consecutive gaps, projects Fair Price Lines (FPL) that stop once touched, and offers a full intraday-ready opening-gap filter so your
early bars stay clean. The latest update refines cross-session handling, giving reliable gap plots on 1-, 5-, and 9-minute charts as well as higher time frames.

Key Features

- Detects bullish and bearish micro gaps with optional gap merging.
- Toggle opening-gap filters and configure look back, visibility, and FPL style.
- FPL lines stop as soon as price revisits the gap, making gap closure obvious.
- Micro Channel mode uses strong-close and gap filters to mark high-quality trend legs.
- Consistent behavior across intraday and higher time frames.
Notas de Lançamento
名称: MIG and MC — 微缺口与微通道识别

概述:

自动识别价格中的微缺口(Micro Gaps, MIG)与微通道(Micro Channels, MC)。
提供“连续同向微缺口合并(CC MIG)”、强收盘过滤、忽略日内开盘跳空、以及灵活显示与样式控制。
缺口参考线(FPL)会在首次被触及时停止延伸,便于观察“触及/回补”行为。
判定逻辑:

微缺口(MIG)
看涨 MIG: high[2] <= low[0](启用“零高度 MIG”时为 <=,否则为 <)。
看跌 MIG: low[2] >= high[0](启用“零高度 MIG”时为 >=,否则为 >)。
绘制内容:以缺口边界价构建盒形区间与一条 FPL 参考线(看涨用绿色、看跌用红色)。
连续 MIG(CC MIG)启用时:同向连续缺口将被合并,绘制“主 FPL”与可选“次 FPL”(次 FPL 为起始价与当前极值的均值),两者在首次被触及时“钉住”并停止延伸。
微通道(MC)
看涨通道:一段连续“低点不破低”的序列,长度 ≥ 最小长度。
看跌通道:一段连续“高点不破高”的序列,长度 ≥ 最小长度。
严格过滤(可选):要求通道内至少出现一次强收盘(IBS > 69 为强阳,IBS < 31 为强阴)且包含至少一个同向 MIG。
可视化:通道进行中绘制动态趋势线;通道结束后固定最终线段。
主要参数(Inputs)

Micro Gap
Enable Micro Gap Detection: 是否启用 MIG 识别
Lookback Period: 回看范围(默认 200),超出范围的缺口自动清理
Enable Gap Closing: 开启“自动关闭”逻辑(缺口持续状态满足关闭条件时自动移除)
Show ZH MIG: 显示“零高度”缺口(包含等号的判定)
Show CC MIG: 合并连续同向 MIG,并绘制主/次 FPL
Ignore Opening Gaps: 日内忽略开盘跳空
Display
颜色与线型:看涨/看跌缺口颜色、FPL 颜色、线型(实线/虚线/点线)、线宽
Micro Channel
Enable Micro Channel Detection: 启用 MC 识别
Minimum Length: 最小通道长度(默认 3)
Trend Line Width / Opacity: 趋势线宽度与不透明度
Bullish/Bearish Channel Color: 多/空通道颜色
Require Strong Close & Micro Gap: 严格过滤(强收盘+内含 MIG)
使用建议:

任何周期均可用;日内建议开启“Ignore Opening Gaps”以排除日间开盘跳空干扰。
“Lookback Period”平衡画图数量与性能;默认 200 较为稳妥。
CC MIG 适合评估同向推进与层层推进的回补路径;FPL 被触后不再延伸,有助于直观看到“触及/回补”。
说明:

本指标不提供交易建议,仅供学习与研究。
未包含报警条件;如需提醒,可根据 FPL 触及或通道结束逻辑自行添加 alert 条件。
——

English Description

Name: MIG and MC — Micro Gaps & Micro Channels

Overview:

Detects Micro Gaps (MIG) and Micro Channels (MC) on any timeframe.
Supports merging consecutive same-direction gaps (CC MIG), strict filters for channels, ignoring intraday opening gaps, and rich display controls.
Fair Price Line (FPL) stops extending after first touch, helping visualize “touch/fill” behavior.
Logic:

Micro Gaps (MIG)
Bullish MIG: high[2] <= low[0] (inclusive when “Show ZH MIG” is on; otherwise strict <).
Bearish MIG: low[2] >= high[0] (inclusive when “Show ZH MIG” is on; otherwise strict >).
Visualization: a gap box plus one FPL at the gap boundary (green for bullish, red for bearish).
With CC MIG enabled: merges consecutive same-direction MIGs and draws a primary FPL and an optional secondary FPL (secondary = average of start price and current extreme). Both lines get “pinned” (stop extending) on first touch.
Micro Channels (MC)
Bullish channel: a run of non-decreasing lows, length ≥ minimum.
Bearish channel: a run of non-increasing highs, length ≥ minimum.
Strict filter (optional): requires at least one strong close inside the channel (IBS > 69 for bull, IBS < 31 for bear) and at least one same-direction MIG.
Visualization: dynamic line while active; final segment is fixed once the channel ends.
Key Inputs

Micro Gap
Enable Micro Gap Detection
Lookback Period (default 200): auto-cleans older items
Enable Gap Closing: auto-remove gaps that meet the closing condition
Show ZH MIG: allow zero-height gaps (inclusive inequalities)
Show CC MIG: merge consecutive same-direction MIGs with primary/secondary FPLs
Ignore Opening Gaps: ignore intraday session opens
Display
Colors and styles for gaps and FPLs: line style (solid/dashed/dotted) and width
Micro Channel
Enable Micro Channel Detection
Minimum Length (default 3)
Trend line width and opacity
Bullish/Bearish channel colors
Require Strong Close & Micro Gap (strict filter)

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.