FVG Magnet Engine 3D [Neblok]

FVG MAGNET ENGINE 3D [Neblok]
Most fair value gap indicators assume every gap is a magnet that price will return to. This one tests that assumption. FVG Magnet Engine 3D measures how often gaps on the chart you are viewing actually get filled, and prints the odds directly on every live gap. You can see at a glance which imbalances are likely to attract price and which ones the market tends to leave behind.
━━━━━━━━━━━━━━━━━━━━
WHAT IS A FAIR VALUE GAP?
━━━━━━━━━━━━━━━━━━━━
A fair value gap (FVG) is a three-candle imbalance. It forms when price moves so fast that the first and third candles do not overlap, leaving a price range that was traded on only one side.
- Bullish FVG: the low of the current candle is above the high of the candle two bars back. The gap sits below price.
- Bearish FVG: the high of the current candle is below the low of the candle two bars back. The gap sits above price.
Traders watch these zones because price often returns to "rebalance" them. The key word is often, not always. This script tells you how often.
━━━━━━━━━━━━━━━━━━━━
HOW THE ODDS ARE CALCULATED
━━━━━━━━━━━━━━━━━━━━
1. Every new gap is sorted into a bucket by direction (bull or bear) and by size measured in ATRs: under 0.5, 0.5 to 1, 1 to 2, and 2+ ATR. That gives 8 buckets in total.
2. Each gap is tracked until it either fills or runs out of time (the Fill Window). The result is recorded for its bucket: "filled after X bars" or "did not fill."
3. Each live gap shows the share of past gaps in its bucket that went on to fill.
The odds also account for age. A gap that has already gone 40 bars unfilled is compared only against past gaps that also lasted at least 40 bars unfilled. Gaps that hold for a long time tend to fill less often, and the odds on each label reflect that as the gap ages.
Two safeguards keep the numbers honest:
- A small statistical correction stops tiny samples from showing extreme values like 100% or 0%.
- No odds are shown until a bucket has enough history (Min Samples). Until then the label reads LEARNING.
━━━━━━━━━━━━━━━━━━━━
HOW TO READ THE CHART
━━━━━━━━━━━━━━━━━━━━
NEON 3D BLOCKS
- Green block = bullish gap below price.
- Pink block = bearish gap above price.
- The solid block is the part of the gap that has not been filled yet. It shrinks as price trades into it.
- The 3D top and side faces are only there to make the zones easier to see. They do not represent extra price levels.
DOTTED OUTLINE
- The original size of the gap before any fill. Compare it with the solid block to see how much has already been absorbed.
DASHED LINE
- The 50% level of the gap, also called consequent encroachment (CE). Price often reacts here.
YELLOW OUTLINE + ★ HIGH ODDS
- The gap's fill odds are at or above your High-Odds Threshold (70% by default). These are the strongest magnets on the chart.
GAP LABEL (3 lines)
- Line 1: direction, plus ★ HIGH ODDS if it qualifies.
- Line 2: fill odds and sample size, e.g. "FILL ODDS 72% (n=48)". The sample size matters: 72% from 48 gaps is far more reliable than 72% from 16.
- Line 3: gap size in ATRs, % already filled, and age vs. the Fill Window, e.g. "1.25× ATR · 35% filled · 27/150 bars".
MAGNET ARROWS (cyan)
- One arrow points from current price to the nearest gap above, and one to the nearest gap below.
- The thicker the arrow, the higher that gap's fill odds. A thin dashed arrow means the gap is still in LEARNING mode.
- Each arrow's label shows the odds plus the distance in points and in ATRs, so you can judge whether the target is realistic for your trade.
DIAMONDS
- A green diamond below a bar marks where a bullish gap was filled. A pink diamond above a bar marks where a bearish gap was filled. These show the history of fills on your chart.
ODDS DASHBOARD
- Shows fill odds and sample size for all 8 buckets, plus the average number of bars a gap takes to fill.
- Cells turn yellow when a bucket's base odds pass your High-Odds Threshold.
- Use it to learn how the instrument behaves. Some markets fill small gaps almost every time but rarely fill large ones; others are the opposite.
━━━━━━━━━━━━━━━━━━━━
SETTINGS GUIDE
━━━━━━━━━━━━━━━━━━━━
DETECTION
- Min Gap Size (× ATR): ignores gaps smaller than this. Raise it to remove noise on low timeframes.
- Min Displacement Body (× ATR): requires the middle candle to have a strong body, so only gaps created by forceful moves count. 0 = off.
- ATR Length: the ATR used for size buckets, the 3D depth, and distances.
- Confirm Gaps On Bar Close: on by default. New gaps only appear once the bar closes, so they never flicker on the live bar.
FILL STATISTICS
- Fill Definition: "Full Fill" requires price to trade completely through the gap. "50% (CE)" counts a fill when price reaches the midpoint. CE odds are always higher; choose the one that matches how you trade.
- Fill Window (bars): how long a gap has to fill before it counts as a miss and is removed. A longer window gives higher odds.
- Stats Memory: how many recent outcomes per bucket are used. Lower values adapt faster to changing conditions; higher values are steadier.
- Min Samples Before Showing Odds: odds stay hidden until a bucket has at least this many results.
- High-Odds Threshold (%): the level that triggers the yellow outline, the ★, and the high-odds tap alert.
DISPLAY
- Show Bullish / Bearish Gaps: toggle each side.
- Max Gaps On Chart: limits clutter (up to 20).
- Which Gaps To Show: "Nearest to price" (best for active trading) or "Most recent."
- Extend Right: how far the blocks project into the future.
- Outline, CE line, Magnet lines, Fill markers: turn each layer on or off.
- Label Size: Normal, Large, or Huge.
3D RENDERING
- 3D Blocks: turn the 3D effect on or off.
- 3D Depth / 3D Lift: control how far the 3D faces project. Reduce these if blocks overlap on a crowded chart.
NEON COLORS
- Every color is adjustable. Colors are flat neon with no gradients, so they stay readable on dark charts.
━━━━━━━━━━━━━━━━━━━━
SUGGESTED STARTING SETTINGS
━━━━━━━━━━━━━━━━━━━━
- Scalping futures (1m to 5m): Fill Definition 50% (CE), Fill Window 60 to 100, Min Gap Size 0.3 to 0.5.
- Intraday (15m to 1H): Fill Definition Full Fill or CE, Fill Window 100 to 150, Min Gap Size 0.25.
- Swing (4H to Daily): Fill Definition Full Fill, Fill Window 100 to 200, Stats Memory 150 to 300.
Load as much chart history as possible. More history means larger samples and more reliable odds.
━━━━━━━━━━━━━━━━━━━━
HOW TO USE IT IN YOUR TRADING
━━━━━━━━━━━━━━━━━━━━
1. TARGETS
A high-odds gap in the direction of your trade is a reasonable profit target. The magnet arrow shows the distance in points and ATRs, so you can see whether the target fits your risk-to-reward.
2. CAUTION ZONES
A high-odds gap against your position marks where a pullback is statistically more likely. Consider tightening stops or taking partial profits before price reaches it.
3. FILTERING
Low-odds gaps on your market and timeframe do not deserve the same respect as high-odds ones. Use the odds to decide which zones to plan around and which to ignore.
4. ENTRIES ON THE FIRST TAP
When price first touches a high-odds gap, the "first tap" alert fires. Many traders watch the gap edge or the CE line for a reaction, then look for confirmation from their own system (structure break, momentum, volume) before entering.
5. CONFLUENCE
Odds work best combined with other context: higher-timeframe trend, key liquidity levels, session opens, or volume profile levels. A high-odds gap that lines up with another level is a stronger zone.
6. KNOW YOUR MARKET
Check the dashboard on each instrument and timeframe you trade. The average bars-to-fill tells you how patient to be, and the odds tell you whether gaps on that market are worth trading at all.
━━━━━━━━━━━━━━━━━━━━
ALERTS
━━━━━━━━━━━━━━━━━━━━
Create an alert on the indicator and select "Any alert() function call." Turn each alert type on or off in the settings:
- New FVG: includes the gap's price range, size, and starting fill odds.
- First Tap Of A High-Odds FVG: fires when price first enters a gap whose odds are above your threshold.
- FVG Filled: fires when a gap fills, with how many bars it took.
All alerts fire once per bar close.
━━━━━━━━━━━━━━━━━━━━
NOTES & LIMITATIONS
━━━━━━━━━━━━━━━━━━━━
- Fill odds are historical frequencies from the loaded chart data, not predictions. Market conditions change, and past behavior may not repeat.
- Odds depend on your settings. Changing the Fill Definition, Fill Window, or size filters changes what counts as a fill, so the numbers will change.
- Statistics are built from the bars loaded on your chart. Different history lengths (or different TradingView plans) can produce slightly different odds.
- Fill tracking updates live on the current bar. New gaps only print on bar close when Confirm Gaps On Bar Close is enabled.
- This is a free script. Feedback and suggestions are welcome in the comments.
━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
━━━━━━━━━━━━━━━━━━━━
This indicator is provided for educational and informational purposes only. It is NOT financial advice, investment advice, trading advice, or a recommendation to buy, sell, or hold any security, futures contract, option, cryptocurrency, or other financial instrument.
All fill odds, statistics, and signals are based on historical data and do not guarantee future results. Past performance is not indicative of future performance.
Trading involves substantial risk of loss and is not suitable for every investor. Leveraged products such as futures and options can result in losses greater than your initial investment. Only trade with money you can afford to lose.
You are solely responsible for your own trading decisions. Always do your own research, test any tool thoroughly on a demo or paper account before using it with real money, and consult a licensed financial professional if you need personalized advice. The author accepts no liability for any losses or damages arising from the use of this script.
Most fair value gap indicators assume every gap is a magnet that price will return to. This one tests that assumption. FVG Magnet Engine 3D measures how often gaps on the chart you are viewing actually get filled, and prints the odds directly on every live gap. You can see at a glance which imbalances are likely to attract price and which ones the market tends to leave behind.
━━━━━━━━━━━━━━━━━━━━
WHAT IS A FAIR VALUE GAP?
━━━━━━━━━━━━━━━━━━━━
A fair value gap (FVG) is a three-candle imbalance. It forms when price moves so fast that the first and third candles do not overlap, leaving a price range that was traded on only one side.
- Bullish FVG: the low of the current candle is above the high of the candle two bars back. The gap sits below price.
- Bearish FVG: the high of the current candle is below the low of the candle two bars back. The gap sits above price.
Traders watch these zones because price often returns to "rebalance" them. The key word is often, not always. This script tells you how often.
━━━━━━━━━━━━━━━━━━━━
HOW THE ODDS ARE CALCULATED
━━━━━━━━━━━━━━━━━━━━
1. Every new gap is sorted into a bucket by direction (bull or bear) and by size measured in ATRs: under 0.5, 0.5 to 1, 1 to 2, and 2+ ATR. That gives 8 buckets in total.
2. Each gap is tracked until it either fills or runs out of time (the Fill Window). The result is recorded for its bucket: "filled after X bars" or "did not fill."
3. Each live gap shows the share of past gaps in its bucket that went on to fill.
The odds also account for age. A gap that has already gone 40 bars unfilled is compared only against past gaps that also lasted at least 40 bars unfilled. Gaps that hold for a long time tend to fill less often, and the odds on each label reflect that as the gap ages.
Two safeguards keep the numbers honest:
- A small statistical correction stops tiny samples from showing extreme values like 100% or 0%.
- No odds are shown until a bucket has enough history (Min Samples). Until then the label reads LEARNING.
━━━━━━━━━━━━━━━━━━━━
HOW TO READ THE CHART
━━━━━━━━━━━━━━━━━━━━
NEON 3D BLOCKS
- Green block = bullish gap below price.
- Pink block = bearish gap above price.
- The solid block is the part of the gap that has not been filled yet. It shrinks as price trades into it.
- The 3D top and side faces are only there to make the zones easier to see. They do not represent extra price levels.
DOTTED OUTLINE
- The original size of the gap before any fill. Compare it with the solid block to see how much has already been absorbed.
DASHED LINE
- The 50% level of the gap, also called consequent encroachment (CE). Price often reacts here.
YELLOW OUTLINE + ★ HIGH ODDS
- The gap's fill odds are at or above your High-Odds Threshold (70% by default). These are the strongest magnets on the chart.
GAP LABEL (3 lines)
- Line 1: direction, plus ★ HIGH ODDS if it qualifies.
- Line 2: fill odds and sample size, e.g. "FILL ODDS 72% (n=48)". The sample size matters: 72% from 48 gaps is far more reliable than 72% from 16.
- Line 3: gap size in ATRs, % already filled, and age vs. the Fill Window, e.g. "1.25× ATR · 35% filled · 27/150 bars".
MAGNET ARROWS (cyan)
- One arrow points from current price to the nearest gap above, and one to the nearest gap below.
- The thicker the arrow, the higher that gap's fill odds. A thin dashed arrow means the gap is still in LEARNING mode.
- Each arrow's label shows the odds plus the distance in points and in ATRs, so you can judge whether the target is realistic for your trade.
DIAMONDS
- A green diamond below a bar marks where a bullish gap was filled. A pink diamond above a bar marks where a bearish gap was filled. These show the history of fills on your chart.
ODDS DASHBOARD
- Shows fill odds and sample size for all 8 buckets, plus the average number of bars a gap takes to fill.
- Cells turn yellow when a bucket's base odds pass your High-Odds Threshold.
- Use it to learn how the instrument behaves. Some markets fill small gaps almost every time but rarely fill large ones; others are the opposite.
━━━━━━━━━━━━━━━━━━━━
SETTINGS GUIDE
━━━━━━━━━━━━━━━━━━━━
DETECTION
- Min Gap Size (× ATR): ignores gaps smaller than this. Raise it to remove noise on low timeframes.
- Min Displacement Body (× ATR): requires the middle candle to have a strong body, so only gaps created by forceful moves count. 0 = off.
- ATR Length: the ATR used for size buckets, the 3D depth, and distances.
- Confirm Gaps On Bar Close: on by default. New gaps only appear once the bar closes, so they never flicker on the live bar.
FILL STATISTICS
- Fill Definition: "Full Fill" requires price to trade completely through the gap. "50% (CE)" counts a fill when price reaches the midpoint. CE odds are always higher; choose the one that matches how you trade.
- Fill Window (bars): how long a gap has to fill before it counts as a miss and is removed. A longer window gives higher odds.
- Stats Memory: how many recent outcomes per bucket are used. Lower values adapt faster to changing conditions; higher values are steadier.
- Min Samples Before Showing Odds: odds stay hidden until a bucket has at least this many results.
- High-Odds Threshold (%): the level that triggers the yellow outline, the ★, and the high-odds tap alert.
DISPLAY
- Show Bullish / Bearish Gaps: toggle each side.
- Max Gaps On Chart: limits clutter (up to 20).
- Which Gaps To Show: "Nearest to price" (best for active trading) or "Most recent."
- Extend Right: how far the blocks project into the future.
- Outline, CE line, Magnet lines, Fill markers: turn each layer on or off.
- Label Size: Normal, Large, or Huge.
3D RENDERING
- 3D Blocks: turn the 3D effect on or off.
- 3D Depth / 3D Lift: control how far the 3D faces project. Reduce these if blocks overlap on a crowded chart.
NEON COLORS
- Every color is adjustable. Colors are flat neon with no gradients, so they stay readable on dark charts.
━━━━━━━━━━━━━━━━━━━━
SUGGESTED STARTING SETTINGS
━━━━━━━━━━━━━━━━━━━━
- Scalping futures (1m to 5m): Fill Definition 50% (CE), Fill Window 60 to 100, Min Gap Size 0.3 to 0.5.
- Intraday (15m to 1H): Fill Definition Full Fill or CE, Fill Window 100 to 150, Min Gap Size 0.25.
- Swing (4H to Daily): Fill Definition Full Fill, Fill Window 100 to 200, Stats Memory 150 to 300.
Load as much chart history as possible. More history means larger samples and more reliable odds.
━━━━━━━━━━━━━━━━━━━━
HOW TO USE IT IN YOUR TRADING
━━━━━━━━━━━━━━━━━━━━
1. TARGETS
A high-odds gap in the direction of your trade is a reasonable profit target. The magnet arrow shows the distance in points and ATRs, so you can see whether the target fits your risk-to-reward.
2. CAUTION ZONES
A high-odds gap against your position marks where a pullback is statistically more likely. Consider tightening stops or taking partial profits before price reaches it.
3. FILTERING
Low-odds gaps on your market and timeframe do not deserve the same respect as high-odds ones. Use the odds to decide which zones to plan around and which to ignore.
4. ENTRIES ON THE FIRST TAP
When price first touches a high-odds gap, the "first tap" alert fires. Many traders watch the gap edge or the CE line for a reaction, then look for confirmation from their own system (structure break, momentum, volume) before entering.
5. CONFLUENCE
Odds work best combined with other context: higher-timeframe trend, key liquidity levels, session opens, or volume profile levels. A high-odds gap that lines up with another level is a stronger zone.
6. KNOW YOUR MARKET
Check the dashboard on each instrument and timeframe you trade. The average bars-to-fill tells you how patient to be, and the odds tell you whether gaps on that market are worth trading at all.
━━━━━━━━━━━━━━━━━━━━
ALERTS
━━━━━━━━━━━━━━━━━━━━
Create an alert on the indicator and select "Any alert() function call." Turn each alert type on or off in the settings:
- New FVG: includes the gap's price range, size, and starting fill odds.
- First Tap Of A High-Odds FVG: fires when price first enters a gap whose odds are above your threshold.
- FVG Filled: fires when a gap fills, with how many bars it took.
All alerts fire once per bar close.
━━━━━━━━━━━━━━━━━━━━
NOTES & LIMITATIONS
━━━━━━━━━━━━━━━━━━━━
- Fill odds are historical frequencies from the loaded chart data, not predictions. Market conditions change, and past behavior may not repeat.
- Odds depend on your settings. Changing the Fill Definition, Fill Window, or size filters changes what counts as a fill, so the numbers will change.
- Statistics are built from the bars loaded on your chart. Different history lengths (or different TradingView plans) can produce slightly different odds.
- Fill tracking updates live on the current bar. New gaps only print on bar close when Confirm Gaps On Bar Close is enabled.
- This is a free script. Feedback and suggestions are welcome in the comments.
━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
━━━━━━━━━━━━━━━━━━━━
This indicator is provided for educational and informational purposes only. It is NOT financial advice, investment advice, trading advice, or a recommendation to buy, sell, or hold any security, futures contract, option, cryptocurrency, or other financial instrument.
All fill odds, statistics, and signals are based on historical data and do not guarantee future results. Past performance is not indicative of future performance.
Trading involves substantial risk of loss and is not suitable for every investor. Leveraged products such as futures and options can result in losses greater than your initial investment. Only trade with money you can afford to lose.
You are solely responsible for your own trading decisions. Always do your own research, test any tool thoroughly on a demo or paper account before using it with real money, and consult a licensed financial professional if you need personalized advice. The author accepts no liability for any losses or damages arising from the use of this script.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.