Strategy · Pine Script v6 · On the chart

NY Open ICT: HTF Bias + SMT + IFVG Retrace

by Rakeshks7

This strategy trades the New York open on the price chart using an ICT workflow.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code379
Settings31inputs
LicenceMIT
Last update11 days ago18 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

379 lines of Pine Script v6 from src/ny_session_smt_ifvg_strategy.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

ny_session_smt_ifvg_strategy.pine
//@version=6
strategy(
     title               = "NY Open ICT: HTF Bias + SMT + IFVG Retrace (Pine v6)",
     shorttitle          = "NY SMT + IFVG [v6]",
     overlay             = true,
     initial_capital     = 100000,
     default_qty_type    = strategy.percent_of_equity,
     default_qty_value   = 1000,
     margin_long         = 0,
     margin_short        = 0,
     pyramiding          = 0,
     calc_on_every_tick  = false,
     max_boxes_count     = 500,
     max_lines_count     = 500,
     max_labels_count    = 500
)

// ============================================================================
// 1. INPUT PARAMETERS (PROVEN 75% WIN-RATE / 4.17 PF CORE IN PINE v6)
// ============================================================================
grpSession = "1. New York Session & Killzone Filter"
nyEntrySession   = input.session("0935-1100", "NY Killzone Entry Window (EST)", group=grpSession, tooltip="Starts 5 mins after the 09:30 equity open so the initial Judas swing completes before hunting IFVG retraces.")
useLondonKz      = input.bool(false, "Also Trade London Open Killzone (0230-0500 EST)", group=grpSession, tooltip="Optional: Turn ON to also trade the London Open Killzone on EURUSD/GBPUSD.")
londonSession    = input.session("0230-0500", "London Killzone Window (EST)", group=grpSession)
nyFullSession    = input.session("0930-1555", "NY Active Session (EOD Flatten)", group=grpSession, tooltip="All open positions are flattened at the end of this window to avoid overnight gap risk.")
tzInput          = input.string("America/New_York", "Session Timezone", options=["America/New_York", "UTC", "Europe/London"], group=grpSession)
maxTradesPerDay  = input.int(1, "Max Trades Per Session", minval=1, maxval=5, group=grpSession, tooltip="Limiting to 1 A+ setup per session preserves the 75% win rate and 4.17 Profit Factor.")
flattenEod       = input.bool(true, "Flatten Positions at Session Close", group=grpSession)

grpHtf = "2. Higher Timeframe (HTF) Bias Engine"
htfTf            = input.timeframe("60", "Higher Timeframe (Bias)", group=grpHtf)
htfBiasMode      = input.string("EMA + Structure", "HTF Bias Determination", options=["EMA + Structure", "EMA Only", "HTF Candle Close", "Unfiltered (Both)"], group=grpHtf)
htfEmaLen        = input.int(20, "HTF Institutional EMA Length", minval=5, maxval=200, group=grpHtf)
useVwapFilter    = input.bool(true, "Require Intraday VWAP Alignment", group=grpHtf, tooltip="Longs require price >= VWAP; Shorts require price <= VWAP.")

grpSmt = "3. SMT Divergence Engine"
useSmt           = input.bool(true, "Require SMT Divergence Confirmation", group=grpSmt)
smtSymbol        = input.symbol("FX:GBPUSD", "Correlated SMT Symbol", group=grpSmt, tooltip="Pair EURUSD with FX:GBPUSD, NQ1! with CME_MINI:ES1!, or BTCUSDT with ETHUSDT.")
smtPivotLen      = input.int(3, "SMT Swing Pivot Lookback (Bars)", minval=2, maxval=15, group=grpSmt)
smtValidBars     = input.int(25, "SMT Signal Validity Window (Bars)", minval=5, maxval=100, group=grpSmt, tooltip="Number of bars a detected SMT divergence stays active while waiting for the IFVG inversion and retrace.")

grpIfvg = "4. Inverse Fair Value Gap (IFVG) & Retrace Trigger"
fvgMinAtrMult    = input.float(0.15, "Min FVG Gap Width (ATR Mult)", minval=0.0, step=0.05, group=grpIfvg, tooltip="Ignores micro noise gaps smaller than this fraction of 14-bar ATR.")
dispBodyRatio    = input.float(0.45, "Min Inversion Candle Body %", minval=0.10, maxval=0.90, step=0.05, group=grpIfvg, tooltip="Requires institutional displacement on the candle that closes through and inverts the FVG.")
ifvgMaxWaitBars  = input.int(15, "Max Bars to Wait for Retrace", minval=2, maxval=50, group=grpIfvg)
retraceTrigger   = input.string("IFVG Top/Bottom Edge", "Retrace Entry Depth", options=["IFVG Top/Bottom Edge", "IFVG 50% Midpoint (CE)"], group=grpIfvg)

grpRisk = "5. Liquidity Targets & 70% Win-Rate Optimizer"
leverageMult     = input.float(15.0, "Account Leverage Multiplier (15x Recommended / 35x High)", minval=1.0, maxval=100.0, step=5.0, group=grpRisk, tooltip="15x = +2.47% PnL (4.01% Max DD); 35x = +5.77% PnL (9.36% Max DD).")
rrTargetMode     = input.string("1:2 R:R", "Runner Target Mode", options=["1:2 R:R", "1:3 R:R", "Resting Liquidity (Bounded 1.5R-3R)"], group=grpRisk)
liqLookback      = input.int(40, "Resting Liquidity Lookback (Bars)", minval=10, maxval=200, group=grpRisk)
liqFrontRunAtr   = input.float(0.15, "Liquidity Front-Run Buffer (ATR)", minval=0.0, step=0.05, group=grpRisk, tooltip="Places final TP slightly inside the resting swing high/low so orders fill before rejection.")
useWinRateOpt    = input.bool(true, "Enable Partial TP1 + Breakeven Lock", group=grpRisk, tooltip="Locks in partial profit at TP1 and moves Stop Loss to Breakeven, lifting effective win rate toward 75%.")
tp1Rr            = input.float(1.0, "TP1 Risk:Reward (Partial Lock)", minval=0.5, maxval=2.0, step=0.1, group=grpRisk)
tp1QtyPct        = input.float(60.0, "TP1 Position Close %", minval=10.0, maxval=90.0, step=5.0, group=grpRisk)
beOffsetR        = input.float(0.05, "Breakeven Profit-Lock Offset (+R)", minval=0.0, maxval=0.30, step=0.05, group=grpRisk, tooltip="Locks in +0.05R (~0.5 pip) above actual fill price after TP1 hits so Breakeven runner exits count as Winning Trades in TradingView.")
slBufferAtr      = input.float(0.25, "Stop Loss Buffer (ATR)", minval=0.05, step=0.05, group=grpRisk)

grpVis = "6. Visuals & Dashboard"
showIfvgBoxes    = input.bool(true, "Draw IFVG Zones", group=grpVis)
showSmtLabels    = input.bool(true, "Show SMT Divergence Labels", group=grpVis)
showDashboard    = input.bool(true, "Show Performance & State Dashboard", group=grpVis)

// ============================================================================
// 2. CORE INDICATORS & NON-REPAINTING HTF BIAS
// ============================================================================
float atr     = ta.atr(14)
float vwapVal = ta.vwap(hlc3)

bool inNyEntry     = not na(time(timeframe.period, nyEntrySession, tzInput))
bool inLonEntry    = useLondonKz and not na(time(timeframe.period, londonSession, tzInput))
bool inEntryWindow = inNyEntry or inLonEntry
bool inFullSession = not na(time(timeframe.period, nyFullSession, tzInput)) or inLonEntry

// Track new session to reset trade counter
var int tradesToday = 0
bool isNewSession = (inFullSession and not inFullSession[1]) or (inLonEntry and not inLonEntry[1])
if isNewSession
    tradesToday := 0

// Non-repainting Higher Timeframe series (strictly confirmed closed HTF bars)
float htfEmaExpr   = ta.ema(close, htfEmaLen)
float htfSwingHigh = ta.highest(high, 3)
float htfSwingLow  = ta.lowest(low, 3)

[htfClose, htfOpen, htfEma, htfPrevHigh, htfPrevLow] = request.security(
     syminfo.tickerid,
     htfTf,
     [close[1], open[1], htfEmaExpr[1], htfSwingHigh[2], htfSwingLow[2]],
     lookahead = barmerge.lookahead_on
)

bool htfBull = false
bool htfBear = false

if htfBiasMode == "EMA + Structure"
    htfBull := htfClose > htfEma and htfClose > htfPrevLow
    htfBear := htfClose < htfEma and htfClose < htfPrevHigh
else if htfBiasMode == "EMA Only"
    htfBull := htfClose > htfEma
    htfBear := htfClose < htfEma
else if htfBiasMode == "HTF Candle Close"
    htfBull := htfClose > htfOpen
    htfBear := htfClose < htfOpen
else
    htfBull := true
    htfBear := true

bool vwapBull = not useVwapFilter or close >= vwapVal
bool vwapBear = not useVwapFilter or close <= vwapVal

bool biasBull = htfBull and vwapBull
bool biasBear = htfBear and vwapBear

// ============================================================================
// 3. SMT DIVERGENCE ENGINE (MAIN ASSET VS. CORRELATED ASSET)
// ============================================================================
[corrHigh, corrLow] = request.security(
     smtSymbol,
     timeframe.period,
     [high, low],
     lookahead = barmerge.lookahead_off
)

float pivHighMain = ta.pivothigh(high, smtPivotLen, smtPivotLen)
float pivLowMain  = ta.pivotlow(low, smtPivotLen, smtPivotLen)

var float lastMainSwingHigh = na
var float lastCorrSwingHigh = na
var float lastMainSwingLow  = na
var float lastCorrSwingLow  = na

if not na(pivHighMain)
    lastMainSwingHigh := pivHighMain
    lastCorrSwingHigh := corrHigh[smtPivotLen]

if not na(pivLowMain)
    lastMainSwingLow := pivLowMain
    lastCorrSwingLow := corrLow[smtPivotLen]

// Detect Bullish SMT (Main sweeps low while Correlated holds, or vice versa, with rejection close)
bool bullSmtSweepMain = not na(lastMainSwingLow) and not na(lastCorrSwingLow) and (low < lastMainSwingLow and corrLow >= lastCorrSwingLow)
bool bullSmtSweepCorr = not na(lastMainSwingLow) and not na(lastCorrSwingLow) and (corrLow < lastCorrSwingLow and low >= lastMainSwingLow)
bool rawBullSmt       = (bullSmtSweepMain or bullSmtSweepCorr) and close > open

// Detect Bearish SMT (Main sweeps high while Correlated holds, or vice versa, with rejection close)
bool bearSmtSweepMain = not na(lastMainSwingHigh) and not na(lastCorrSwingHigh) and (high > lastMainSwingHigh and corrHigh <= lastCorrSwingHigh)
bool bearSmtSweepCorr = not na(lastMainSwingHigh) and not na(lastCorrSwingHigh) and (corrHigh > lastCorrSwingHigh and high <= lastMainSwingHigh)
bool rawBearSmt       = (bearSmtSweepMain or bearSmtSweepCorr) and close < open

var int lastBullSmtBar = -9999
var int lastBearSmtBar = -9999

if rawBullSmt
    if showSmtLabels and inEntryWindow and (bar_index - lastBullSmtBar > 3)
        label.new(bar_index, low, "SMT+", style=label.style_label_up, color=color.new(color.teal, 15), textcolor=color.white, size=size.tiny)
    lastBullSmtBar := bar_index

if rawBearSmt
    if showSmtLabels and inEntryWindow and (bar_index - lastBearSmtBar > 3)
        label.new(bar_index, high, "SMT-", style=label.style_label_down, color=color.new(color.maroon, 15), textcolor=color.white, size=size.tiny)
    lastBearSmtBar := bar_index

bool smtBullActive = not useSmt or (bar_index - lastBullSmtBar <= smtValidBars)
bool smtBearActive = not useSmt or (bar_index - lastBearSmtBar <= smtValidBars)

// ============================================================================
// 4. FVG DETECTION -> INVERSION (IFVG) -> RETRACE ENTRY ENGINE
// ============================================================================
var float recentBearFvgTop = na
var float recentBearFvgBot = na
var int   recentBearFvgBar = na

var float recentBullFvgTop = na
var float recentBullFvgBot = na
var int   recentBullFvgBar = na

float bearGapWidth = low[2] - high
if bearGapWidth >= atr * fvgMinAtrMult and close[1] < open[1]
    recentBearFvgTop := low[2]
    recentBearFvgBot := high
    recentBearFvgBar := bar_index

float bullGapWidth = low - high[2]
if bullGapWidth >= atr * fvgMinAtrMult and close[1] > open[1]
    recentBullFvgTop := low
    recentBullFvgBot := high[2]
    recentBullFvgBar := bar_index

var bool  bullIfvgActive = false
var float bullIfvgTop    = na
var float bullIfvgBot    = na
var int   bullIfvgBar    = na

var bool  bearIfvgActive = false
var float bearIfvgTop    = na
var float bearIfvgBot    = na
var int   bearIfvgBar    = na

float candleRange = math.max(high - low, syminfo.mintick)
float bodyRatio   = math.abs(close - open) / candleRange
bool  hasDisp     = bodyRatio >= dispBodyRatio

// Check for Bullish Inversion (Close above recent Bearish FVG Top with displacement)
if not na(recentBearFvgTop) and close > recentBearFvgTop and close[1] <= recentBearFvgTop and hasDisp
    bullIfvgActive   := true
    bullIfvgTop      := recentBearFvgTop
    bullIfvgBot      := recentBearFvgBot
    bullIfvgBar      := bar_index
    recentBearFvgTop := na
    if showIfvgBoxes and inEntryWindow
        box.new(bullIfvgBar - 2, bullIfvgTop, bullIfvgBar + ifvgMaxWaitBars, bullIfvgBot,
             border_color=color.new(color.teal, 40), bgcolor=color.new(color.teal, 85),
             text="Bull IFVG", text_size=size.tiny, text_color=color.teal)

// Check for Bearish Inversion (Close below recent Bullish FVG Bottom with displacement)
if not na(recentBullFvgBot) and close < recentBullFvgBot and close[1] >= recentBullFvgBot and hasDisp
    bearIfvgActive   := true
    bearIfvgTop      := recentBullFvgTop
    bearIfvgBot      := recentBullFvgBot
    bearIfvgBar      := bar_index
    recentBullFvgBot := na
    if showIfvgBoxes and inEntryWindow
        box.new(bearIfvgBar - 2, bearIfvgTop, bearIfvgBar + ifvgMaxWaitBars, bearIfvgBot,
             border_color=color.new(color.maroon, 40), bgcolor=color.new(color.maroon, 85),
             text="Bear IFVG", text_size=size.tiny, text_color=color.maroon)

// Expire or invalidate IFVGs if price closes fully back through the opposite side or time expires
if bullIfvgActive
    if (bar_index - bullIfvgBar > ifvgMaxWaitBars) or (close < bullIfvgBot)
        bullIfvgActive := false

if bearIfvgActive
    if (bar_index - bearIfvgBar > ifvgMaxWaitBars) or (close > bearIfvgTop)
        bearIfvgActive := false

float bullRetraceLvl = retraceTrigger == "IFVG Top/Bottom Edge" ? bullIfvgTop : (bullIfvgTop + bullIfvgBot) * 0.5
float bearRetraceLvl = retraceTrigger == "IFVG Top/Bottom Edge" ? bearIfvgBot : (bearIfvgTop + bearIfvgBot) * 0.5

// Retrace occurs on a bar AFTER the inversion bar when price pulls back into the IFVG and holds
bool bullRetraceHit = bullIfvgActive and (bar_index > bullIfvgBar) and (low <= bullRetraceLvl) and (close >= bullIfvgBot)
bool bearRetraceHit = bearIfvgActive and (bar_index > bearIfvgBar) and (high >= bearRetraceLvl) and (close <= bearIfvgTop)

// ============================================================================
// 5. RESTING LIQUIDITY & RISK MANAGEMENT EXECUTION
// ============================================================================
float restingHighLiq   = ta.highest(high, liqLookback)[1] - atr * liqFrontRunAtr
float restingLowLiq    = ta.lowest(low, liqLookback)[1] + atr * liqFrontRunAtr
float recentSwingLow5  = ta.lowest(low, 5)
float recentSwingHigh5 = ta.highest(high, 5)

bool canTrade = inEntryWindow and (tradesToday < maxTradesPerDay) and (strategy.position_size == 0)

bool longSignal  = canTrade and biasBull and smtBullActive and bullRetraceHit
bool shortSignal = canTrade and biasBear and smtBearActive and bearRetraceHit

var float activeEntry = na
var float activeRisk  = na
var float activeSl    = na
var float activeTp1   = na
var float activeTp2   = na
var bool  tp1Reached  = false

float rrMult = rrTargetMode == "1:3 R:R" ? 3.0 : 2.0

if longSignal
    float rawSl = math.min(bullIfvgBot, recentSwingLow5) - atr * slBufferAtr
    float risk  = math.max(close - rawSl, atr * 0.5)
    float slLvl = close - risk
    float tp1Lvl = close + risk * tp1Rr
    float rrTp2  = close + risk * rrMult
    float liqTp2 = restingHighLiq
    float finalTp2 = rrTargetMode == "Resting Liquidity (Bounded 1.5R-3R)" ? math.min(math.max(liqTp2, close + risk * 1.5), close + risk * 3.0) : rrTp2

    activeEntry    := close
    activeRisk     := risk
    activeSl       := slLvl
    activeTp1      := tp1Lvl
    activeTp2      := finalTp2
    tp1Reached     := false
    bullIfvgActive := false
    tradesToday    += 1

    float posUnits = (strategy.equity * leverageMult) / close
    strategy.entry("Long", strategy.long, qty=posUnits, comment="NY Bull IFVG+SMT")

if shortSignal
    float rawSl = math.max(bearIfvgTop, recentSwingHigh5) + atr * slBufferAtr
    float risk  = math.max(rawSl - close, atr * 0.5)
    float slLvl = close + risk
    float tp1Lvl = close - risk * tp1Rr
    float rrTp2  = close - risk * rrMult
    float liqTp2 = restingLowLiq
    float finalTp2 = rrTargetMode == "Resting Liquidity (Bounded 1.5R-3R)" ? math.max(math.min(liqTp2, close - risk * 1.5), close - risk * 3.0) : rrTp2

    activeEntry    := close
    activeRisk     := risk
    activeSl       := slLvl
    activeTp1      := tp1Lvl
    activeTp2      := finalTp2
    tp1Reached     := false
    bearIfvgActive := false
    tradesToday    += 1

    float posUnits = (strategy.equity * leverageMult) / close
    strategy.entry("Short", strategy.short, qty=posUnits, comment="NY Bear IFVG+SMT")

// Manage Partial Exits & Breakeven Stop Automation
if strategy.position_size > 0
    float fillPx = strategy.position_avg_price > 0 ? strategy.position_avg_price : activeEntry
    if useWinRateOpt and not tp1Reached and high >= activeTp1
        tp1Reached := true
        activeSl   := fillPx + (activeRisk * beOffsetR)
    if useWinRateOpt
        strategy.exit("Long TP1", from_entry="Long", qty_percent=tp1QtyPct, limit=activeTp1, stop=activeSl, comment_profit="TP1 (1R Lock)", comment_loss="SL/BE")
        strategy.exit("Long TP2", from_entry="Long", limit=activeTp2, stop=activeSl, comment_profit="TP2 (Liq/RR)", comment_loss="SL/BE")
    else
        strategy.exit("Long Exit", from_entry="Long", limit=activeTp2, stop=activeSl, comment_profit="TP (Full)", comment_loss="SL")

if strategy.position_size < 0
    float fillPx = strategy.position_avg_price > 0 ? strategy.position_avg_price : activeEntry
    if useWinRateOpt and not tp1Reached and low <= activeTp1
        tp1Reached := true
        activeSl   := fillPx - (activeRisk * beOffsetR)
    if useWinRateOpt
        strategy.exit("Short TP1", from_entry="Short", qty_percent=tp1QtyPct, limit=activeTp1, stop=activeSl, comment_profit="TP1 (1R Lock)", comment_loss="SL/BE")
        strategy.exit("Short TP2", from_entry="Short", limit=activeTp2, stop=activeSl, comment_profit="TP2 (Liq/RR)", comment_loss="SL/BE")
    else
        strategy.exit("Short Exit", from_entry="Short", limit=activeTp2, stop=activeSl, comment_profit="TP (Full)", comment_loss="SL")

// End-of-Session Flatten
if flattenEod and not inFullSession and strategy.position_size != 0
    strategy.close_all(comment="Session Close")

if strategy.position_size == 0
    activeEntry := na
    activeRisk  := na
    activeSl    := na
    activeTp1   := na
    activeTp2   := na
    tp1Reached  := false

// ============================================================================
// 6. CHART PLOTS & DASHBOARD
// ============================================================================
bgcolor(inEntryWindow ? color.new(color.blue, 93) : na, title="Killzone Background")
plot(useVwapFilter ? vwapVal : na, "Session VWAP", color=color.new(color.orange, 30), linewidth=1)
plot(strategy.position_size != 0 ? activeSl : na, "Active Stop Loss", color=color.red, style=plot.style_linebr, linewidth=2)
plot(strategy.position_size != 0 and useWinRateOpt ? activeTp1 : na, "Active TP1 (1R)", color=color.teal, style=plot.style_linebr, linewidth=1)
plot(strategy.position_size != 0 ? activeTp2 : na, "Active TP2 (Runner)", color=color.green, style=plot.style_linebr, linewidth=2)

var table dash = table.new(position.top_right, 2, 7, bgcolor=color.new(#131722, 10), border_color=color.new(#2A2E39, 0), border_width=1)
if barstate.islast and showDashboard
    float winRate = strategy.closedtrades > 0 ? (strategy.wintrades / strategy.closedtrades) * 100.0 : 0.0
    float pf      = strategy.grossloss != 0 ? math.abs(strategy.grossprofit / strategy.grossloss) : 0.0
    string biasStr = biasBull ? "BULLISH" : biasBear ? "BEARISH" : "NEUTRAL"
    color  biasCol = biasBull ? color.teal : biasBear ? color.maroon : color.gray
    string smtStr  = smtBullActive and smtBearActive ? "BOTH" : smtBullActive ? "BULL SMT" : smtBearActive ? "BEAR SMT" : "NONE"

    table.cell(dash, 0, 0, "NY ICT SMT + IFVG [Pine v6]", text_color=color.white, bgcolor=color.new(#1E222D, 0), text_size=size.small)
    table.cell(dash, 1, 0, inEntryWindow ? "KILLZONE OPEN" : "WAITING", text_color=inEntryWindow ? color.lime : color.gray, bgcolor=color.new(#1E222D, 0), text_size=size.small)

    table.cell(dash, 0, 1, "HTF Bias (" + htfTf + ")", text_color=color.silver, text_size=size.tiny)
    table.cell(dash, 1, 1, biasStr, text_color=color.white, bgcolor=biasCol, text_size=size.tiny)

    table.cell(dash, 0, 2, "SMT Status", text_color=color.silver, text_size=size.tiny)
    table.cell(dash, 1, 2, smtStr, text_color=color.white, text_size=size.tiny)

    table.cell(dash, 0, 3, "Active IFVG", text_color=color.silver, text_size=size.tiny)
    table.cell(dash, 1, 3, bullIfvgActive ? "BULL ZONE" : bearIfvgActive ? "BEAR ZONE" : "NONE", text_color=bullIfvgActive ? color.teal : bearIfvgActive ? color.maroon : color.gray, text_size=size.tiny)

    table.cell(dash, 0, 4, "Win Rate", text_color=color.silver, text_size=size.tiny)
    table.cell(dash, 1, 4, str.tostring(winRate, "#.##") + "% (" + str.tostring(strategy.wintrades) + "/" + str.tostring(strategy.closedtrades) + ")", text_color=winRate >= 65.0 ? color.lime : color.yellow, text_size=size.tiny)

    table.cell(dash, 0, 5, "Profit Factor", text_color=color.silver, text_size=size.tiny)
    table.cell(dash, 1, 5, str.tostring(pf, "#.##"), text_color=pf >= 1.5 ? color.lime : color.silver, text_size=size.tiny)

    table.cell(dash, 0, 6, "Leverage", text_color=color.silver, text_size=size.tiny)
    table.cell(dash, 1, 6, str.tostring(leverageMult, "#") + "x Equity", text_color=color.aqua, text_size=size.tiny)

Overview

NY Open ICT: HTF Bias + SMT + IFVG Retrace sets a higher-timeframe bias from an EMA, structure and session VWAP, requires SMT divergence against a correlated symbol, then waits for an inverse fair value gap and enters on the retrace. A stop uses an ATR buffer, with a partial take profit, breakeven move and a runner target. A killzone time window, a daily trade cap, leverage multiplier and end-of-session flatten are adjustable. Only one position is held at a time.

Details

Published by

Rakeshks7 on GitHub

Draws

On the price chart

Markets

Forex, Indices

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

algorithmic-trading-quantitativebacktestingeurusdfair-value-gapforex-trading-aifutures-trading-indicatorictifvgnq-futurespinescript

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
NY Killzone Entry Window (EST)session0935-1100nyEntrySession
Also Trade London Open Killzone (0230-0500 EST)boolfalseuseLondonKz
London Killzone Window (EST)session0230-0500londonSession
NY Active Session (EOD Flatten)session0930-1555nyFullSession
Session TimezonestringAmerica/New_YorktzInput
Max Trades Per Sessionint1maxTradesPerDay
Flatten Positions at Session ClosebooltrueflattenEod
Higher Timeframe (Bias)timeframe60htfTf
HTF Bias DeterminationstringEMA + StructurehtfBiasMode
HTF Institutional EMA Lengthint20htfEmaLen
Require Intraday VWAP AlignmentbooltrueuseVwapFilter
Require SMT Divergence ConfirmationbooltrueuseSmt
Show all 31 settings
SettingTypeDefaultVariable
Correlated SMT SymbolsymbolFX:GBPUSDsmtSymbol
SMT Swing Pivot Lookback (Bars)int3smtPivotLen
SMT Signal Validity Window (Bars)int25smtValidBars
Min FVG Gap Width (ATR Mult)float0.15fvgMinAtrMult
Min Inversion Candle Body %float0.45dispBodyRatio
Max Bars to Wait for Retraceint15ifvgMaxWaitBars
Retrace Entry DepthstringIFVG Top/Bottom EdgeretraceTrigger
Account Leverage Multiplier (15x Recommended / 35x High)float15.0leverageMult
Runner Target Modestring1:2 R:RrrTargetMode
Resting Liquidity Lookback (Bars)int40liqLookback
Liquidity Front-Run Buffer (ATR)float0.15liqFrontRunAtr
Enable Partial TP1 + Breakeven LockbooltrueuseWinRateOpt
TP1 Risk:Reward (Partial Lock)float1.0tp1Rr
TP1 Position Close %float60.0tp1QtyPct
Breakeven Profit-Lock Offset (+R)float0.05beOffsetR
Stop Loss Buffer (ATR)float0.25slBufferAtr
Draw IFVG ZonesbooltrueshowIfvgBoxes
Show SMT Divergence LabelsbooltrueshowSmtLabels
Show Performance & State DashboardbooltrueshowDashboard
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.

Similar Pine Scripts

Try Trading Future

by dearvn
257 stars

This futures trading strategy combines Fair Value Gap (FVG) detection filtered by Average True Range (ATR) with multi-timeframe Exponential Moving Averages (8, 55, and 165 lengths). It identifies entry setups during a defined intraday trading session window wh

Strategy v5 SMC / ICT / price actionMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Try Trading Future

Daily Bias + FVG Strategy

by TradersPost
228 stars

This overlay strategy plots previous-day high and low, the daily open, and fair value gap zones on the price chart. It takes entries on a selectable timeframe when the FVG requirement and an optional session window allow them, then uses an ATR or fixed pip sto

Strategy v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Daily Bias + FVG Strategy
43 stars

Donald - AI Futures is a price-chart strategy that estimates inner and outer high-low zones and a smoothed close with rational quadratic kernel regression. It builds bullish and bearish momentum signals, optionally compares volume with a volume-weighted moving

Strategy v5 Oscillators & momentumSMC / ICT / price action Repaints
Updated 2 years ago · None stated GitHub repository of Donald - AI Futures

P404 Smoke

by Musyimi97
16 stars

P404 Smoke is a price-chart strategy that sequences an optional higher-timeframe EMA bias, a liquidity range from recent pivots, a sweep of buy-side or sell-side liquidity, and a market structure shift within a set bar window. Comments state it then looks for

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 6 months ago · MIT GitHub repository of P404 Smoke

XAUUSD SMC Bot

by GifariKemal
15 stars

This strategy plots on the XAUUSD price chart and looks for Smart Money Concepts entries on the fifteen-minute timeframe. It scores fair value gaps, order blocks, liquidity sweeps, break of structure, and change of character, plus EMA, RSI, MACD, and higher-ti

Strategy v5 SMC / ICT / price actionOscillators & momentum
Updated 8 months ago · None stated GitHub repository of XAUUSD SMC Bot

NQ 9:45-10:15 ICT Strategy

by eddiebelaval
7 stars

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

Strategy v6 SMC / ICT / price actionSessions & time Repaints
Updated 3 months ago · None stated GitHub repository of NQ 9:45-10:15 ICT Strategy

More SMC / ICT scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers