Conviction Window | Bayesian Regime Pullback Strategy by blitz_algo

By blitz_algo

Performance Metrics

Description

Conviction Window is a trend-pullback strategy built around one question: how confident are we about the current market regime, and is this a good moment to act on it?A Bayesian filter turns volatility-adjusted returns into a running probability that the market is in a bull or bear regime. The strategy only looks for entries when that probability is high. Several independent gates must then agree, and a pullback to a value line must resolve with a decisive close. Position size grows with conviction. Every trade also has a time budget to reach breakeven, and a trade that stalls is closed.How it worksBelief: Each bar updates the probability of a bull or bear regime. A regime starts at 75% and lasts until conviction falls below 55%, so it doesn't flicker.Gates: Four checks run in the background, and 3 of 4 must pass.HTF: the higher-timeframe trend agrees. Always required.ADX: trend strength is above the minimum.MOM: RSI is on the right side of 50.STR: the last market-structure break points the same way.Setup: Price must touch the 21 EMA value line within the last 5 bars without exceeding the maximum depth. A bar then has to close back on the trend side and beyond the prior bar's high or low.Risk: The stop goes beyond the pullback extreme plus a small ATR buffer. Entries that need a stop wider than 2.5 ATR are skipped.Exit:Target: 3R.Breakeven and trail: at 1R the stop moves to entry and then trails 2.5 ATR behind price.Time window: if breakeven isn't reached within the time budget, the trade is closed.Regime reversal: a reversal also closes the trade.FeaturesRegime probability with entry and exit thresholds (hysteresis)Four-gate score with a required higher-timeframe gateOne-entry-per-pullback logic, with a cooldown and a cap on trades per regimeTime window that scales with the square of the target distance in ATRRisk sizing as a percentage of equity, boosted by conviction, with a no-leverage capConviction glow, conviction-shaded candles, and trade boxes showing the window, stop and targetPanel showing belief meter, gate status, setup state, time remaining and a live record (win rate, breakeven rate, timeouts, average R)Alerts on entries via alert()Higher-timeframe data uses only closed bars, so history matches live behaviorTipsStart on 15m to 1H with the default 4H higher timeframe. Keep the higher timeframe at least 4× the chart timeframe. On a chart at or above it, the HTF gate can never pass, so the panel shows ⚠.Too many trades: set "Gates required" to 4, set "Max trades per regime" to 1, or raise the minimum ADX.Too few trades: lower "Gates required" to 2, or lower the regime start threshold.Time window: turn it off and compare results. Timeouts are shown in the panel.Risk: the default is aggressive. Many traders would use 0.5–1.5% base risk.Direction: use "Long only" on instruments with a structural upward bias.Tuning: adjust on one period and check on another, and use several symbols.WarningsThis is not financial advice, and past results don't predict future ones.Default risk is 2.5% of equity per trade, rising up to about 3.75% at high conviction. A losing streak can cause a deep drawdown.Backtest realism: fills happen at the next bar's open, with 0.05% commission and 2 ticks of slippage preset. Match these to your broker, since real costs can differ a lot, especially on lower timeframes.Gaps and fast markets: stops can fill worse than planned.Overfitting: a strong result on one symbol and period doesn't mean the settings work elsewhere.The Bayesian filter is a simplified model. It treats each return as independent evidence and doesn't model every market feature.Strategy Tester alerts and live behavior can differ. Test on a paper account first.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView