Fair Value Gap (FVG)
Category: Market Structure
Fair Value Gap (FVG) marks a three-candle price imbalance where the first and third candles' wicks don't overlap. Returns gaps as they form plus the most recent unfilled bullish and bearish zones, which traders watch as likely support, resistance and retracement targets.
Common parameters
All indicator requests share these parameters. See Single Indicator for details.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
exchange | string | Yes | — | Exchange identifier, e.g. binance, bybit. |
symbol | string | Yes | — | Trading pair, e.g. BTCUSDT. |
timeframe | string | Yes | — | Candle interval: 1m, 5m, 15m, 1h, 4h, 1d, 1w. |
results | integer | No | 1 | Number of historical values. Use max for all available. |
backtrack | integer | No | 0 | Candles to skip from most recent. |
Indicator parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
threshold | number | No | 0 | Minimum gap size as a percentage of the middle candle's close (0-100). Smaller gaps are ignored. |
fillMode | string | No | wick | When an open gap counts as filled: `wick` (price touches the far edge) or `close` (a candle closes beyond it). |
Example
curl -G https://v2.taapi.io/indicator/fvg \ -H "Authorization: Bearer YOUR_API_KEY" \ --data-urlencode "exchange=binance" \ --data-urlencode "symbol=BTCUSDT" \ --data-urlencode "timeframe=1h" \ --data-urlencode "threshold=0" \ --data-urlencode "fillMode=wick"
const res = await fetch(
'https://v2.taapi.io/indicator/fvg?exchange=binance&symbol=BTCUSDT&timeframe=1h',
{ headers: { Authorization: 'Bearer YOUR_API_KEY' } }
);
const data = await res.json();
import requests
resp = requests.get(
'https://v2.taapi.io/indicator/fvg',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'exchange': 'binance', 'symbol': 'BTCUSDT', 'timeframe': '1h'}
)
print(resp.json())
Response
Results are always wrapped in arrays, even when only one value is returned.
{
"value": [0],
"top": [null],
"bottom": [null],
"bullishTop": [77662.91],
"bullishBottom": [77596.26],
"bullishTimestamp": [1793491200],
"bullishCount": [20],
"bearishTop": [78418],
"bearishBottom": [78241.3],
"bearishTimestamp": [1793343600],
"bearishCount": [11],
"timestamp": [1793548800]
}
A bullish gap forms when the third candle's low is above the first candle's high; the zone runs from the first candle's high (bottom) to the third candle's low (top). A bearish gap forms when the third candle's high is below the first candle's low. An open gap is removed once price reaches its far edge (fillMode=wick) or a candle closes beyond it (fillMode=close). Values never repaint, but a gap on the still-forming candle can disappear before it closes; add backtrack=1 for closed candles only.
| Field | Description |
|---|---|
value | Gap confirmed on this candle: 1 bullish, -1 bearish, 0 none |
top, bottom | Edges of the gap confirmed on this candle (null if none) |
bullishTop, bullishBottom | Edges of the most recent bullish gap that is still unfilled (null if none) |
bullishTimestamp | Timestamp of that gap's middle candle |
bullishCount | Number of unfilled bullish gaps |
bearishTop, bearishBottom, bearishTimestamp, bearishCount | The same for bearish gaps |
Errors
{
"value": [0],
"top": [null],
"bottom": [null],
"bullishTop": [77662.91],
"bullishBottom": [77596.26],
"bullishTimestamp": [1793491200],
"bullishCount": [20],
"bearishTop": [78418],
"bearishBottom": [78241.3],
"bearishTimestamp": [1793343600],
"bearishCount": [11],
"timestamp": [1793548800]
}Data is being fetched. Retry after 1–2 seconds.
{ "pending": true, "key": "ta:binance:BTCUSDT:1h:fvg:..." }{ "error": "Missing required: exchange, symbol, timeframe" }{ "error": "Invalid or missing API key." }{ "error": "Rate limit exceeded. Your plan allows 30 requests per 15 seconds." }