PROTECTED SOURCE SCRIPT

K-Rib VWAP Crossover — On The Mark Trading

36
K-Rib VWAP Crossover — User Guide
What it is

A fast, rule-based crossover system built on a Kalman-smoothed moving-average ribbon (“K-Rib”).
It plots a Fast line (inner rib) and a Slow line (outer rib). Trades trigger when the Fast crosses the Slow, with optional slope, compression, buffer, and VWAP filters to cut noise. Non-repaint mode is supported.

How signals are built

Kalman + Ribbon

Price is filtered with a 1-D Kalman filter (R = measurement noise, Q = process noise), then optionally smoothed (RMA/EMA).

A rib set turns that baseline into multiple lengths; the script uses s1 (fastest rib) and the outermost rib as Fast/Slow.

Buffered crossover

Long when Fast > Slow + buffer and it was not above by buffer on the prior bar.

Short when Fast < Slow − buffer and it was not below by buffer on the prior bar.

Buffer can be None, % of price, or ATR × multiplier (default).

Filters (optional)

Slope: require the midline slope to agree (up for longs, down for shorts).

Compression gate: only allow signals if the ribbon was tight on the previous bar (true breakout behavior).

Bar-close confirm: waits for the bar to close → non-repaint.

VWAP bias (optional)

Longs only if price is above VWAP (or above upper band if you require bands).

Shorts only if below VWAP (or below lower band).

Alerts fire on final (filtered) long/short signals.

Presets (one-click)

Breakout (Tight / Standard / Loose)
Sets compression & ATR buffer for you. Use Tight for very noisy LTFs, Loose for smoother HTFs/trending markets.

Custom
You control everything (confirm, slope, compression, buffer type/value).

Inputs cheat-sheet

Kalman (R, Q, Smoothing):

Higher R → trust price less → slower/smoother.

Higher Q → allow more state change → faster/snappier.

Ribbon: number of ribs & MA type for the baseline (RMA/EMA). Crossover uses s1 vs outermost.

Crossover:

Confirm on close = non-repaint.

Slope agreement = trend-aligned signals.

Compression = breakout-style filter; threshold is fraction of price.

Buffer = None / % / ATR× (robust across symbols/TFs).

VWAP:

Enable bias, require band breach or not, sigma and length.

Optional plots for VWAP and bands.

Visuals:

Fast/Slow colors change with slope; optional fill; tiny L/S markers on signals.

Quick start (sensible defaults)

5–15m crypto/FX: Preset = Breakout (Standard), ATR len 14, buffer × 0.06, Compression ≤ 0.012, Confirm on close ON, Slope ON, VWAP bias OFF (or ON during sessions).

1H–4H swing: Try Loose preset; you can raise R a bit (smoother) and keep slope ON.

How to trade it (simple)

Breakout-continuation

Take Long when long signal prints; SL under local swing or 0.7–1.0× ATR; TP at 1.5–2R or trail.

Fade the failed cross (advanced)

If a signal prints against HTF bias and quickly fails back through Slow, fade back into the HTF direction (use at your discretion).

Tip: Combine with HTF bias (e.g., 1H trend UP) and trade LTF signals with that bias.

Repainting note

With Confirm on close = ON, the signal is locked at bar close (no repaint).

Turning it OFF allows early prints that can flip intrabar.

Best practices

Prefer ATR buffer over raw % for instruments with changing volatility.

Tighten compression threshold for scalping; relax for HTFs.

Avoid trading into high-impact news; widen buffers in high-vol regimes.

Disclaimer: Educational use only. Not financial advice. Trade responsibly.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.