//@version=6
strategy("Doc02 H1 Liquidity Sweep IFVG - Project Adapted", overlay=true, pyramiding=0, initial_capital=10000)
// Source: user-provided strategy collection - strategy 2
// Logic summary:
// 1. Daily structure decides directional bias.
// 2. 1h must sweep liquidity against the daily direction and reclaim.
// 3. Runtime chart should be 5m. A simplified IFVG/reversal gap confirms entry.
// 4. Stop uses ATR. Target uses prior daily key price approximation.
// Compile confidence: 88/100. Profit confidence: 24/100.
dailyTf = input.timeframe("1d", "Daily trend timeframe")
sweepTf = input.timeframe("60", "Liquidity sweep timeframe")
atrLen = input.int(14, "ATR length", minval=1)
stopAtr = input.float(1.5, "Stop ATR", minval=0.1, step=0.1)
fallbackTargetAtr = input.float(3.0, "Fallback target ATR", minval=0.1, step=0.1)
minBodyRatio = input.float(0.45, "5m reversal body ratio", minval=0.1, maxval=1.0, step=0.05)
dHigh1 = request.security(syminfo.tickerid, dailyTf, high[1])
dHigh2 = request.security(syminfo.tickerid, dailyTf, high[2])
dLow1 = request.security(syminfo.tickerid, dailyTf, low[1])
dLow2 = request.security(syminfo.tickerid, dailyTf, low[2])
dClose1 = request.security(syminfo.tickerid, dailyTf, close[1])
dailyUp = dHigh1 > dHigh2 and dLow1 > dLow2
dailyDown = dHigh1 < dHigh2 and dLow1 < dLow2
h1Low = request.security(syminfo.tickerid, sweepTf, low)
h1High = request.security(syminfo.tickerid, sweepTf, high)
h1Close = request.security(syminfo.tickerid, sweepTf, close)
h1PrevLow = request.security(syminfo.tickerid, sweepTf, low[1])
h1PrevHigh = request.security(syminfo.tickerid, sweepTf, high[1])
longSweep = dailyUp and h1Low < h1PrevLow and h1Close > h1PrevLow
shortSweep = dailyDown and h1High > h1PrevHigh and h1Close < h1PrevHigh
barRange = math.max(high - low, syminfo.mintick)
bodyRatio = math.abs(close - open) / barRange
// Simplified IFVG: a displacement candle reclaims the previous imbalance side.
bullIfvg = low > high[2] and close > open and bodyRatio >= minBodyRatio
bearIfvg = high < low[2] and close < open and bodyRatio >= minBodyRatio
atr = ta.atr(atrLen)
longSignal = strategy.position_size == 0 and longSweep and bullIfvg
shortSignal = strategy.position_size == 0 and shortSweep and bearIfvg
if longSignal
strategy.entry("Long", strategy.long)
if shortSignal
strategy.entry("Short", strategy.short)
longStop = strategy.position_avg_price - atr * stopAtr
shortStop = strategy.position_avg_price + atr * stopAtr
longTarget = math.max(dHigh1, strategy.position_avg_price + atr * fallbackTargetAtr)
shortTarget = math.min(dLow1, strategy.position_avg_price - atr * fallbackTargetAtr)
if strategy.position_size > 0
strategy.exit("Long Risk", "Long", stop=longStop, limit=longTarget)
if strategy.position_size < 0
strategy.exit("Short Risk", "Short", stop=shortStop, limit=shortTarget)
Overview
Doc02 H1 Liquidity Sweep IFVG - Project Adapted determines daily trend direction using historical daily candles, checks for a 1-hour liquidity sweep and reclaim against that trend, and triggers entries on displacement candles with a specified body ratio. Risk management sets an ATR-based stop loss alongside targets derived from prior daily key levels or ATR fallbacks. Drawn overlaying the main price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Daily trend timeframe
timeframe
1d
dailyTf
Liquidity sweep timeframe
timeframe
60
sweepTf
ATR length
int
14
atrLen
Stop ATR
float
1.5
stopAtr
Fallback target ATR
float
3.0
fallbackTargetAtr
5m reversal body ratio
float
0.45
minBodyRatio
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This strategy enters trades in the opposite direction of filled value gaps, operating under the assumption that price action will resume the primary trend after filling a recent gap. It plots directly on the main price chart and supports MA-based trend filters
This strategy identifies reversal opportunities based on liquidity sweeps and multi-gate confluence scoring. It evaluates setups using mandatory conditions such as swing sweeps, body and ATR filters, and dual EMA higher-timeframe trend alignment, alongside opt
This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots
Calculates three-bar Fair Value Gaps (FVG) and filters them using Average True Range. When price mitigates the FVG midpoint, the strategy enters a position in the direction of the gap, provided an optional EMA trend filter is satisfied. Exits are defined by an
This ICT-based strategy trades during the 9:45 AM to 10:15 AM New York session window. It calculates a daily bias using a 20-period daily EMA and tracks previous day highs and lows to identify liquidity sweeps. The script refines order block entry levels and m
This strategy detects liquidity sweeps and market structure shifts by computing swing highs and lows on a base timeframe then drawing zones around them. On a confirmation timeframe it identifies sweeps when price exceeds zone boundaries followed by rejection c