OPEN-SOURCE SCRIPT
Multi-Timeframe FVG [Custom]

A configurable Fair Value Gap (FVG) indicator that plots FVGs from up to 4 independent timeframes simultaneously on a single chart, with full control over how each timeframe's gaps look and behave.
Key features:
4 independent timeframes — enable any combination (e.g. 1min, 5min, 15min, 1H) at once, each with its own full set of settings.
True multi-timeframe display — a lower-timeframe FVG (e.g. 1min) still displays correctly on a higher-timeframe chart (e.g. 5min), and vice versa. Each timeframe has a toggle to control whether its gaps remain visible once the chart's timeframe is larger than that FVG's own timeframe.
Non-repainting — every FVG is confirmed only after the relevant candle closes on its own timeframe; nothing is drawn or evaluated on a still-forming candle.
Fully customizable appearance per timeframe — independent fill colour, border colour, border width, and border style (solid/dashed/dotted) for bullish and bearish gaps.
Optional midline — toggle a midline through each gap; its colour and thickness automatically match that gap's border, with its own line style.
Rectangles with optional extension — FVGs render as boxes, either a fixed width (in that timeframe's own bars) or continuously extending to the latest bar.
Fully customizable labels — optional label per gap with custom text (supports a {tf} placeholder), vertical position (top/mid/bottom), and horizontal alignment. Label size is set once globally. When a box is extending, right-aligned labels float a fixed number of chart bars ahead of price instead of getting stuck inside the box.
Per-timeframe lookback — control how many bars (of that timeframe) of history each timeframe scans and keeps, independent of the others.
Precise mitigation rule — a gap is only removed once a candle of its own timeframe closes fully across the far boundary of the gap, in the opposite direction. Chart-timeframe noise doesn't trigger it.
Notes:
All settings are grouped by timeframe in the inputs panel for quick adjustment.
This script is intended as a visual reference tool and does not generate trade signals. It is not financial advice — always do your own analysis before trading.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。