v1 made better, kept simple: the same proven VR-gated breakout with one stop, one target, a clean 2:1 on a 25% tighter stop. No partials, no trailing, no runner babysitting. Lab-gridded across 36 configs and confirmed out-of-sample: v1’s profit factor, +24% more total R. Long and short.
Deliberately simple, low-parameter strategies built on well-documented edges. Auto-trade ready, long and short, with prop-firm risk rules.
// SIGNATURE8 strategies
Signature Strategies
The defining method of each YN Finance instructor, ICT, Ross Cameron, Rayner Teo and more, converted into working code.
// INDICATORS16 strategies
Indicators & Signals
Visual markup and alert tools. Drop them on a chart for precise entry, stop and target prices, you pull the trigger.
// MONTE CARLO LAB
We ran 3 robust strategies through 20,000 prop challenges each.
Each strategy was simulated through an FTMO-style evaluation, 0.5% risk/trade, pass at +8.0%, bust at −6.0% trailing, over a 120-trade window, with a live edge haircut applied first. Ranked by a composite of pass rate, expectancy and risk of ruin.
#
STRATEGY
WIN*
R*
EXP(R)
PASS%
RUIN%
MED-RET
P95-DD
SCORE
1
Trend Pullback (TS-Momentum)
0.41
1.80
0.16
66.4%
23.9%
8.2%
6.4%
0.59
2
RSI-2 Mean Reversion
0.57
0.90
0.09
42.9%
12.9%
5.6%
6.2%
0.37
3
Opening-Range Breakout
0.38
1.80
0.05
36.9%
49.4%
0.5%
6.4%
0.15
* WIN / R are post-haircut (the values actually simulated), not the advertised targets. Model assumptions, not live backtests, validate each strategy on 6–12 months of real data before trading a funded account. Generated 2026-06-22.
// NOW VIEWING
RG2YN FINANCE QUANT DESK GOD MODE
Adaptive Regime-Switching 2.1 — Fixed 2:1, No Trailing
v1 made BETTER, kept SIMPLE: the same proven VR-gated breakout — one stop, one target, NO partials, NO trailing — upgraded to a clean 2:1 reward:risk on a 25% tighter stop, with the adaptive percentile gate, a blow-off-bar entry filter, midday + dead-tape skips and a 2-loss daily halt. In the fixed-target lab grid (36 configs, confirmed out-of-sample) this geometry matched v1’s profit factor while paying +24% more total R. Every box on the chart is a visible 2:1. Long/short.
ASSETS
Futures (MNQ/NQ), Indices, FX, Crypto
TIMEFRAMES
5m, 15m, 1H
WIN RATE TARGET
Lab (OOS): 2:1 on 1.5-ATR stop ≈ v1’s PF with +24% total R at ~1R avg/trade · expect high-60s–low-70s% win — the honest cost of a real 2:1; confirm on YOUR chart (notes)
RISK / TRADE
0.5% risk-based
// HOW IT WORKS
The direct upgrade of the Holy Grail, with v1’s soul intact: ONE stop, ONE target, no partials, no trailing, no runner management — you see the full reward:risk box on every trade, and it is a real 2:1. What changed, each change earned in the lab: ① GEOMETRY — the target moves from 1.5R to 2R while the stop TIGHTENS from 2.0 to 1.5 ATR. In the 36-config fixed-target grid (confirmed on 12 fresh out-of-sample seeds) that pairing matched v1’s profit factor while paying +24% more total R at ~1R average per trade — the best expectancy of any fixed-target configuration tested, at unchanged frequency. The honest cost: a 2:1 target wins less often than a 1.5:1 — expect high-60s to low-70s percent instead of v1’s low-to-mid-70s; the bigger winners more than pay for it. ② ADAPTIVE GATE — besides the hard VR floor (1.30), the variance ratio must sit in the top slice of its own trailing distribution (70th percentile over ~500 bars), so the regime read self-calibrates per instrument and timeframe. ③ BLOW-OFF FILTER — entries whose signal bar spans more than 2.5×ATR are skipped; a breakout you meet mid-explosion has the worst fill and the widest effective risk of the day. ④ LOSS-AVOIDANCE DEFAULTS — midday-chop skip, a dead-tape stand-down when ATR sits under 75% of its own average, and a 2-loss daily halt. The breakout-quality filters that ARE the edge — 0.5-ATR extension, 0.7 strong-close — remain untouched from v1. A first-pullback re-entry setup exists in the inputs but ships OFF: the lab showed pullback entries only paid under trailing management and DILUTE a fixed-target book (tested at every target level) — that is a finding, not an oversight.
// PROP FIRM NOTES
WHY 2.1 EXISTS — THE FULL CHAIN. The 2.0 bank-and-run build printed a real 21-trade sample of 76.19% win / PF 2.71 — but banking 60% at a near TP1 made every trade LOOK like a terrible reward:risk on the chart, and the trailing runner is management most people neither want nor stick to. 2.1 is the answer to one demand: v1 but better, ONE stop, ONE target, nothing trailing. THE EVIDENCE: the lab (scripts/regime2-research.mjs, house multi-regime MNQ sim, RELATIVE deltas only) gridded 36 fixed-target configs — targets 1R–2.5R × stops 1.5–2.0 ATR — against a v1 control, then confirmed finalists on 12 fresh out-of-sample seeds. Result, OOS: v1 control (1.5R on 2.0-ATR stop) 72.9% win · PF 3.88 · 0.79R avg — the 2.1 config (2R on 1.5-ATR stop + blow-off filter) 67.9% win · PF 3.97 · 0.99R avg · +24% total R at the same frequency. Same profit factor as v1, a real 2:1 on every box, a 25% tighter stop in points, and a quarter more R earned. Two findings you should not undo: pullback re-entries were tested at EVERY target level and always diluted a fixed-target book (they only paid under trailing management) — usePull ships OFF for that reason; and the spike filter is cheap insurance, its edge grows with the target. TRANSLATE HONESTLY: expect win in the high-60s to low-70s (v1 real ran 75–83% at 1.5R; a 2:1 target mechanically wins ~5pt less) with the same PF-4-to-5-class economics and visibly better geometry. The sim flatters momentum — the real chart is the only scoreboard: run it on the same chart/period as your last test and compare the trade lists. The VR floor is still the only quality dial; extension 0.5 and strong-close 0.7 are still the edge. v1 remains in the catalog unchanged.
FTMOTopstepApexMyFundedFutures
// TYPE
// PLATFORM
Paste this into TradingView’s Pine Script Editor. The strategy auto-executes via broker integrations or webhooks (webhooks need a paid TradingView plan).
PINE SCRIPT v5 · TRADINGVIEW
//@version=5strategy("YN Finance — ⚡ Adaptive Regime-Switching 2.1 — Fixed 2:1, No Trailing | GOD MODE", overlay=true, max_bars_back=5000, max_boxes_count=500, max_lines_count=500, max_labels_count=500, default_qty_type=strategy.percent_of_equity, default_qty_value=1, commission_type=strategy.commission.percent, commission_value=0.02, slippage=2, process_orders_on_close=true, calc_on_every_tick=false, pyramiding=0)
// ════════════════════ QUANT MATH LIBRARY ════════════════════// Ordinary least squares of y on x over n bars → [intercept, slope].
f_ols(float y, float x, int n) =>
mx = ta.sma(x, n)
my = ta.sma(y, n)
cov = ta.sma(x * y, n) - mx * my
vx = ta.sma(x * x, n) - mx * mx
beta = vx != 0.0 ? cov / vx : 0.0
alpha = my - beta * mx
[alpha, beta]
// Rolling z-score.
f_z(float src, int n) =>
m = ta.sma(src, n)
sd = ta.stdev(src, n)
sd != 0.0 ? (src - m) / sd : 0.0// Half-life of mean reversion from the AR(1) coefficient:// ΔS_t = a + b·S_{t-1}; ρ = 1+b; HL = -ln2 / ln(ρ) (bars). naifnot reverting.
f_halflife(float src, int n) =>
lag = src[1]
dS = src - lag
[a, b] = f_ols(dS, lag, n)
rho = 1.0 + b
hl = (b < 0.0and rho > 0.0and rho < 1.0) ? -math.log(2.0) / math.log(rho) : na
hl
// Lo–MacKinlay variance ratio at lag q. ≈1 random walk, >1 trending, <1 reverting.
f_varratio(float src, int q, int n) =>
r1 = src - src[1]
rq = src - src[q]
v1 = ta.variance(r1, n)
vq = ta.variance(rq, n)
v1 != 0.0 ? vq / (math.max(1, q) * v1) : 1.0// Hurst exponent via the rescaled-range / structure-function slope (4 lags, OLS).
f_hurst(float src, int n) =>
t1 = ta.stdev(src - src[2], n)
t2 = ta.stdev(src - src[4], n)
t3 = ta.stdev(src - src[8], n)
t4 = ta.stdev(src - src[16], n)
y1 = t1 > 0.0 ? math.log(t1) : 0.0
y2 = t2 > 0.0 ? math.log(t2) : 0.0
y3 = t3 > 0.0 ? math.log(t3) : 0.0
y4 = t4 > 0.0 ? math.log(t4) : 0.0
sy = y1 + y2 + y3 + y4
sxy = 0.6931 * y1 + 1.3863 * y2 + 2.0794 * y3 + 2.7726 * y4
hr = (4.0 * sxy - 6.9315 * sy) / (4.0 * 14.4135 - 6.9315 * 6.9315)
na(hr) ? 0.5 : math.max(0.0, math.min(1.0, hr))
// Scalar Kalman filter (local-level model) → adaptive fair value.
f_kalman(float src, float q, float r) =>
varfloat est = navarfloat perr = 1.0
p = nz(perr[1], 1.0) + q
kg = p / (p + r)
e = nz(est[1], src) + kg * (src - nz(est[1], src))
perr := (1.0 - kg) * p
est := e
e
// Annualized realized volatility (% per sqrt(barsPerYear)).
f_rvol(float src, int n, float bpy) =>
ret = src / src[1] - 1.0ta.stdev(ret, n) * math.sqrt(bpy) * 100.0// Pearson correlation (for cointegration confirmation).
f_corr(float a, float b, int n) => ta.correlation(a, b, n)
// ═══════════ ① ADAPTIVE REGIME GATE (VR floor + self-calibrating percentile) ═══════════
vrLag = input.int(5, "Variance-ratio lag q", minval=2, group="① Adaptive Regime Gate")
vrLen = input.int(60, "Variance-ratio window", group="① Adaptive Regime Gate")
vrFloor = input.float(1.30, "VR floor (hard minimum to arm)", step=0.05, group="① Adaptive Regime Gate", tooltip="The 1.0 real-data dial: quality falls off a cliff below ~1.3. 2.0 keeps a hard floor AND adds the adaptive percentile below.")
useAdapt = input.bool(true, "ADAPTIVE: VR must also be in its own top percentile", group="① Adaptive Regime Gate", tooltip="2.0 upgrade — the tape must be trending relative to ITS OWN recent character, not one fixed number for every market. Self-calibrates across instruments and timeframes.")
adaptLen = input.int(500, "Percentile lookback (bars)", group="① Adaptive Regime Gate")
adaptPct = input.float(70, "VR percentile ≥", step=5, group="① Adaptive Regime Gate")
useHurst = input.bool(false, "Also require Hurst ≥ min (stricter)", group="① Adaptive Regime Gate")
hurstMin = input.float(0.52, "Min Hurst", step=0.01, group="① Adaptive Regime Gate")
hWin = input.int(80, "Hurst window", group="① Adaptive Regime Gate")
// ═══════════ ② SETUP A — BREAKOUT (the proven 1.0 core, untouched) ═══════════
dcLen = input.int(30, "Donchian breakout length", group="② Setup A — Breakout")
regimeLen = input.int(200, "Trend EMA (direction filter)", group="② Setup A — Breakout")
minStr = input.float(0.7, "Breakout bar closes in top/bottom × of range", step=0.05, minval=0, maxval=1, group="② Setup A — Breakout", tooltip="Commitment filter — unchanged from 1.0. This is the edge; do not loosen it for frequency.")
extAtr = input.float(0.5, "Extend past channel (ATR ×)", step=0.05, group="② Setup A — Breakout", tooltip="False-poke filter — unchanged from 1.0. This is the edge; do not loosen it for frequency.")
// ═══════════ ③ SETUP B — FIRST PULLBACK (ships OFF — see tooltip) ═══════════
usePull = input.bool(false, "Trade the FIRST pullback after a confirmed breakout (OFF — lab finding)", group="③ Setup B — Pullback", tooltip="Tested at every target level in the fixed-target lab: pullback re-entries only paid under trailing management and consistently DILUTED a fixed-target book (~−0.3 PF, −2pt win). Left available for experimenters; the shipped 2.1 book does not want it.")
pbEma = input.int(20, "Pullback EMA", group="③ Setup B — Pullback")
pbWindow = input.int(25, "Re-entry window after breakout (bars)", group="③ Setup B — Pullback")
pbStr = input.float(0.7, "Resumption bar commitment (close position ≥)", step=0.05, group="③ Setup B — Pullback")
useFailHold = input.bool(true, "Failed-breakout veto: pullback must HOLD the broken level", group="③ Setup B — Pullback", tooltip="Only relevant when the pullback setup is enabled: a pullback that trades back THROUGH the broken level is a failed breakout — never re-enter it.")
// ═══════════ ④ STOP / TARGET — FIXED. One stop, one target, no partials, no trailing ═══════════
atrLen = input.int(14, "ATR length", group="④ Stop / Target (fixed)")
slAtr = input.float(1.5, "Stop (ATR ×)", step=0.05, group="④ Stop / Target (fixed)", tooltip="Lab-retuned 2.0 → 1.5: the tighter stop is what buys the 2:1 target its profit factor — 25% less risk per trade in points, confirmed out-of-sample against v1 geometry.")
tpR = input.float(2.0, "Target (R = × stop) — the visible reward:risk", step=0.05, group="④ Stop / Target (fixed)", tooltip="Lab-retuned 1.5 → 2.0: on the 1.5-ATR stop, the 2:1 target matched v1 profit factor with +24% total R at ~1R average per trade (out-of-sample). The honest cost: ~5pt of win rate vs 1.5:1 — the bigger winners pay for it.")
// ═══════════ ⑤ LOSS AVOIDANCE — skip the tape that kills breakout systems ═══════════
spikeSkip = input.bool(true, "Blow-off filter: skip entries on bars spanning > × ATR", group="⑤ Loss Avoidance", tooltip="A breakout you meet mid-explosion has the worst fill and widest effective risk of the day. Cheap insurance whose edge grows with the target size (lab-tested).")
spikeX = input.float(2.5, "Blow-off bar threshold (ATR ×)", step=0.1, group="⑤ Loss Avoidance")
skipMid = input.bool(true, "Skip the midday chop (1.0 option → 2.x default)", group="⑤ Loss Avoidance")
midSess = input.session("1130-1330", "Midday window to skip (NY)", group="⑤ Loss Avoidance")
useDead = input.bool(true, "Dead-tape filter: ATR must be ≥ × of its average", group="⑤ Loss Avoidance", tooltip="Breakouts need fuel. When ATR sits far below its own average the tape is dead and breaks die — stand down.")
deadX = input.float(0.75, "ATR floor (× of ATR average)", step=0.05, group="⑤ Loss Avoidance")
atrAvg = input.int(100, "ATR average length", group="⑤ Loss Avoidance")
maxLossDay = input.int(2, "Halt after N losing exits in a day", minval=1, group="⑤ Loss Avoidance")
// ═══════════ RISK & TRADE (fixed-point stop / target) ═══════════
riskPct = input.float(0.5, "Risk % of equity per trade", step=0.1, group="⑨ Risk & Trade")
stopPts = input.float(50, "Stop (price points)", step=1, group="⑨ Risk & Trade")
tgtPts = input.float(50, "Target (price points)", step=1, group="⑨ Risk & Trade")
useDailyStop = input.bool(true, "Daily loss kill-switch", group="⑨ Risk & Trade")
dailyLossPct = input.float(4.0, "Daily loss limit %", step=0.5, group="⑨ Risk & Trade")
maxTradesDay = input.int(10, "Max trades per day", group="⑨ Risk & Trade")
useTimeStop = input.bool(false, "Time stop (cut dead trades)", group="⑨ Risk & Trade")
maxBars = input.int(100, "Max bars in trade", group="⑨ Risk & Trade")
useSess = input.bool(false, "Restrict to session", group="⑩ Session")
sess = input.session("0930-1600", "Session (NY)", group="⑩ Session")
showDash = input.bool(true, "Show dashboard", group="⑪ Visuals")
showBoxes = input.bool(true, "Show trade boxes", group="⑪ Visuals")
tz = "America/New_York"
atr = ta.atr(14)
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
inSess = notna(time(timeframe.period, sess, tz))
sessOk = not useSess or inSess
newDay = ta.change(time("D")) != 0
f_fmt(x) => str.tostring(x, format.mintick)
// signal placeholders (assigned by the strategy core)bool longSig = falsebool shortSig = falsefloat riskScale = 1.0// ════════════════════ STRATEGY CORE ════════════════════
emaR = ta.ema(close, regimeLen)
emaP = ta.ema(close, pbEma)
vr = f_varratio(math.log(close), vrLag, vrLen)
vrPct = ta.percentrank(vr, adaptLen)
hurst = f_hurst(math.log(close), hWin)
trending = vr >= vrFloor and (not useAdapt or vrPct >= adaptPct) and (not useHurst or hurst >= hurstMin)
atrC = ta.atr(atrLen)
liveTape = not useDead or atrC >= deadX * ta.sma(atrC, atrAvg)
dHi = ta.highest(high, dcLen)[1]
dLo = ta.lowest(low, dcLen)[1]
brng = math.max(high - low, syminfo.mintick)
closePos = (close - low) / brng
strongUp = closePos >= minStr
strongDn = (1.0 - closePos) >= minStr
extUp = close >= dHi + extAtr * atrC
extDn = close <= dLo - extAtr * atrC
inMid = notna(time(timeframe.period, midSess, tz))
spikeOk = not spikeSkip or (high - low) <= spikeX * atrC
breakUp = trending and liveTape and spikeOk and close > emaR and extUp and strongUp
breakDn = trending and liveTape and spikeOk and close < emaR and extDn and strongDn
// SETUP B — regime memory: a confirmed breakout arms a first-pullback re-entry windowvarint armUp = navarint armDn = navarfloat armUpLvl = navarfloat armDnLvl = naif breakUp
armUp := bar_index
armUpLvl := dHi
if breakDn
armDn := bar_index
armDnLvl := dLo
// failed-breakout veto: if the pullback trades back THROUGH the broken level,// the breakout failed — never re-enter a failed break (lab-found PF lever)
holdUp = not useFailHold orna(armUpLvl) or low >= armUpLvl
holdDn = not useFailHold orna(armDnLvl) or high <= armDnLvl
pullUp = usePull andnotna(armUp) and bar_index > armUp and (bar_index - armUp) <= pbWindow and trending and liveTape and close > emaR and low <= emaP and close > emaP and closePos >= pbStr and holdUp
pullDn = usePull andnotna(armDn) and bar_index > armDn and (bar_index - armDn) <= pbWindow and trending and liveTape and close < emaR and high >= emaP and close < emaP and (1.0 - closePos) >= pbStr and holdDn
if pullUp
armUp := naif pullDn
armDn := na
isPull = (pullUp andnot breakUp) or (pullDn andnot breakDn)
longSig := breakUp or pullUp
shortSig := breakDn or pullDn
// ═══════════ EXECUTION 2.1 — FIXED stop & target. No partials, no trailing. ═══════════
atrV = ta.atr(atrLen)
varfloat dayEq = navarint tradesToday = 0varint lossesToday = 0if newDay
dayEq := strategy.equity
tradesToday := 0
lossesToday := 0ifstrategy.closedtrades > nz(strategy.closedtrades[1])
ifstrategy.closedtrades.profit(strategy.closedtrades - 1) < 0
lossesToday := lossesToday + 1
dayPnl = na(dayEq) ? 0.0 : (strategy.equity - dayEq) / dayEq * 100.0
blockNew = (useDailyStop and dayPnl <= -dailyLossPct) or (tradesToday >= maxTradesDay) or (skipMid and inMid) or (lossesToday >= maxLossDay)
canEnter = strategy.position_size == 0and barstate.isconfirmed and sessOk andnot blockNew
varfloat eEntry = navarfloat eSL = navarfloat eTP = naif longSig and canEnter and atrV > 0
eEntry := close
eSL := close - slAtr * atrV
eTP := close + tpR * slAtr * atrV
tradesToday := tradesToday + 1strategy.entry("L", strategy.long, qty = (strategy.equity * riskPct / 100.0) / (slAtr * atrV))
if showBoxes
box.new(bar_index, eTP, bar_index + 24, eEntry, border_color=color.new(color.lime, 40), bgcolor=color.new(color.lime, 85))
box.new(bar_index, eEntry, bar_index + 24, eSL, border_color=color.new(color.red, 40), bgcolor=color.new(color.red, 85))
line.new(bar_index, eEntry, bar_index + 24, eEntry, color=color.new(color.white, 0), style=line.style_dashed)
label.new(bar_index, eTP, "LONG 2.1 · " + str.tostring(tpR, "#.#") + "R" + (isPull ? " · pullback" : ""), style=label.style_label_down, color=color.new(color.lime, 20), textcolor=color.black, size=size.small)
alert("REGIME21 LONG " + syminfo.ticker + " @ " + f_fmt(eEntry) + " | SL " + f_fmt(eSL) + " | TP " + f_fmt(eTP), alert.freq_once_per_bar)
if shortSig and canEnter and atrV > 0
eEntry := close
eSL := close + slAtr * atrV
eTP := close - tpR * slAtr * atrV
tradesToday := tradesToday + 1strategy.entry("S", strategy.short, qty = (strategy.equity * riskPct / 100.0) / (slAtr * atrV))
if showBoxes
box.new(bar_index, eEntry, bar_index + 24, eTP, border_color=color.new(color.lime, 40), bgcolor=color.new(color.lime, 85))
box.new(bar_index, eSL, bar_index + 24, eEntry, border_color=color.new(color.red, 40), bgcolor=color.new(color.red, 85))
line.new(bar_index, eEntry, bar_index + 24, eEntry, color=color.new(color.white, 0), style=line.style_dashed)
label.new(bar_index, eTP, "SHORT 2.1 · " + str.tostring(tpR, "#.#") + "R" + (isPull ? " · pullback" : ""), style=label.style_label_up, color=color.new(color.red, 20), textcolor=color.white, size=size.small)
alert("REGIME21 SHORT " + syminfo.ticker + " @ " + f_fmt(eEntry) + " | SL " + f_fmt(eSL) + " | TP " + f_fmt(eTP), alert.freq_once_per_bar)
// ── management: the exit is the entry decision — stop or target, nothing else ──ifstrategy.position_size > 0strategy.exit("L-x", from_entry="L", stop=eSL, limit=eTP)
ifstrategy.position_size < 0strategy.exit("S-x", from_entry="S", stop=eSL, limit=eTP)
plot(emaR, "Trend EMA", color=color.new(color.orange, 0), linewidth=2)
plot(emaP, "Pullback EMA", color=color.new(color.aqua, 55))
plot(dHi, "Donchian Hi", color=color.new(color.lime, 55))
plot(dLo, "Donchian Lo", color=color.new(color.red, 55))
// ═══════════ LIVE QUANT DASHBOARD ═══════════var table g = naif showDash and barstate.islast
table.delete(g)
g := table.new(position.top_right, 2, 9, border_width=1, frame_color=color.new(#4ade80, 40), frame_width=1)
table.cell(g, 0, 0, "⚡ Regime 2.1", text_color=color.white, bgcolor=color.new(#4ade80, 0), text_size=size.normal)
table.cell(g, 1, 0, "GOD MODE", text_color=color.new(color.white, 10), bgcolor=color.new(#4ade80, 0), text_size=size.small)
table.cell(g, 0, 1, "VR / percentile", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 1, str.tostring(vr, "#.##") + " · p" + str.tostring(vrPct, "#"), text_color=trending ? color.aqua : color.gray, text_size=size.small)
table.cell(g, 0, 2, "Regime", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 2, trending ? "TRENDING — armed" : "RANGE — stand down", text_color=trending ? color.aqua : color.gray, text_size=size.small)
table.cell(g, 0, 3, "R : R", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 3, str.tostring(tpR, "#.##") + " : 1 fixed", text_color=color.lime, text_size=size.small)
table.cell(g, 0, 4, "Tape", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 4, liveTape ? (spikeOk ? "ALIVE — fuel ok" : "BLOW-OFF — skip") : "DEAD — skip", text_color=liveTape and spikeOk ? color.lime : color.orange, text_size=size.small)
table.cell(g, 0, 5, "Trend EMA", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 5, close > emaR ? "BULL ▲" : "BEAR ▼", text_color=close > emaR ? color.lime : color.red, text_size=size.small)
table.cell(g, 0, 6, "Losses today", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 6, str.tostring(lossesToday) + " / " + str.tostring(maxLossDay), text_color=lossesToday >= maxLossDay ? color.red : color.white, text_size=size.small)
table.cell(g, 0, 7, "Position", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 7, strategy.position_size > 0 ? "LONG" : strategy.position_size < 0 ? "SHORT" : "FLAT", text_color=strategy.position_size > 0 ? color.lime : strategy.position_size < 0 ? color.red : color.gray, text_size=size.small)
table.cell(g, 0, 8, "Day P&L", text_color=color.gray, text_size=size.small)
table.cell(g, 1, 8, str.tostring(dayPnl, "#.##") + "%", text_color=dayPnl >= 0 ? color.lime : color.red, text_size=size.small)
// STEP-BY-STEP DEPLOYMENT
01
Open TradingView → Pine Editor → paste the ⚡ Adaptive Regime-Switching 2.1 — Fixed 2:1, No Trailing strategy → Add to Chart (5m/15m/1H chart of Futures (MNQ/NQ)).
02
Open the dashboard (top-right): it shows the live quant state — the regime/stationarity diagnostics, the model’s decision, and the current position. The strategy only fires when its statistical preconditions are met, so expect selective entries.
03
Configure the core inputs at the top (the pair symbol / lookbacks / z-bands), then Risk & Exits. Position size is solved from the stop to risk a fixed % of equity; the daily kill-switch protects the evaluation.
04
Open the Strategy Tester and judge it AFTER commission + slippage: net profit, profit factor, max drawdown, Sharpe, trade count. The math is exact — whether it is profitable on this symbol is an empirical question only the tester answers.
05
Walk it forward: optimize on the first 70% of history, then verify on the last 30% it has never seen. Trust the out-of-sample number. If it survives, size up slowly.
06
These are real, top-tier quant frameworks — not magic. Even great quant runs a Sharpe of ~1–2. Treat the win-rate targets as hypotheses to be tested, never promises.
// LEARN THE STRATEGY BEHIND THE CODE
Understand why it works, not just how to copy it.
The algorithms are free. The courses teach you when NOT to trade, what to do when an edge stops working, and how to think like the trader who built it.