summary: the gap fill algo fades daily gaps automatically — entering after the first candle closes at market open, targeting a configurable gap fill %, with day-of-week specific controls for direction, gap size, and risk-to-reward.
how it works
TradingView fires alerts based on gap fill conditions. edgeful picks up those alerts and routes the trade to your broker. you can also use the indicator visually and manage entries yourself — automation isn't required.
the algo waits for the first candle to close after the market opens, then enters a trade fading the gap. so if you're on a 5-minute chart with a NY session open at 9:30 AM ET, the algo enters at 9:35 after that first 5-minute candle closes. on a 15-minute chart, it enters at 9:45.
gap up → algo goes short (fading the gap back down toward the fill level).
gap down → algo goes long (fading the gap back up toward the fill level).
the gap fill algo executes 1 trade per day per ticker — it acts on the gap at the open and that's it.
understanding gaps
a gap is the distance between the previous session's close and the current session's open. when price opens above the prior close, that's a gap up. when it opens below, that's a gap down.
the gap fill level is the previous session close (PSC) — that's your target. the question the data answers is simple: how often does price travel back to fill that gap?
edgeful's gap fill reports show you exactly how often gaps fill on your instrument, in your session, over your chosen lookback period. that's the foundation for this algo — you're not guessing whether the gap will fill. you're trading the fill when the data says it happens often enough to be worth it.
customizing the gap fill algo
the key parameters to dial in are the gap fill target, risk-to-reward, gap size filters, and directional controls.
algo-wide settings:
max loss per trade — caps your loss per trade. this is your risk control — set it based on your account size and risk tolerance.
session — which market session to anchor the gap measurement to. for futures, this is typically the NY session. the gap is measured from the NY session close to the next NY session open.
day-of-week specific settings:
gap up — enable or disable gap up trades (short entries) for each day of the week.
gap down — enable or disable gap down trades (long entries) for each day of the week.
gap fill target % — how much of the gap the algo targets for its take-profit. 100% means the full gap fill (all the way back to PSC). 50% means the algo targets half the gap. this is configurable per day of week — you might target full fills on Mondays but half fills on Fridays if the data supports it.
risk to reward — your R:R ratio for the trade. this determines your stop-loss distance relative to your target. a 1:1 R:R means your stop is the same distance from entry as your take-profit. a 1:2 means you're risking half of what you're targeting.
min gap size % — the minimum gap size to trade, expressed as a percentage. filters out tiny gaps that don't have enough room for a meaningful trade. inclusive — a gap equal to your min value will trigger.
max gap size % — the maximum gap size to trade. filters out massive gaps that are less likely to fill — the data on oversized gaps often looks very different from normal-sized ones. exclusive — a gap equal to your max value will NOT trigger. see filter thresholds — how min and max work below.
the gap size filters are critical. pull up edgeful's gap fill by-size report for your instrument and you'll see that fill rates vary significantly depending on how big the gap is. small gaps might fill 80% of the time. large gaps might only fill 40%. your min and max settings should reflect where the data is strongest.
algo templates
a great starting point is to use one of the edgeful algo templates — once you select a template, we recommend continuing to optimize from there.
using the gap fill reports to validate your settings
before locking in any settings, check them against the data.
the gap fill report on edgeful shows you historically how often gaps fill on your instrument, in your session, over different lookback periods. pull up the report, set the session to NY, and use a 6-month lookback as your baseline.
the report has several variants that help you fine-tune:
standard — overall gap fill rates for gap ups and gap downs. start here to see the baseline numbers for your instrument.
by size — breaks down fill rates by the size of the gap. this is the most important variant for this algo — it directly maps to your min and max gap size % settings. find the size range where fill rates are highest and set your filters accordingly.
by close — shows how gap fill behavior changes based on where the previous session closed relative to its range. adds context to the setup.
by fill time — shows how long gaps typically take to fill. if most fills happen in the first 30 minutes, that's useful for setting expectations. if they take hours, you know you need to be patient.
by spike — identifies spike gaps and how they behave differently. spike gaps (large, sudden gaps) often have different fill characteristics than normal gaps.
by weekday — gap fill rates broken down by day of week. if Tuesday gaps fill at a much higher rate than Thursday gaps, you can enable/disable days in your algo settings to match.
by prev candle — shows how the previous day's candle color and size affect gap fill rates. adds another layer of context.
the by-size and by-weekday reports are especially important for this algo. they tell you exactly where to set your size filters and which days to enable.
the gap fill target
the gap fill target % setting controls how much of the gap the algo is trying to capture.
100% (full fill) — the algo targets the full distance back to the previous session close. this is the classic gap fill trade.
50% (half fill) — the algo targets half the gap distance. this is a more conservative approach — you're not waiting for the full fill, just the move toward it.
you can set any percentage you want. the right number depends on your instrument and what the data shows. if the gap fill report shows that 75% of gaps fill completely but the remaining 25% only get halfway — a 50% target catches more trades at the cost of leaving some profit on the table.
check the gap fill by-fill-time report to see how long full fills take vs. partial fills. if full fills take significantly longer, a partial target might be more efficient for your trading style.
setting up in TradingView
step 1: open your chart in TradingView with your preferred timeframe. the chart timeframe matters here — the algo enters after the first candle closes at market open. a 5-minute chart means the entry fires at 9:35 AM ET. a 15-minute chart means 9:45 AM ET.
step 2: add the edgeful gap fill strategy indicator to your chart. you'll see it under invite-only scripts if you've already connected your TradingView username in edgeful.
step 3: customize your parameters — session, max loss, gap fill target %, R:R, and size filters. use the algo templates as a starting point if you're not sure where to begin.
step 4: run a backtest in TradingView's Strategy Tester. look at win rate, profit factor, and max drawdown over 6+ months. adjust your settings based on the results.
step 5: once you're satisfied with the backtest, set up a TradingView alert on the strategy to enable automated execution through edgeful — or use the visual signals to trade manually.
configuring contract symbols
for live trading: use the current front-month contract symbol. that's what your broker executes on, and it keeps your alerts in sync with what's actually tradable.
for backtesting and optimization: use continuous contract symbols (e.g. ES1!, NQ1!). they give you uninterrupted historical data — which is what you need for accurate testing.
when you switch contracts, you'll need to reapply the algo and update your TradingView alerts to match.
important: contract mismatch is the #1 reason algo trades fail to trigger. if you alert on one contract in TradingView but your broker has a different one set up, trades won't execute (the exception is ProjectX). always use the current front-month contract with the highest volume — check both TradingView and your broker to confirm they match exactly.
troubleshooting
no trade trigger? walk through these in order:
verify visualization: can you see the entry, TP, and SL on your chart? if not, the algo didn't detect a valid gap for that day.
check gap size filters: if the actual gap is smaller than your min gap size % or lands at or above your max, the algo skips the trade. min is inclusive, max is exclusive — see filter thresholds — how min and max work below for the exact boundary logic. this is the single most common cause of a valid-looking setup silently not plotting.
check directional filters: make sure "gap up" and "gap down" are enabled for the current day of week. if both are off, no trades will fire.
validate alerts: confirm the alert is actually configured to trigger automation — not just a notification.
check the session: if your session setting doesn't match the session you're trading, the gap measurement will be off — and the algo may not see a valid gap.
check chart timeframe: remember that the algo enters after the first candle closes. if your chart timeframe is 1 hour, the algo won't enter until 10:30 AM ET — and the gap may have already filled or moved significantly by then.
always test changes in simulation first before pushing them to live.
filter thresholds — how min and max work
this is the single most common reason a valid-looking setup doesn't plot. the filters aren't wrong — they're just more literal than you'd expect.
the rule:
min is inclusive — the algo triggers when gap size ≥ min
max is exclusive — the algo triggers when gap size < max
put those together: a signal only plots when min ≤ gap size < max.
concrete example. you've set min gap size % = 1% and max gap size % = 3%. here's what happens at each boundary:
actual gap size | result | why |
0.9% | excluded | below min (0.9 < 1.0) |
1.0% | triggers | exactly on min — inclusive boundary |
2.0% | triggers | inside the valid range |
2.9% | triggers | inside the valid range |
3.0% | excluded | exactly on max — exclusive boundary (the one that catches people) |
3.1% | excluded | above max |
why it works this way. exclusive max prevents double-counting when you stack filters — for example, running one strategy for 0–1% gaps, another for 1–3%, another for 3%+. if both ends were inclusive, a 1.0% gap would fire on two strategies at once. with exclusive max, every gap size falls into exactly one bucket — cleaner data, cleaner backtests, no duplicate trades.
the fix when your setup isn't plotting: compare your actual gap size against your boundaries. if it lands exactly on your max (say a 0.6% range with max set to 0.6%), the algo silently excluded it. bump your max up slightly (e.g., 0.61% or 0.7%) and the same setup will plot on the next occurrence.
this logic applies to every size/range filter across edgeful algos — gap fill, engulfing candle, ORB, IB. if an algo has a min and max threshold, it follows inclusive-min / exclusive-max.
regaining algo access
if you've lost access to the gap fill algo in TradingView, here's how to restore it:
go to the algos section in edgeful
click the TradingView logo or "algo access" button
close TradingView completely before submitting
reopen TradingView — the gap fill strategy should be visible and accessible
backtesting the gap fill algo
test your configuration in TradingView's Strategy Tester over 12+ months. pay attention to win rate, profit factor, and max drawdown.
a few things to look at specifically:
compare full fill (100%) vs. partial fill (50-75%) targets. partial fills often have a higher win rate but lower average winner — run both and see which has a better profit factor on your instrument.
compare gap up-only vs. gap down-only vs. both. some instruments fill gap ups at a very different rate than gap downs — the data tells you which direction is stronger.
compare day-of-week performance. disable the weakest days and see how overall numbers improve.
compare different gap size ranges. narrow the min/max to only trade the size range where fill rates are highest.
the goal is finding settings where the algo consistently profits on your instrument — not settings that look good on one specific month. if it works across 6-month and 12-month backtests, you've got something solid.
note that backtest results may reflect optimized settings — not default values. always validate that your live settings match what you tested.

