OPEN-SOURCE SCRIPT

Hybrid Sniper 15m: Dual Entry MTF with Bayesian Probability

5 441
A 15m execution system with two entry types — liquidity sweeps of the prior 2H level and volume-backed trend continuation — gated by 2H+4H bias and a NY session filter, with a self-learning Naive Bayes probability, macro-driver consensus, Fibonacci prediction channel, and a color-coded status panel.


WHAT THIS IS

An intraday execution indicator for the 15-minute chart (defaults tuned for micro gold futures; every symbol and driver is an input, so it adapts to any liquid instrument). It combines a rule-based dual-entry system with a statistical engine that learns from the chart's own history, and compresses everything into one vertical status panel.

THE TWO ENTRY TYPES

SWEEP (liquidity grab): price wicks below the previous 2H low (or above the previous 2H high) but closes back inside, on at least average volume — the classic stop-run reversal. TREND (continuation): price holds beyond both VWAP and the 1H baseline with volume above threshold, in the direction of the candle. Both entries require the 2H and 4H trends to agree (close vs EMA20 plus candle direction on each), and both are restricted to the NY session window (8:20–13:30 ET, configurable) — no signals on thin overnight tape. Entries plot with labeled tags; stop-loss sits beyond the swept level plus an ATR buffer, take-profit at a configurable R multiple, with WIN/EXIT labels marking outcomes.

HOW THE PROBABILITY IS FORMED

The P↑ number is not a fixed formula — it's a Bernoulli Naive Bayes classifier fit by maximum likelihood on a rolling window (default 800 bars ≈ 8 days). Thirteen binary features are tracked: seven from price/volume (2H trend, 4H trend, prior-2H breakout, 1H baseline side, 1H momentum, 1H relative volume, VWAP side) and six cross-asset drivers (defaults for gold: DXY, 10Y nominal yield, 10Y REAL yield, 10Y breakevens, silver, and GVZ — the real-yield and breakeven series are FRED daily data, acting as a slow regime dial). Each bar, the script counts how often each feature historically coincided with the market rising vs falling over the next 8 bars (2 hours); those frequencies are the maximum-likelihood weights. Predictive features earn large log-odds; useless ones converge to zero — the model re-tunes itself continuously with no manual weighting.

THE FIB PREDICTION CHANNEL

The script auto-detects the active swing leg over the last 24 hours, draws the retracements (50%/61.8% emphasized) and extensions, and snaps a two-line channel to the nearest Fib level above and below price. Each wall shows a first-touch probability: the geometric first-passage odds (the nearer wall gets hit first more often) tilted by the model's directional odds — so the percentages respond both to where price sits between the walls and to what the learned model expects.

READING THE PANEL (top to bottom)

BIAS — 2H+4H trend agreement (hover shows session status).
P↑ — learned probability of higher price in 2 hours: green ≥ ~60, red ≤ ~40, gray = coin flip.
MAC — macro consensus, −5 to +5 (hover lists drivers; HI-VOL tag when the vol index is elevated).
SET — current structure: SWP (sweep forming), TRD (trend setup), BRK↑/↓ (2H breakout), IN (inside range).
VOL — relative volume vs 20-bar average; orange when above the entry threshold.
▲ / ▼ — channel walls: probability of touching the upper/lower Fib target first.
SIG — flashes BUY/SELL on the bar a signal fires; "—" otherwise.

KEY PARAMETERS

Risk:reward multiple, ATR stop buffer, RVOL threshold; session window; MLE horizon and training window; Fib swing lookback and channel projection; the six macro symbols (swap the whole set to repurpose for another market); display toggles for Fib levels, labels, and 2H boxes.

HONEST DISCLOSURES

The 2H data request uses lookahead with a 1-bar offset for the completed prior bar's high/low (the standard non-repainting idiom); the live 2H/4H trend states update while those bars form, so panel colors can change intrabar until the higher-timeframe bar closes — signals themselves evaluate on the 15m close. Probabilities are learned from recent history: they lag genuine regime changes by design and mean little on thin volume. The trade labels are illustrative sequential outcomes, not a backtest with slippage and fees. Nothing here is financial advice — forward-test before trusting any threshold.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.