🔍

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.

NameTypeRequiredDefaultDescription
exchangestringYes—Exchange identifier, e.g. binance, bybit.
symbolstringYes—Trading pair, e.g. BTCUSDT.
timeframestringYes—Candle interval: 1m, 5m, 15m, 1h, 4h, 1d, 1w.
resultsintegerNo1Number of historical values. Use max for all available.
backtrackintegerNo0Candles to skip from most recent.

Indicator parameters

NameTypeRequiredDefaultDescription
thresholdnumberNo0Minimum gap size as a percentage of the middle candle's close (0-100). Smaller gaps are ignored.
fillModestringNowickWhen 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.

200 OK
{
  "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.

FieldDescription
valueGap confirmed on this candle: 1 bullish, -1 bearish, 0 none
top, bottomEdges of the gap confirmed on this candle (null if none)
bullishTop, bullishBottomEdges of the most recent bullish gap that is still unfilled (null if none)
bullishTimestampTimestamp of that gap's middle candle
bullishCountNumber of unfilled bullish gaps
bearishTop, bearishBottom, bearishTimestamp, bearishCountThe same for bearish gaps

Errors

Response
{
  "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.

Response
{ "pending": true, "key": "ta:binance:BTCUSDT:1h:fvg:..." }
Response
{ "error": "Missing required: exchange, symbol, timeframe" }
Response
{ "error": "Invalid or missing API key." }
Response
{ "error": "Rate limit exceeded. Your plan allows 30 requests per 15 seconds." }

← Back to Indicators Directory