OPEN-SOURCE SCRIPT

OTS Confirmation (RSI + Thrust)

367
# OTS Confirmation Panel – Operator Guide

This guide covers `apps/tradingview/pine/panel_ots_confirmation.pine`, the companion
panel for the OTS Trend Suite. It explains how to deploy the script, decode every visual
layer, tune the inputs for different markets, and wire alerts for automated workflows.

Use this doc when onboarding new analysts, preparing TradingView alerts, or logging QA
runs in `docs/qa/`.

---

## 1. Add the Panel to a Chart

1. In TradingView open **Pine Editor**, paste the contents of
`apps/tradingview/pine/panel_ots_confirmation.pine`, and click **Add to chart**.
2. The script renders as a non-overlay panel. Keep the default settings for a full
session to let the auto-calibration warm up.
3. Pair it with `overlay_ots_trend.pine` on the main chart. The panel acts as a momentum
confirmation layer for OTS structure calls.
4. Save your TradingView template so inputs reload automatically.

---

## 2. What the Panel Shows

| Layer | Engine | Interpretation | Typical Use |
| --- | --- | --- | --- |
| **RSI stack** (gray/orange/blue) | RSI(21/14/7) | Gray = slow regime, orange = baseline, blue = fast | Gauge momentum alignment; look for spreads between lines. |
| **RSI crosses** (“RSI↑” / “RSI↓”) | `ta.crossover` / `ta.crossunder` of RSI(14) against fast/slow envelopes | Momentum shifts inside larger structure | Pair with thrust color to time entries/exits. |
| **Divergence dots** (“Div↑” / “Div↓”) | Price vs RSI(14) over `look=20` bars | Early warning for exhaustion | Treat as heads-up; wait for thrust/RSI confirmation. |
| **Thrust columns** | Robust z-score of ATR-normalized price change × volume factor | Colored buckets flag institutional-like pressure | Immediate confirmation of impulsive moves. |

---

## 3. Input Reference

### 3.1 Momentum Stack
- `Source` – price series feeding the RSI trio (default `close`).
- `RSI Fast/Normal/Slow` – lookbacks for the fast (7), baseline (14), and slow (21)
curves. Keep the 3:2:1 ratio unless you have a strong reason to change it.
- `Show simple divergences` – toggles the divergence markers.

### 3.2 Thrust Engine
- `Thrust lookback (z-score)` – rolling window for the robust median/MAD statistics.
Smaller values react faster but can flicker in noisy tape.
- `Price ROC length` – horizon for price change (1 = bar-to-bar impulse).
- `Volume SMA for norm` – smooths volume before computing the relative weight.

### 3.3 Session Gating
- `Use RTH only (09:30–16:00 ET)` – restrict thrust calculations to the defined session.
- `RTH Session (exchange time)` – session string; defaults to U.S. equity hours.
- Under the hood the script uses `time()` to check whether the current bar belongs to the
session. Outside the session the thrust column paints blue and quantile buffers pause.

### 3.4 Auto Buckets
- `Auto thrust buckets (quantiles)` – enables rolling quantile calibration.
- `Auto bucket window` – sample length for quantiles (default 180 bars).
- `Green quantile (auto)` / `Orange quantile (auto)` – percentile thresholds that define
“meaningful” vs “extreme” thrust. Lower green or higher orange to tighten filters.

---

## 4. Thrust Computation Cheat Sheet

1. Compute ATR-normalized price move: `move = change(close, rocLen) / atr(14)`.
2. Scale by the square root of relative volume: `volNorm = volume / sma(volume, volSmaL)`.
3. Multiply: `raw = move * sqrt(volNorm)` to emphasize high-volume impulses.
4. Stabilize with robust statistics: subtract the rolling median and divide by MAD
(scaled by 1.4826 to map to σ).
5. Gate by session. If `Use RTH` is true, values outside the session revert to zero so
alerts do not spam during illiquid after-hours prints.
6. Quantile buckets update only during valid session bars, which prevents thin-tail
expansion on micro-cap tapes.

Color mapping:
- **Orange Up** – `z` exceeds the orange quantile → extreme bullish thrust.
- **Green** – `z` between green and orange thresholds → constructive buying pressure.
- **Blue** – outside session or neutral thrust.
- **Red** – `z` below `-green` → constructive selling pressure.
- **Orange Down** – `z` below `-orange` → extreme bearish thrust.

---

## 5. Playbooks

### 5.1 Trend Continuation (with Overlay)
1. Confirm OTS overlay track is lime (bullish) or red (bearish).
2. Wait for a matching RSI cross (`RSI↑` in longs, `RSI↓` in shorts).
3. Require the thrust column to print Green or Orange in the trade direction.
4. Scale out when thrust fades back to Blue or opposing RSI cross fires.

### 5.2 Reversal Scouts
1. Spot a divergence dot against the prevailing move.
2. Wait for thrust to flip from Orange/Red to Blue/Green plus an RSI cross confirmation.
3. Use tighter stops; reversals are lower probability unless the overlay also signals a
pivot (e.g., `B✓`/`T✓`).

### 5.3 Session-Aware Scalps
1. Keep `Use RTH` enabled on equities. The panel flags off-session bars as Blue so you
can ignore outliers.
2. For 24/7 assets (crypto, some FX), disable the gate or edit the session string to
match your synthetic “prime hours”.
3. If thrust never leaves Blue during valid hours, reduce `Auto bucket window` or lower
the quantile thresholds slightly.

---

## 6. Alerts

The script pre-registers four alerts so TradingView never drops them:

- **Thrust ORANGE Up** – extreme bullish thrust.
- **Thrust ORANGE Down** – extreme bearish thrust.
- **RSI Bullish Momentum** – `RSI(14)` crosses above both fast and slow anchors.
- **RSI Bearish Momentum** – `RSI(14)` crosses under both anchors.

To deploy: right-click the chart → **Add alert…** → choose this indicator and the alert
name → set message/routing. The panel exposes `Use RTH` as a guard, so alerts only fire
within session when the toggle is on.

---

## 7. Tuning & Troubleshooting

| Symptom | Likely Cause | Remedy |
| --- | --- | --- |
| Thrust columns stay blue all day | Session window excludes the instrument or auto buckets are too strict | Adjust session string or lower `Green/Orange quantile`. |
| Orange prints constantly | `Auto bucket window` too small or the asset is very volatile | Increase window or raise quantiles. |
| Divergence markers feel noisy | 20-bar lookback too tight | Increase the `look` constant in code or disable the toggle for automation. |
| Alerts firing after the bell | `Use RTH` disabled | Enable the toggle or update session hours. |

---

## 8. QA Checklist Before Publishing

1. **Warm-up pass** – load at least 200–250 bars so auto buckets stabilize.
2. **Session sanity** – confirm blue columns outside the chosen session, green/orange
inside when impulsive moves occur.
3. **Overlay sync** – run alongside the OTS overlay and capture screenshots where thrust
confirms `AVWM` entries or `T/B` confirms.
4. **Alert audit** – manually trigger each alert in replay mode and ensure they remain in
TradingView’s alert dropdown.
5. **QA notes** – log findings, symbol/timeframe coverage, and screenshots in
`docs/qa/<date>-ots-confirmation.md`.

---

Keep this panel as a confirmation filter rather than a standalone signal generator.
Primary decisions should respect structure from the overlay; use thrust and RSI timing to
validate momentum before committing risk.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.