# SIP → Indicators → g8trade Execution Roadmap

**Owner:** Claude (Atlas-tracked) · **Created:** 2026-06-26 ET · **Hub:** `/system/`
**Projects:** `pinepb` (indicators) · `sip` (watchlist) · `exec` (g8trade execution)
**Property/lane:** `alerts-hotkeys-etc` · **Sprints:** 3 (Trigger Engine), 4 (Gr8Trade adapter + forward-test), 5 (Live execution)

> Now that the **SIP composite watchlist** and the **Multi-TF trend stack** are near-complete, this turns the named stocks into *actionable* signals: TradingView indicators that label/alert and write to the DB, then g8trade strategies that backtest → hotkey → automate. All times ET.

---

## 0. What already exists (do not rebuild)

| Asset | Path / URL | State |
|---|---|---|
| **SIP watchlist** | `/sip/watchlist.json` (master_watchlist + composite/catalyst/RRG buckets) | LIVE, rebuilds 04:15 / 06:00 / 07:00 ET; realtime_quotes.json every ~30s |
| **Multi-TF stack** | `mtf_trend.py` → `/system/multi-tf-stack/data/<date>.json` | LIVE, injected on scorecards |
| **J3P indicator** | `trading/indicators/src/indicators/J3P_v2.2_SIP_Webhook.pine` | **v2.2 shipped this turn — webhook emission added** |
| **Webhook receiver** | `…/webhooks/tradingview_smb_indicator_trigger.php?key=<secret>` → `alerts_tradingview.indicator_alerts` | LIVE (FashLate pipeline) |
| **FashLate reference** | `SMB2_Fashionably_Late_Unified.pine` | LIVE — payload/label pattern J3P now mirrors |
| **Hotkey engine** | `trading/dev/hotkey-engine/` (sizing + risk + ConfirmationGate + post-fill watchdog) | V1 **SIM-only**; export contract `setups.today.json` working |
| **Kore backend** | `hotkey-engine/kore_backend.py` | Skeleton, **inert** — refuses production until firm-confirm of Gr8Script/Kore calls |
| **g8trade pine** | `g8trade_5x15_range_measured_move.pine` | Indicator/alerts only, no routing |
| **Backtest engines** | KITE backtest (skill) · Focus-3 engine `/jd/backtest/` (reuses `dale_vwap_state`) | Available |

---

## STAGE 1 — TradingView Indicators (project `pinepb`)

**Goal:** every SIP name carries the 3-play J3P indicator, drawing labels and firing webhook ENTRY/EXIT into `indicator_alerts` (indicator=`J3P`), exactly like FashLate.

1. **[DONE this turn]** J3P **v2.2** — add FashLate-shape `alert()` JSON emission for all 3 plays (VWAP Pull-In, Trend, Backside). Per-play lifecycle state machine: ENTRY on signal → EXIT on stop / target / EOD-flat, tracking high/low-since-entry. Wire format `J3P_EVT|{…}`, `event_type` ∈ {ENTRY,EXIT}, fields mapped to existing columns + J3P extras (setup_grade, pullin_tier, target_1/2, vwap bands) preserved in `raw_payload`.
2. **Live smoke test** — on ONE SIP name, set a TradingView alert on *"Any alert() function call"* with webhook → `tradingview_smb_indicator_trigger.php?key=<shared_secret>`; confirm a row lands in `alerts_tradingview.indicator_alerts` with `indicator='J3P'` and correct entry/exit prices. *(needs James to attach the alert + secret.)*
3. **Label/alert polish** — match FashLate label verbosity (compact toggle), per-play alertcondition templates, grade-tiered alert messages.
4. **Trend play rebuild (v2.3)** — replace the disabled 9-EMA trigger with a Dale VWAP **1st-deviation-band pullback** model (per `TraderDale_VWAP.pine` + VWAP Book: Dale = 1st-dev only, stop = Reaction Point).

## STAGE 2 — SIP Coverage (project `sip`)

**Goal:** the indicator follows the watchlist automatically.

5. **Deploy J3P across `master_watchlist`** — TV layout/watchlist of today's SIP names (CALY, SOXL, LLY, CASY, VMI, BH, AYI, BE, PRAX, FTAI, SQQQ on 2026-06-26), each with the J3P webhook alert armed.
6. **Auto-sync `watchlist.json` → TradingView symbol list** so coverage rotates with the daily SIP rebuild (no manual re-add). The DB `indicator_alerts` table then only carries names with buyers present (SIP gate).

## STAGE 3 — g8trade Backtest (project `exec`, Sprint 4)

**Goal:** validate edge per play/grade BEFORE any hotkey fires — selectivity is the proven edge (Focus-3, Profitability Diagnosis).

7. **Backtest J3P plays** on SIP names using the Focus-3 / KITE engine: P&L by `playbook_type × grade × tier`, win rate, R-multiple, MAE/MFE. Gate: only graded tiers with positive expectancy advance to hotkeys. Reuse `dale_vwap_state`; pull `indicator_alerts` rows once Stage-1 emissions accumulate.

## STAGE 4 — Hotkeys (project `exec`, Sprint 4)

**Goal:** semi-automated execution with a human confirm — never fire-on-keystroke.

8. **Wire `setups.today.json` → hotkey-engine** for J3P-graded entries: GamePlan/J3P emits the day's graded setups; engine sizes by grade (A/B/C/D = 30/20/10/5% of daily stop), runs `RiskBudget.precheck` + `ConfirmationGate`, attaches stop, and the post-fill watchdog flattens any naked fill. Start in **SIM**, then **forward-test** (paper, live data). Einstein speed-key registration via `register_speed_key.ps1`.

## STAGE 5 — Automation (project `exec`, Sprint 5)

**Goal:** fully automated, server-managed execution on validated setups only.

9. **Go live via Kore backend** — firm-confirm Gr8Script/Kore call signatures, flip `kore_backend.py` from inert to active (server-side managed protective stop so a fill is never naked), forward-test → live on the validated J3P tiers from Stage 3. Hard production guards stay until sign-off.

---

## Sequencing & gates

```
SIP watchlist (live) ─┐
Multi-TF stack (live) ─┴─▶ STAGE 1 J3P emits to indicator_alerts ─▶ data accumulates
                                                                      │
                                          STAGE 3 backtest ◀──────────┘ (edge gate)
                                                   │ positive-expectancy tiers only
                                                   ▼
                              STAGE 4 hotkeys (SIM ▶ forward) ─▶ STAGE 5 Kore live (firm-confirm gate)
```

**Hard rules carried in:** selectivity over volume; no naked fills (watchdog/Kore stop); production refused until firm-confirm; every displayed time ET; HUD (acct-v2) is read-only.

## Open items needing James

- The `?key=` **shared_secret** for the J3P webhook alert (or confirm reuse of the FashLate alert_users row).
- Firm-confirm of Gr8Script/Kore call signatures to un-inert `kore_backend.py` (Stage 5).
- Sign-off on which graded tiers are allowed to auto-fire after Stage-3 backtest.
