업데이트됨
Liquidity Sweep, MSS and FVG Entry Model with Look-ahead A/B

WHAT IT DOES
This strategy turns one ICT-style entry sequence into objective, testable rules: a liquidity pool is swept, price shifts market structure with a displacement candle, leaves a fair value gap (FVG), and a limit order waits inside that gap. It is built for MNQ and MES futures on 1 to 15 minute charts.
WHAT IS ORIGINAL HERE
- Every ICT term is written as a precise condition. Where a term has more than one defensible definition, the choice is an input, not a silent default.
- Each setup lives in an explicit state machine (Idle, Swept, MSS, Armed) with its own expiry per phase, so a stale setup cannot leak into a trade. Each pool starts at most one setup.
- A built-in look-ahead A/B switch reproduces the classic request.security() leak on purpose, so anyone can measure its effect in the Strategy Tester instead of trusting a claim.
THE RULES AS IMPLEMENTED
- Pool: previous day high/low (last closed daily bar) and/or confirmed swing highs/lows (ta.pivothigh, ta.pivotlow). The nearest level on each side of price is the active pool. Optional equal highs/lows filter.
- Sweep: price trades through the pool and, by default, closes back on the origin side.
- MSS: within N bars of the sweep, a candle with body of at least ATR x multiplier closes through the opposing confirmed swing, away from the swept pool.
- FVG: the three-bar imbalance (low[2] > high for shorts, high[2] < low for longs), known at the close of the third bar. Thin gaps are ignored; the gap must sit inside the leg off the sweep.
- Entry: a resting limit order at the proximal, distal or midpoint gap edge, cancelled if unfilled after N bars.
- Stop: beyond the sweep extreme plus an ATR buffer.
- Target: the opposing liquidity pool, or an R multiple when no pool qualifies.
- Kill zones: London and New York windows in an explicit timezone.
- Risk guards: no new setups after the day's loss reaches a limit, and open positions are flattened in a fixed time window.
CHOICES EXPOSED AS INPUTS
Sweep confirmation, FVG entry edge, target mode, pool types, pivots, equal-high/low filter, displacement, stop buffer, kill zones, loss limit and flatten window.
HOW TO CHECK THE NON-REPAINTING CLAIM
Signals are evaluated on bar close, daily pools use high[1] and low[1] with lookahead on (the last closed daily bar), and swing pools are used only after the pivot is confirmed.
1. Add the script to MNQ1! or MES1! on 5 minutes with a fixed date range.
2. With the demo input OFF, record net profit, profit factor, max drawdown and trade count. The table reads "Honest build".
3. Turn the demo input ON and change nothing else. The table reads "LOOK-AHEAD DEMO": on historical bars, every intraday bar already knows its day's final high and low.
4. Compare. The gap is the look-ahead error, not an edge.
The demo must stay OFF for any real evaluation. It isolates one repainting vector: a method, not a certificate.
STRATEGY PROPERTIES (defaults, published as they are)
- Initial capital: 25,000, realistic for one micro futures contract.
- Order size: 1 contract, fixed.
- Margin: 5% long and short, in line with futures margin as a share of notional.
- Commission: 2.25 per contract per side, a plausible all-in cost for micro futures.
- Slippage: 1 tick.
- Orders are processed on bar close; the script does not calculate on every tick.
ALERTS
Entries and exits send a JSON alert_message; dedupe and bracket placement belong on the receiving server.
LIMITATIONS
- A prototype of an entry model, not a tuned system. Every threshold is a documented starting point; no parameter was selected on the tested data.
- Confirmed pivots lag by the right-hand pivot length, so structure is recognized late in fast moves. This is a deliberate trade-off against repainting.
- Backtest results do not guarantee future results. Not financial advice. Futures trading carries substantial risk of loss.
The chart shows MNQ1! on the 5-minute timeframe. The Strategy Tester report uses Deep Backtesting over the entire available history (first trade on 2019-05-06, through 2026-10-11) with 1,145 closed trades and the default properties above. The default chart range alone covers a few months and far fewer trades.
This strategy turns one ICT-style entry sequence into objective, testable rules: a liquidity pool is swept, price shifts market structure with a displacement candle, leaves a fair value gap (FVG), and a limit order waits inside that gap. It is built for MNQ and MES futures on 1 to 15 minute charts.
WHAT IS ORIGINAL HERE
- Every ICT term is written as a precise condition. Where a term has more than one defensible definition, the choice is an input, not a silent default.
- Each setup lives in an explicit state machine (Idle, Swept, MSS, Armed) with its own expiry per phase, so a stale setup cannot leak into a trade. Each pool starts at most one setup.
- A built-in look-ahead A/B switch reproduces the classic request.security() leak on purpose, so anyone can measure its effect in the Strategy Tester instead of trusting a claim.
THE RULES AS IMPLEMENTED
- Pool: previous day high/low (last closed daily bar) and/or confirmed swing highs/lows (ta.pivothigh, ta.pivotlow). The nearest level on each side of price is the active pool. Optional equal highs/lows filter.
- Sweep: price trades through the pool and, by default, closes back on the origin side.
- MSS: within N bars of the sweep, a candle with body of at least ATR x multiplier closes through the opposing confirmed swing, away from the swept pool.
- FVG: the three-bar imbalance (low[2] > high for shorts, high[2] < low for longs), known at the close of the third bar. Thin gaps are ignored; the gap must sit inside the leg off the sweep.
- Entry: a resting limit order at the proximal, distal or midpoint gap edge, cancelled if unfilled after N bars.
- Stop: beyond the sweep extreme plus an ATR buffer.
- Target: the opposing liquidity pool, or an R multiple when no pool qualifies.
- Kill zones: London and New York windows in an explicit timezone.
- Risk guards: no new setups after the day's loss reaches a limit, and open positions are flattened in a fixed time window.
CHOICES EXPOSED AS INPUTS
Sweep confirmation, FVG entry edge, target mode, pool types, pivots, equal-high/low filter, displacement, stop buffer, kill zones, loss limit and flatten window.
HOW TO CHECK THE NON-REPAINTING CLAIM
Signals are evaluated on bar close, daily pools use high[1] and low[1] with lookahead on (the last closed daily bar), and swing pools are used only after the pivot is confirmed.
1. Add the script to MNQ1! or MES1! on 5 minutes with a fixed date range.
2. With the demo input OFF, record net profit, profit factor, max drawdown and trade count. The table reads "Honest build".
3. Turn the demo input ON and change nothing else. The table reads "LOOK-AHEAD DEMO": on historical bars, every intraday bar already knows its day's final high and low.
4. Compare. The gap is the look-ahead error, not an edge.
The demo must stay OFF for any real evaluation. It isolates one repainting vector: a method, not a certificate.
STRATEGY PROPERTIES (defaults, published as they are)
- Initial capital: 25,000, realistic for one micro futures contract.
- Order size: 1 contract, fixed.
- Margin: 5% long and short, in line with futures margin as a share of notional.
- Commission: 2.25 per contract per side, a plausible all-in cost for micro futures.
- Slippage: 1 tick.
- Orders are processed on bar close; the script does not calculate on every tick.
ALERTS
Entries and exits send a JSON alert_message; dedupe and bracket placement belong on the receiving server.
LIMITATIONS
- A prototype of an entry model, not a tuned system. Every threshold is a documented starting point; no parameter was selected on the tested data.
- Confirmed pivots lag by the right-hand pivot length, so structure is recognized late in fast moves. This is a deliberate trade-off against repainting.
- Backtest results do not guarantee future results. Not financial advice. Futures trading carries substantial risk of loss.
The chart shows MNQ1! on the 5-minute timeframe. The Strategy Tester report uses Deep Backtesting over the entire available history (first trade on 2019-05-06, through 2026-10-11) with 1,145 closed trades and the default properties above. The default chart range alone covers a few months and far fewer trades.
릴리즈 노트
- Initial capital raised from 25,000 to 100,000. At 5% margin one contract needs point value x price x 5% of collateral: about 2,500 on MNQ at 25,000, but about 25,000 on NQ, the whole previous account. On NQ1! 15m (2025-11-30 to 2026-10-23) the previous version opened one trade, with about 6 of room above the margin, and closed it with a margin call. 100,000 holds one NQ or ES contract. MNQ and MES need about a tenth of the NQ/ES margin, so there the larger capital mostly changes the percentage figures: net profit % and drawdown % are not comparable with the previous version.- New HUD row: margin per contract at the 5% of the defaults, current equity and the room between them, with a warning when that room is under one ATR (the strategy's ATR input).
- The HUD "Fill" counter now reads strategy.closedtrades + strategy.opentrades, so it counts filled trades. The previous counter compared the position size between bar closes and missed any trade that entered on a bar's close and exited inside the next bar, or opened and closed inside one bar, so the HUD could show Fill 0 with trades in the list.
- No change to pools, sweep, MSS, FVG, entry, stop, target, kill zones, guards or the look-ahead A/B.
릴리즈 노트
- One setup, one trade. The previous version closed a setup only when a position was open at a bar close, so a trade that entered and exited between two closes (an entry on a bar's close stopped out inside the next bar, or a fill and an exit inside one bar) left the setup armed, and the same limit order was placed again at the same gap, with the stop recomputed from the same sweep extreme. On MNQ1! 15m the HUD read FVG 70 and Fill 96. Now the setup closes as soon as its trade has been counted (strategy.closedtrades + strategy.opentrades grew since the previous bar), whether or not the position is still open, so Fill can no longer exceed FVG and the re-entries disappear. A setup now ends with its trade, so the state machine is free sooner: later sweeps, setups and trades can differ, and every HUD count and the trade list can change after the first former re-entry. Unfilled/expired no longer counts setups that traded.- No change to the rules for pools, sweep, MSS, FVG detection, entry price, stop, target, kill zones, guards or the look-ahead A/B; the HUD keeps its rows.
릴리즈 노트
- Flatten window on bars longer than the window. The flatten tested its window with time(timeframe.period, session, timezone), which matches a bar only when the bar's open time is inside the window: with the default 15:55-16:00 on a 15-minute chart no bar ever matched, so positions were never flattened and could run for days (on MNQ1! 15m one trade lasted 480 bars). Now a bar that covers any part of the window flattens at its close: on 15 minutes the 15:45 bar closes the position at 16:00 New York, and that bar also takes no new setups. The flatten stays off on daily and higher timeframes. Trade lists and HUD counts change on every intraday timeframe of 2 minutes or more, other than 5 minutes; on 1 and 5 minutes and on seconds charts, with the default window, the same bars match as before. An order armed before the window can still fill after it; that position is closed at the next window. Kill zones still test the bar's open time.- No change to the rules for pools, sweep, MSS, FVG, entry, stop, target, kill zones, the daily loss lock or the look-ahead A/B; the HUD keeps its rows.
Need your backtest checked? Fixed-price credibility audit on Upwork: upwork.com/services/product/consulting-hr-a-credibility-audit-of-your-trading-backtest-with-a-clear-verdict-2128660454803007984?ref=project_share
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
Need your backtest checked? Fixed-price credibility audit on Upwork: upwork.com/services/product/consulting-hr-a-credibility-audit-of-your-trading-backtest-with-a-clear-verdict-2128660454803007984?ref=project_share
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.