Every strategy from every YN Finance instructor — converted into working code you can paste directly into TradingView or MetaTrader 5. Auto-trade your prop firm challenge, or get precise signals with exact entry, stop, and target prices.
Trade institutional order flow using FVGs and session killzones
Detects Fair Value Gaps (imbalances left by institutional order flow) during London and NY killzones. Only trades in the direction of the 200 EMA trend. Enters on FVG formation with ATR-based stops.
Risk is capped at 0.5% per trade by default. For FTMO: leave Max Daily DD at 4% (their limit is 5%). Run on EURUSD, GBPUSD, or XAUUSD on the 15m or 1H chart. Do NOT trade during high-impact news.
"color:#4a6a78;font-style:italic">//@version=5 "color:#c792ea">strategy("YN Finance — ICT Smart Money | Prop Edition", overlay="color:#c792ea">true, default_qty_type="color:#c792ea">strategy.fixed, default_qty_value=1, commission_type="color:#c792ea">strategy.commission.percent, commission_value=0.01, slippage=2, max_bars_back=500) "color:#4a6a78;font-style:italic">// ── INPUTS ──────────────────────────────────────────────────────── "color:#c792ea">var "color:#82aaff">string G1 = "⚙️ Risk Management" riskPct = "color:#c792ea">input."color:#82aaff">float(0.5, "Risk % Per Trade", minval=0.1, maxval=1.0, step=0.1, group=G1) atrMult = "color:#c792ea">input."color:#82aaff">float(1.5, "Stop Loss (ATR ×)", minval=0.5, maxval=4.0, step=0.1, group=G1) tpRR = "color:#c792ea">input."color:#82aaff">float(2.0, "Take Profit (R:R)", minval=1.0, maxval=5.0, step=0.1, group=G1) "color:#c792ea">var "color:#82aaff">string G2 = "🕐 Session Filter" useSess = "color:#c792ea">input."color:#82aaff">bool("color:#c792ea">true, "Only trade killzones", group=G2) london = "color:#c792ea">input.session("0700-1000", "London Killzone", group=G2) nyOpen = "color:#c792ea">input.session("1300-1600", "NY Open Killzone", group=G2) "color:#c792ea">var "color:#82aaff">string G3 = "📈 Trend Filter" useTrend = "color:#c792ea">input."color:#82aaff">bool("color:#c792ea">true, "Require 200 EMA alignment", group=G3) "color:#4a6a78;font-style:italic">// ── INDICATORS ─────────────────────────────────────────────────── ema200 = "color:#c792ea">ta.ema(close, 200) atr = "color:#c792ea">ta.atr(14) "color:#4a6a78;font-style:italic">// ── FAIR VALUE GAP DETECTION ───────────────────────────────────── "color:#4a6a78;font-style:italic">// Bullish FVG: gap between candle[-2] high "color:#c792ea">and candle[0] low bullFVG = low[0] > high[2] "color:#c792ea">and (low[0] - high[2]) > atr * 0.15 "color:#4a6a78;font-style:italic">// Bearish FVG: gap between candle[-2] low "color:#c792ea">and candle[0] high bearFVG = high[0] < low[2] "color:#c792ea">and (low[2] - high[0]) > atr * 0.15 "color:#4a6a78;font-style:italic">// ── SESSION ────────────────────────────────────────────────────── inLondon = "color:#c792ea">not "color:#c792ea">na(time(timeframe.period, london, "Europe/London")) inNY = "color:#c792ea">not "color:#c792ea">na(time(timeframe.period, nyOpen, "America/New_York")) inSession = "color:#c792ea">not useSess "color:#c792ea">or (inLondon "color:#c792ea">or inNY) "color:#4a6a78;font-style:italic">// ── TREND ──────────────────────────────────────────────────────── bullTrend = "color:#c792ea">not useTrend "color:#c792ea">or close > ema200 bearTrend = "color:#c792ea">not useTrend "color:#c792ea">or close < ema200 "color:#4a6a78;font-style:italic">// ── ENTRIES ────────────────────────────────────────────────────── longEntry = bullFVG "color:#c792ea">and inSession "color:#c792ea">and bullTrend "color:#c792ea">and "color:#c792ea">strategy.position_size == 0 shortEntry = bearFVG "color:#c792ea">and inSession "color:#c792ea">and bearTrend "color:#c792ea">and "color:#c792ea">strategy.position_size == 0 "color:#4a6a78;font-style:italic">// ── STOPS / TARGETS ─────────────────────────────────────────────── slDist = atr * atrMult longSL = close - slDist longTP = close + slDist * tpRR shortSL = close + slDist shortTP = close - slDist * tpRR "color:#4a6a78;font-style:italic">// ── EXECUTE ────────────────────────────────────────────────────── "color:#c792ea">if longEntry "color:#c792ea">strategy.entry("Long", "color:#c792ea">strategy.long, comment="ICT FVG Long") "color:#c792ea">strategy.exit("L-Exit", "Long", stop=longSL, limit=longTP) "color:#c792ea">if shortEntry "color:#c792ea">strategy.entry("Short", "color:#c792ea">strategy.short, comment="ICT FVG Short") "color:#c792ea">strategy.exit("S-Exit", "Short", stop=shortSL, limit=shortTP) "color:#4a6a78;font-style:italic">// ── VISUALS ────────────────────────────────────────────────────── "color:#c792ea">plot(ema200, "200 EMA", color.new(color.blue, 40), 2) "color:#c792ea">bgcolor(bullFVG "color:#c792ea">and inSession ? color.new(color.green, 88) : "color:#c792ea">na, title="Bull FVG") "color:#c792ea">bgcolor(bearFVG "color:#c792ea">and inSession ? color.new(color.red, 88) : "color:#c792ea">na, title="Bear FVG") "color:#c792ea">plotshape(longEntry, "Long", shape.triangleup, location.belowbar, color.green, size=size.normal) "color:#c792ea">plotshape(shortEntry, "Short", shape.triangledown, location.abovebar, color.red, size=size.normal)
Open TradingView.com → search your pair (EURUSD, XAUUSD, etc.) → open a 15-minute or 1-hour chart
At the bottom, click "Pine Script Editor" → click the default code and select all → delete it
Paste the entire script above → click "Add to chart"
Click the ⚙️ gear icon on the strategy panel → set Risk % to 0.5 for FTMO/E8 (never exceed 1%)
Set your chart to 15m for scalping or 1H for swing trades — the algorithm auto-detects London (7-10am UTC) and NY (1-4pm UTC) killzones
For auto-execution: go to TradingView → Alerts → Create → set "Order fills" → connect your broker via TradingView's broker integration (supported: Interactive Brokers, TradeStation, Alpaca)
For FTMO specifically: pause the bot on days with CPI, NFP, or FOMC announcements — these events can spike through stops instantly
Monitor your equity curve weekly. If you hit 3% daily drawdown, manually stop the bot for that day
The algorithms are free. The courses teach you when NOT to trade, what to do when the algorithm stops working, and how to think like the instructor who built the strategy. $0.99 per course.