מעודכן

FVG [odanc]

462
FVG [odanc]

Overview
This indicator plots Fair Value Gaps (FVGs), but only those that overlap with previous swing points. Instead of marking every three-candle gap, it keeps the ones where price has already left a mark, which cuts down on chart clutter.

How it works

1. FVG detection
  • Bullish FVG: the current candle's low is above the high of two candles ago.
  • Bearish FVG: the current candle's high is below the low of two candles ago.


2. Swing filter
When an FVG forms, the script scans back through the lookback window. It looks for past swing highs (for bullish FVGs) or swing lows (for bearish FVGs) that fall inside the gap zone.
  • The scan stops as soon as price moves beyond the zone, so only the most recent relevant swings are counted.
  • A swing point is a bar whose high or low is more extreme than the bars to its left and right. You set how many bars are compared on each side.
  • An FVG is drawn only if it contains at least the minimum number of past swings.


3. Box drawing
The box starts at the oldest swing point found inside the zone. This shows which past price action the gap lines up with. It then extends to the right as the chart advances.

4. FVG states
  • Active: the box keeps extending in its original color.
  • Touched: when price enters the zone, the box changes to the touched color.
  • Filled: a bullish FVG is filled when a candle closes below its bottom, and a bearish FVG when a candle closes above its top. Filled FVGs are removed by default. They can also be kept and shown in a separate color.
  • Expired: after the maximum number of bars, the box stops extending but stays on the chart.


Settings
  • Lookback bars: how far back to search for swing points.
  • Swing left / right comparison bars: defines what counts as a swing high or low.
  • Min past swings: minimum number of swing points required inside the zone.
  • Limit extension bars: turn the extension limit on or off.
  • Max extension bars after creation: how many bars a box extends before it stops.
  • Show filled FVGs: keep filled FVGs on the chart in a separate color.
  • Colors: bullish, bearish, touched and filled FVG colors.


Notes
  • Boxes are created when the FVG candle closes. Lookback scanning is limited to the set number of bars.
  • This tool visualizes price structure only. It does not generate buy or sell signals and is not financial advice.
הערות שחרור
Touched FVGs no longer turn yellow; bullish/bearish FVGs keep their original color and only the label is removed

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.