# Changelog — Avatara Nakshatra

All notable changes to the Nakshatra desktop app. Newest first.

---

## v1.14.15 — 2026-11-27

**⬤ VB — volume/delta spike signal added to the charts (index + stock)**

- New **VB** layer (toggle, on by default): **volume/delta spike bubbles** — a bar with big volume (≥2× its 20-bar average) + strong one-sided delta (|delta|/vol ≥ 0.45) + a close that confirms the delta → an aggressive push / continuation. Plotted as circles (green = buy push below the bar, red = sell push above), **bigger circle = bigger spike** (≥4×). Works on index futures and stocks.
- The chart's signal toggles are now **Bias · VR · CE/PE · VB⬤** (the old "VB" = cross+bias chip is renamed **Bias** to free the VB name for the spike, matching the Stock Direction Pine where VB = the spike bubble and V/VR = the VWAP retest).
- Context, not a backtested edge.

## v1.14.14 — 2026-11-27

**📟 Stock Direction panel now complete — FII/DII + breadth + mood + VIX + the stock's own option PCR/walls/Max Pain**

- The 👁 Watch **Stock Direction panel** now folds the full Stock-Direction-Pine score: on top of RS + index tailwind, it adds **market-wide FII/DII, breadth % and Market Mood** (same sources the Horizon brief uses — participant-OI cash + market pulse), **India VIX**, and **the stock's own nearest-expiry option PCR, CE/PE walls and Max Pain** (new `GET /sectors/stock-options`). Category = RS + index + FII/DII + breadth + stock PCR.
- The stock's **CE wall / PE wall / Max Pain now draw as level lines on its chart** too (alongside the CE/PE markers).
- Backend: `option_chain.fetch_chain` now resolves spot for any NSE stock (not just NIFTY/BankNIFTY), so stock option chains work.
- Still **context, not a backtested edge**.

## v1.14.13 — 2026-11-27

**📟 Stock Direction Panel + CE/PE markers on STOCK charts (RS vs index) — port of the Stock Direction Pine**

- In 👁 Watch, selecting any **stock** row (sector / OI / screener lane) now docks a **📟 Stock Direction panel** and plots **VB / VR / CE·PE** arrow markers on its chart. The mode selector + 📟 toggle now show for every row, not just index futures.
- **The stock edge = Relative Strength** (stock% − benchmark%) **+ index tailwind** — the panel's Category. Benchmark auto-picks **BANKNIFTY** for bank/financial names, else **NIFTY**. Leaders long in an up market, laggards short in a down one. Panel shows RS, index %, Category, Direction, VWAP/PDH/PDL/CPR (from the stock's own candles), live order-flow (tick-rule) and the three live signals.
- Index futures keep the live dashboard Category + the index 📟 panel (Category/PCR/CE-PE walls/Max Pain are index data, N/A per stock).
- **Deferred (Pine has them optional):** market-wide FII/DII + breadth, and the stock's own option PCR/CE-PE walls/Max Pain. **Still context, not a backtested edge** (RS intraday unvalidated here).

## v1.14.12 — 2026-11-27

**📈 All three CE/PE signal layers on the chart at once · tick-live panel · Avatara Analysis off by default in Watch**

- **All three trigger modes now plot together on the chart** (toggle each on/off), each tagged so you can tell them apart: **VB** = VWAP cross + bias, **VR** = VWAP cross + retest, **CE/PE** = direction change. Arrow up = CE (green), down = PE (red). All three on by default.
- **The 📟 panel's live signals are now tick-live** — the forming bar is patched with the live LTP so VB/VR/Dir re-evaluate on every tick, not just the 30s candle refresh. (Order-flow was already per-tick; dashboard context + daily levels update on their own cadence.)
- **In the Watch cockpit, the chart opens with Avatara Analysis OFF** so the index-direction markers read cleanly — toggle it back on any time from the chart's overlay controls.

## v1.14.11 — 2026-11-27

**📈 Index Direction — now drawn ON the chart (CE/PE markers + levels), not just the side panel**

- In 👁 Watch, selecting NIFTY/BankNIFTY FUT now plots directly on the chart: **CE / PE arrow markers** on the signal bars, plus horizontal **level lines** — PDH/PDL, CE wall, PE wall, Max Pain, and CPR (PP/TC/BC). The 📟 side panel's read stays; the chart shows the same signals in context. Markers are intraday-only (5m/15m); levels show on all timeframes.
- **Three CE/PE trigger modes** (a selector above the chart, applies to both chart markers and the panel's live signal — faithful to the Pine): **Cross + Bias** (VWAP cross confirmed by Category), **Cross + Retest** (cross arms; a pullback that touches VWAP and closes back on-side fires — fewer false crosses), and **Direction change** (bias-confirmed direction flips). Still context, not a backtested edge.

## v1.14.10 — 2026-11-27

**📟 Index Direction Panel in the Watch cockpit — live order-flow + CE/PE read (NIFTY / BankNIFTY futures)**

- **When you select NIFTY or BankNIFTY FUT in 👁 Watch, a live Index Direction Panel docks on the right** (📟 toggle). A native port of the TradingView "Index Direction Panel" READ, sourced from `/dashboard`: **Category** (bias) · **Direction** (bias confirmed by VWAP) · multi-TF bias (5m/15m/1H/D) · Regime · ADX · VIX · CPR width/position · and a level table (PDH/PDL · CE/PE wall · VWAP · Max Pain · PCR · ATM · Pivot).
- **Live order-flow (tick-rule delta).** The index futures are now subscribed **full-day** on the live feed, and the panel accumulates a per-tick delta (uptick/downtick rule: ΔV × price direction) through the session — Last Δ, Cum Δ, who's in control — plus the **order-book buy%** (total bid vs ask depth). This is the standard tick-rule proxy, not true bid/ask footprint (Kite retail has no footprint); it is forward-only but builds from the open since the future is subscribed all day. Falls back to a 5m candle-delta proxy before ticks arrive.
- **Live CE/PE signal** (VWAP cross + bias): BUY CE when price crosses above VWAP with a Bullish Category, BUY PE on the mirror — with the dashboard's suggested strike. **Context to time your entry, not a backtested edge** (our research finds no robust intraday directional edge on the index) — the panel says so, the decision stays manual.
- Backend: `GET /sectors/index-futures`; WS tick payload now carries `last_qty` / `buy_qty` / `sell_qty`.

## v1.14.9 — 2026-11-27

**👁 NEW — Watch cockpit (split board: candidates ← → 5m/15m chart) · 📊 OI Buildup rows click to Analyser**

- **NEW top-level tab 👁 Watch — a discretionary cockpit, not a screener/signal.** Left side gathers candidates in four lanes — 📈 **Index futures** (near-month NIFTY + BankNIFTY FUT, volume-bearing so VWAP/order-flow is valid), 🟢🔴 **Sector bull/bear** (strongest/weakest F&O movers), 📊 **OI buildup** (Long/Short buildup stocks), 🎯 **Screener picks** (any preset). Click any row → it loads in a big **5m/15m chart** on the right (reuses the full analyser: dual-Supertrend, 🔱 Avatara Analysis, live tick) so you can eyeball and time a trade. 📌 **Pin** rows to a persistent watchlist; per-lane on/off toggles; lanes auto-refresh every 30s. The board tells you *where to look, not what to trade* — the decision stays manual (a banner says so).
- **📊 OI Buildup rows are now clickable → open the Analyser chart** (dotted-underline symbol), matching the other scanners.

## v1.14.8 — 2026-11-27

**🎯 AOS option trail on the option's own EMA · 🗂️ Screener scan-view as cards · 🌅 Horizon index cards show last-closed move**

- **AOS harness (`aosh`) now trails on the OPTION's own premium EMA9, not the index EMA9.** The position is always long premium (CE/PE both BUYs), so the trend-ride exit now fires when the **option** closes below its own EMA9 — the index EMA lags, so an index-based exit let the option bleed before the signal flipped. Hard SL / breakeven still track index structure; if the option's own candles aren't available it safely falls back to the index EMA. Reversible (`EXIT_EMA_SOURCE`), new exit reason label `oEMA`. Paper engine (OFF by default) — the forward A/B harness validates it.
- **Screener scan view is now a grid of preset cards.** Each preset shows as a card (edge badge + live match count); click a card to open its full result table, with a "← All presets" button to go back — matches the Basket window grid.
- **Expanded Basket panels open by default.** Clicking a Basket card into its full window no longer shows the panel collapsed.
- **🌅 Horizon brief — NIFTY / BankNIFTY cards now read the last closed session (no live quote).** The live quote reports 0.00% change pre-open (last price == prior close while the market is shut) and flickers intraday; the cards now always take spot + change/%chg from the last two completed daily candles, matching the benchmark table.

## v1.14.7 — 2026-11-26

**🪟 Screener → Basket redesigned as a grid of windows · 📊 OI Buildup moved to its own tab**

- **Basket view is now a small-window grid.** Instead of all paper engines stacked vertically, each engine (🏆 Hero Momentum · 🧠 Research Stock · 🎯 NR7 · 🌙 BTST · 🐢 Value+PreMom · 📅 N-Score Positional) shows as a compact card with live status (🟢 ON / ⚪ OFF / ⛔ KILL / AUTO), open count, live P&L and net P&L (auto-refresh 25s). **Click any card to open its full panel**, with a "← All scanners" button to go back.
- **OI Buildup moved out of Basket into its own outer-scanner tab** (Screener → 📊 OI Buildup). It's a context/monitoring scanner, not a trade engine, so it no longer sits among the paper baskets.

## v1.14.6 — 2026-11-26

**🌙 BTST Overnight paper engine (validated) · 📊 OI-buildup context scanner**

- **NEW — BTST Overnight engine (paper, LONG-only, CASH, OFF by default):** EOD (~15:10) scan of the F&O universe for a strong-closing stock (relVol≥1.5 · >SMA20/50 · RSI 60-72 · green · near the day high, small upper wick) → BUY at the close → EXIT at the NEXT OPEN (overnight only). Independently backtested (DataHub 843, 2015→2026): overnight edge PF ~2.1 F&O (66% win, positive every year, cost-robust) — but it decays by next-day close, so the exit is the next open. Plus a **🌙 BTST Overnight** Screener preset to view candidates. In Screener → Basket.
- **NEW — 📊 OI Buildup scanner (context, NOT a signal):** classifies each F&O stock's near-month future by today's price × OI change (Long/Short Buildup · Short Covering · Long Unwinding), ranked by OI change. Monitoring only — OI has no robust predictive edge in our research. In Screener → Basket.

## v1.14.5 — 2026-11-25

**🎯 NR7 / Coil as Screener scan presets · StrongBuy chip removed**

- **NEW Screener presets:** **🎯 NR7 Breakout (F&O)** (narrowest daily range of last 7 → breakout candidates, tightest range/ATR first) and **🎯 NR7 Coil (strict · F&O)** (the high-conviction full stack: trend + ADX + volume dry-up + not-extended + RS≥0 + RSI 50-65). Now viewable right in the Screener scan view (chips), not only the Basket panel.
- **StrongBuy / Breakout chip removed** from the Screener (plain-momentum verdict is weak/extended) — **StrongBuy + Low-PE stays**. (The plain preset is still used by the morning Telegram scan.)

## v1.14.4 — 2026-11-25

**🎯 NR7 Breakout paper engine (raw + Coil modes · future/cash)**

- **NEW — NR7 Breakout engine (paper, LONG-only, OFF by default):** detects NR7 (narrowest daily range of the last 7 days) across the F&O universe at EOD, then enters LONG on the next-day breakout of the NR7 high, ridden with our keep-50%-of-peak trail (1R = NR7 range · arm BE at +0.6R). Vehicle toggle: **stock FUTURE** (near-month, expiry-aware auto-close) or **CASH**. In Screener → Basket.
- **Two modes:** **raw** (proven, high-frequency — backtest F&O daily 2015→2026: 83% win, +ve median, positive every year, liquidity-robust) and **coil** (selective full filter stack — trend + ADX + volume dry-up + not-extended + RS≥0 + RSI 50-65 + 1.5× volume-pace trigger + ATR-capped stop + ranking score; ~2×/trade but low-frequency, forward-validate).
- Backtests are survivorship-light (upper bound) → the engine validates FORWARD. Mirrors to the journal (source_mode `nr7`) + folds into the paper account.

## v1.14.3 — 2026-11-24

**🙏 Respectful honorifics in religious greetings**

- Festival greeting headlines now carry proper honorifics: **Sri Guru Nanak Dev Ji — Gurpurab**, **Bhagwan Mahavir Jayanti**, **Mahatma Gandhi Jayanti**, **Dr. B. R. Ambedkar Jayanti** (Shri Ram Navami already did). Applies to the Telegram greeting caption / text.

## v1.14.2 — 2026-11-24

**🖼 In-app festival greeting-image manager (Help → Holidays)**

- **Manage greeting images in-app:** Help → 🗓 Holidays → **"🖼 Manage"** opens a per-festival list where you pick an image and the app saves it under the correct name automatically — no manual filenames, so the right image always maps to the right festival. Upload / Replace / Remove per festival; green dot shows which are set; "📁 Open folder" still available for power users.
- Image + text always post together (one Telegram post: your card + a short caption); no image → a text greeting.

## v1.14.1 — 2026-11-24

**🪔 Festival greetings on Telegram (text + image) · weekend-festival greeting · expiry-shift alert**

- **NEW — festival greetings:** on an NSE-holiday morning the app now posts a festival greeting to Telegram (instead of the plain "market closed" note). All-years automatic — greetings match by **festival name**, so dates update themselves every year.
- **Greeting images (your own):** drop `<festival>.jpg` (e.g. `diwali.jpg`, `christmas.jpg`) into the greetings folder — **Settings → Telegram → "📁 Open folder"** (auto-created, survives updates). Image present → it's posted with a short caption; no image → a clean text greeting. Server-hosted fallback also supported. Brand-matched card style (dark + gold, Cinzel, AVATARA ▸ Harshiv lockup) — see GREETINGS_CATALOG.md.
- **Weekend festivals too:** a festival that lands on a Saturday/Sunday still gets its greeting (previously only a plain "weekend" note went out).
- **Expiry-shift alert:** when a holiday moves the weekly F&O expiry (e.g. Tuesday → Monday), a one-time heads-up is posted on the shifted-expiry morning.
- **Muhurat Trading:** a special evening greeting for the Diwali muhurat session (date-driven).

## v1.14.0 — 2026-11-23

**🧠 Research Stock Trail engine · analyzer polish · realistic fills · market-hours guards**

- **NEW — Research Stock Trail (paper, long-only):** a forward-validation book that takes Strong-Buy verdict (vStr≥4) F&O names and rides them with the idx-style profit-trail (SL 1×ATR · arm BE at +0.6R · keep-50%-of-peak). **1 share/name** (R-tracked, not capital-weighted), entries **only 15:00–15:30** in-session, regime-gated, ON by default. In Screener → Basket. Backtest (real-tick 1m, FNO 2016→) showed the trail long-only strongly positive and more regime-robust than scale-out — but survivorship-light/cost-free, so it validates **forward**.
- **Index research track → idx-trail ladder:** the per-TF index research paper track now uses the same keep-50%-of-peak trail (replacing the T1/T2 scale-out), and **entries only fire during market hours** (09:15–15:30) — no more after-hours fills on a stale price. Exits always run.
- **idx / mcx — real-tick fills:** both now book entries at the live price when the order is placed, not at the (already-broken) level — removes the fill-overstatement in the paper P&L.
- **Seasonality tab** — clear year-rows / summary split, a distinct Annual column, a new **Yearly-growth** note (positive vs negative years · best · worst · avg), a **+M** column (positive months/year), and a **Year-focus** picker (one year's 12 months at a glance).
- **Verdict tab** — de-cluttered: the pullback and dual-Supertrend badges merged/removed, freshness folded into the Actionable call, Confluence trimmed to the divergence flag, Research line slimmed, Risk tips collapsed. Bearish labels **relabelled** to read as avoid-longs, not a short signal (honesty-check: those names don't actually fall) — logic unchanged, display only.
- **Baskets** — Capital · Deployed · Free line and a **Qty** column across Hero Momentum, Value and Research-stock (N-Score already had both).
- **Dual-Supertrend Signals** — a **🔥 Fresh cross** toggle (default on): show only names that just aligned in the last 2 candles, not long-standing alignments.
- **Telegram** — on a market-closed day (weekend/holiday) only a single "market closed" note goes out, instead of the full stock/zone/EOD set.

## v1.13.11 — 2026-11-10

**🧹 Sector cleanup — ORB engine removed, Sector auto-trade off**
- **ORB (opening-range) engine fully removed** — code, wiring, UI and its 210 paper trades. Audit found a fragile, tail-dependent edge (the whole profit came from ~10 of 210 trades; profit was PE/short-only; one losing month) that the engine's own notes already flagged as unvalidated — plus a doc-vs-code mismatch: it was labelled "paper-only" but had a user-triggerable **live-order** path (the Intraday Radar "Buy"). Deleted end to end (engine, tracker, `/orb-radar` + `/orb-auto` endpoints, kill-switch, radar panel, Auto-Trade/Risk/Performance/Portfolio/Help entries).
- **Sector (FnO) auto-trade turned OFF** — the options-sector auto-entry is theta-bled and break-even; the **Sector-on-Futures** engine expresses the same signal better, so it stays. The **sector scan/opportunity feed is unchanged** and keeps feeding Sector-Fut.
- Also removed dead files (orb backtests, stale backups) and the Dual-Supertrend scanner keeps working (its symbol→sector map was made self-contained).

## v1.13.10 — 2026-11-09

**📊 EOD report — accurate exit labels**
- The End-of-Day report's Exit Breakdown no longer dumps every engine auto-exit into **"Manual"**. Engine exits are now labelled correctly: **⏱ Session/Time** (session-close, 15:00 / 14:00 time exits, expiry), **🔄 Engine exit** (trend-ride and other signal-based exits), and **✋ Manual** (only genuine hand-closes). Earlier a day could show e.g. "Manual 9" when nothing was actually closed by hand.

## v1.13.9 — 2026-11-09

**🎨 App icon restored**
- The installer, the app window/taskbar and the desktop shortcut now show the **Avatara logo** again. The build icon (`build/icon.ico`) had gone missing (it's a build artifact), so electron-builder was silently falling back to the generic Electron atom icon. The icon is now **auto-generated from the logo at every build**, so it can never go missing again.
- Includes everything from v1.13.8 (Telegram master-pref persistence fix) and v1.13.7.

## v1.13.8 — 2026-11-09

**🛠 Telegram master-pref persistence — the real fix**
- **Root cause of "Telegram goes silent after a restart" fixed.** On every app boot the legacy Scalp-sidebar Telegram flag (default OFF) was pushed to the backend, overwriting the master Telegram pref to OFF — which silently killed **all** delivery (good-morning / market-zone / EOD report / expiry / Horizon) until manually re-enabled. That boot-time push is removed; the master + signal prefs are now owned solely by the Alerts UI and the Scalp sidebar toggle (explicit user action, persisted in SQLite) and are never clobbered on start.
- Includes everything from v1.13.7 (Telegram sub-toggle auto-enables master · SEBI-safe Morning Scan watchlist · MCX engine logger fix).

## v1.13.7 — 2026-11-09

**🔧 Telegram reliability + SEBI-safe Morning Scan + MCX fix**
- **Telegram "silent off" trap fixed** — turning ON any sub-toggle (zone / daily / signals / trade) while the master Telegram pref was OFF delivered **nothing** (the master is a hard gate). Now enabling any category auto-enables the master pref, so messages actually go out.
- **Morning Scan is now an educational watchlist, not a buy call** — dropped already-run-up names (6-mo return > 60%, the "chased" stocks), flag the rest as **⚠️ extended**, removed "STRONGBUY" / performance-edge wording, and added a clear **SEBI disclaimer** (not investment advice; Harshiv Symposium LLP is not a registered RA/IA).
- **MCX paper engine fix** — `mcx_engine` was missing a `logger` import, so its worker threw `name 'logger' is not defined` every tick (engine stalled). Import added; engine ticks cleanly again.

## v1.13.6 — 2026-11-07

**📨 Telegram — Horizon auto-send + sharper Morning Scan**
- **Horizon morning brief now auto-sends to Telegram at ~08:50 IST** every trading day — the exact in-app export PDF, with a short "good morning" caption. Runs while the desktop app is open (catch-up on open if 08:50 already passed); once per day; honours the master Telegram pref. Backend also pre-generates the brief from 08:50.
- **Morning Scan (StrongBuy) message redesigned** — ranked list with ₹ price · PE · 6-mo return · sector per name, cleaner CAPS headers and a crisp how-to line.

## v1.13.5 — 2026-11-07

**✨ Nakshatra engine names + professional reports**
- Every engine is renamed to **"‹Nakshatra› · ‹Functional›"** (e.g. ROHINI · VALUE+PREMOM, MAGHA · INDEX PDH/PDL, SURYA · HERO MOMENTUM, MAGNETAR · GAMMA BLAST) across the whole app — Account tiles, Journal, Performance By-Engine, Portfolio filter — keeping the functional name inside for instant recognition.
- **Performance exports (PDF + Excel) and print** now show engine names in **CAPITALS** (was raw lowercase keys like "idxpdhl"), use the proper Nakshatra labels, sort By-Engine best → worst, and have a cleaner professional layout (branded header, LLP line, disclaimer, column widths).

## v1.13.4 — 2026-11-07

**🐞 Performance fixes**
- **Trades tab no longer goes blank** — a row with a null `signal` / `entry_price` (surfaced now that the report defaults to all-time) threw during render. Those fields are now null-guarded.
- **Behavior → "CE vs PE" no longer shows two "PUT (PE)" cards** — the backend buckets trades as CE / PE / OTHER (futures & spreads aren't options), but the UI labelled every non-CE bucket "PUT (PE)". The OTHER bucket is now its own neutral "⚙ OTHER (futures / spreads)" card, so CE, PE and Other are distinct.

## v1.13.3 — 2026-11-06

**🗑️ ST-Align & Credit-Spread FULLY DELETED — code and data (supersedes the v1.13.0 "disable/keep-history" approach)**
- Both engines are **completely removed** — engine/worker/API/store files deleted, dropped from the `paper_pnl` registry, `engines_control`, every account/journal/performance/portfolio surface, and all labels/icons. **No retired badge, no footnote, no dead code.**
- Their **paper trade data was wiped** from the DB (stalign_trades, credit_spread_trades, settings, and the trade_journal mirror rows) on both the live and dev stores, so they no longer appear anywhere and no longer affect the balance.

**📈 Performance Report defaults to ALL-TIME — matches the Account out of the box**
- The report opened on "This Month" while the Account card and By-Engine tab are all-time, so the Summary total looked mismatched. The report now **defaults to ALL**, so Summary = By-Engine = Account on open. Narrowing to This Month / 30D / 90D still works.

## v1.13.2 — 2026-11-06

**🔭 Account tiles — disabled/removed engines no longer shown as active tiles**
- **ST-Align** and **Credit-Spread** (disabled/removed in v1.13.0) are no longer rendered as engine tiles in the Account / Observatory card. They are kept in the **balance** (their realized paper P&L really happened — removing them would overstate the account by ₹72k), shown only as a small dim "Retired" reconciling line. Active tiles + that line reconcile to the balance.

## v1.13.1 — 2026-11-06

**🔭 Observatory / Portfolio engine filter — reflect the real engine set**
- Added **AOS Harness** to the engine-selector dropdown (it had an account tile but was missing from the filter).
- Removed **ST-Align** and **Credit-Spread** from the dropdown (engines disabled/removed in v1.13.0). Their history is unchanged — still included under "All engines" and in the Account tiles.

## v1.13.0 — 2026-11-06

**🧹 Engine & tool cleanup — Backtest retired · Credit-Spread removed · ST-Align disabled**
- **⏪ Backtest (Sector/Scalp) retired.** Header button, `b` hotkey, command-palette entry and the modal are removed (the sims were rough spot-proxy estimates with no real option premia). **The Hedge calendar-spread backtest is unaffected** — it lives in the Hedge view and still runs.
- **🦅 Credit-Spread engine fully removed** (engine + worker + API + UI). It was paper-only forward-survivorship with no backtest and a running paper loss. **History is preserved** — the `credit_spread_trades` table and the Paper Account / Portfolio tiles stay, so balance history is unchanged.
- **🧲 ST-Align engine disabled everywhere** (worker no longer starts; removed from the Index view and the master engine panel). **Code, API, modal and `stalign_trades` data are all kept** — it is dormant, not deleted, and its history still renders.
- **No trade records were deleted.** All `*_trades` tables and journal rows are intact; this release only stops/hides engines and removes one research tool.

**🧾 Journal & Performance — numbers now reconcile**
- **Journal** now labels **every** engine correctly (mcx / idxpdhl / stalign / aosh / sectorfut / credit_spread / …) instead of bucketing all side-engines under "Scalp"; filter chips show only engines with trades in range.
- **Performance → By-Engine** tab now reads the **authoritative all-time per-engine account** (the same `paper_pnl`/store source as the Account card and each engine's own modal), so a given engine's number **matches across its modal, the Account card and the report** by construction. Every engine with activity gets its own section (₹ engines in rupees, index-R research shown as R and kept out of the balance). This tab is all-time (not affected by the date range; the other tabs stay windowed).
- Audit + reconciliation in `JOURNAL_PERFORMANCE_AUDIT.md`.

## v1.12.5 — 2026-11-05

**🧠 Nakshatra Research — data-integrity & freshness**
- **Stale research is now flagged, not silently shown.** A research report built from an older session shows a clear "Stale research" banner and its price is **no longer combined with the live price** — the engine's own snapshot values are shown instead (prevents a stale verdict looking current). Missing/unverifiable freshness is treated as not-current too.
- **Tier-1 fail-safe:** the deterministic scorer now refuses stale / invalid / missing-timestamp data → **NO_TRADE** (fails closed). This gate runs first and the LLM narrative cannot override it.
- **Per-timeframe "Last" now shows the completed candle close** for each timeframe (weekly/daily/1h/15m), not the single live tick repeated across all rows.
- **Options PCR is now context-only** — it's shown as an informational note and no longer independently raises the stance's confidence.
- Research snapshots carry identity + freshness metadata (`snapshot_id`, `generated_at`, `market_data_asof`, `data_status`); older research outputs are archived before overwrite.

## v1.12.4 — 2026-11-05

**🗑 Per-engine Reset**
- Each paper engine now has a Reset button (Auto-Trade panel → expand engines → 🗑) that clears ALL of that engine's trades — its own store and its journal rows — after a confirm. Use it to start an engine fresh.

**🧹 Account cleanup**
- Flow and Confluence are fully retired and removed from the Account P&L (their trades were cleared). ST-Align trades reset.

**ℹ️ Help / About**
- Version/build refreshed to Nov 2026 and a "What's new" summary added covering the recent releases.

---

## v1.12.3 — 2026-11-04

**📲 Telegram — per-client setup (in-app)**
- Each user now enters their OWN bot token + group/chat id in the app (✈️ Telegram section), stored only on that PC — nothing is bundled in the installer. Includes a @BotFather how-to and a "Send test". Fixes the packaged app showing "not configured".

**🖨 Horizon PDF — per-page top/bottom spacing**
- Pages 2+ no longer start flush against the top edge; every page now has proper top/bottom breathing room while the dark still bleeds to the side edges (no white side border). Hit ↻ Refresh in Horizon once after updating.

---

## v1.12.2 — 2026-11-04

**📝 Paper-engine Telegram signals**
- The 5 signal-capable paper engines (Index PDH/PDL · MCX · AOS Futures · Sector-Fut · AOS Harness) now send a 📝 PAPER entry heads-up to your group — entry/SL/level + an honest per-engine advice line + "⚡ Awareness before Action". It is an awareness nudge, not an order. Toggle each in ✈️ Telegram → "Paper engine signals" (all default ON; AOS Harness fires on 1m+5m only).

**📊 Morning breakout scan → group @ 09:30**
- A positional STOCK/FUTURE screen each trading morning: ⚡ StrongBuy / Breakout + its cheap low-PE half (historically ~2× the forward excess). Days–weeks, not intraday.

**🛡 Sector-Fut + MCX — expiry-aware auto-close**
- Neither engine closed before monthly expiry, so a future could strand on a dead/rolled contract (the root of the manual month-end closes). Each now records its contract expiry and force-closes on the expiry day. Open positions are covered too.

**🖨 Horizon PDF — no white border, no squeeze**
- The exported PDF now fills edge-to-edge (no white side border) and the text has proper inner margins (no more cut-to-cut cramping).

---

## v1.12.1 — 2026-11-04

**📊 Reporting — one source of truth (Observatory P&L fix)**
- Account P&L, Portfolio / Trader-DNA and the Performance report now read the SAME store-sourced data, so for any duration every surface shows identical per-engine + total numbers (they used to disagree — the Account read each engine's own store while the others read incomplete/wrong-scaled journal mirrors).
- The paper balance now folds **every ₹ engine** (adds Gamma / Credit-Spread / Scalp-Harness / Value-Basket + retired Flow/Engine); Account tiles are data-driven and always sum to the balance. AOS Harness is shown separately where it is R-only.

**🎯 AOS Harness — real option ₹ (not index-R)**
- It trades the ATM option, so P&L is now the real option premium (₹) — entry/exit premium captured live, folds into the account. Open positions show live premium + unrealized ₹; closed trades show premium in/out + ₹ P&L. Index R kept alongside for A/B. Entry stays closed-bar.

**🛡 IDX + MCX — stop the giveback (fixed SL + BE + keep-50% trail)**
- A winner that spiked and bled back to breakeven/0 is fixed. IDX: fixed ₹5k/lot initial stop + breakeven at ₹3k + a trail that locks 50% of the peak (backtested NIFTY+BANK 5-min, 942 trades: ₹12.36L / 73% win vs the old ₹11.7L / 26%, and ~3× fewer big losses). MCX: same keep-50% trail, armed at the earlier of 1R and ₹3k/lot (its first-ever breakeven/trail). Presets in the Index view.

**🌅 Horizon — PDF layout + consistent breadth**
- PDF no longer breaks a card mid-page. The "Market breadth" (advance/decline) and the "Trend · % > 200-DMA" tile now use the SAME 116 F&O stocks, so the two readings are complementary (short-term vs long-term) instead of looking contradictory; the live dashboard A/D now matches Horizon's method.

**✈️ Telegram — redrafted messages**
- All scheduled messages rewritten with an "⚡ Awareness before Action" footer; the misleading "score" dropped from zone/expiry reminders (kept only on real Scalp/Sector signals); Scalp signals to the phone gated to the best (85+) setups.

---

## v1.12.0 — 2026-11-03

**🔒 LIVE — mandatory authenticator (TOTP) gate**
- Going LIVE now **requires** 2FA to be enabled AND a valid current authenticator code — there is no un-authenticated path to live. This is the single global authority every engine reads. Enable it in 🛡 Risk → LIVE Gate · 2FA (scan QR → enter code). Switching back to Paper is always free.

**🧹 Engine cleanup (from live trade-analysis review)**
- **Premium-Pop** and **Flow** engines fully removed (no backtested edge; theta bleed) — no dead code left behind.
- **ST-Align** paused (ATM-option intraday: theta + dual-Supertrend-on-options has no edge). Open positions still exit; can be re-armed.

**🕹️ Auto-Trade panel — two new control groups**
- **🧪 Paper Engines** — one master switch to arm/disarm all paper research engines at once (each engine's own tab toggle still works).
- **✈️ Telegram** — master + per-category toggles: entry signals · trade updates (T1/T2/SL) · market zones · daily (good-morning/EOD/expiry). Critical broker/feed safety alerts always go through.

**🌅 Horizon — Refresh · PDF · Telegram**
- ↻ **Refresh** force-rebuilds the brief with the latest last-completed-session data (no waiting for the daily cache).
- ⬇ **PDF** saves the brief; ✈ **Telegram** sends the brief PDF straight to your group.

**📈 idx engine — cost-to-cost breakeven**
- Once an open index trade clears **₹5k/lot**, the stop pulls to cost-to-cost so a winner can't give the whole move back to the (unreachable) opposite-range stop. Backtested: NIFTY 2021→May-2026 net +26%, win 55%→57%, beats baseline 5 of 6 years. Configurable via `/idx/config`.

**🎯 AOS Harness — new paper engine**
- The chart-AOS signal shadow-traded on NIFTY/BankNIFTY across all four timeframes (1m/3m/5m/15m) in parallel, on paper. Per-TF forward A/B via the 🎯 AOS modal.

---

## v1.11.1 — 2026-11-03

**📈 idx engine — cost-to-cost breakeven (NIFTY/BankNIFTY PDH/PDL, paper)**
- Once an open index trade clears **₹5k/lot** profit, the stop pulls to cost-to-cost (entry ± round-trip cost) so a winner can't give the whole move back to the (unreachable) opposite-range stop and close red. Arms once, never loosens; exit tagged `breakeven`. Configurable via `/idx/config?be_trigger_rs=` (0 disables).
- Backtested — NIFTY 2021→May-2026 (867 trades, exact live rule): net **+26%**, win 55.2%→57.2%, t 3.17→4.59, beats baseline 5 of 6 years.

**🎯 AOS Harness — new paper engine (Option Scalp)**
- The chart-AOS signal shadow-traded on the NIFTY/BankNIFTY index across all four timeframes (1m/3m/5m/15m) in parallel, on paper. Per-TF forward A/B via the new 🎯 AOS modal. BE at 1:1, SL = prev candle, EMA9/SL/BE/15:00 exits.

**🌅 Horizon — fresher breadth & movers**
- Breadth + top movers now computed from Kite historical (last completed session) instead of the warehouse, so they can't trail a day. Horizon brief cache is invalidated after each candle-sync so a morning top-up is reflected immediately.

---

## v1.11.0 — 2026-11-02

**Horizon — last-closed, stable snapshot**
- Breadth merged into ONE section (116 sector-index stocks, warehouse-based, prior session) — works pre-login.
- Benchmarks + Sector Rotation now read the LAST COMPLETED daily session (stable PDH/PDL, no intraday flicker).

**🔱 Avatara Analysis — new stock-chart overlay (StockChartModal)**
- Full TS port of the "AVATARA Stock & Index Analysis" Pine: Order Blocks, FVG/IFVG, LuxAlgo liquidity sweeps (SSL/BSL lines + zones), 9-TF MTF liquidity + confluence zones, PD/PW/PM levels, 52W band, killzone sessions, nearest/target POI, dual Supertrend, and the AVATARA info panel.
- Border-less zones, decluttered on lower TFs, everything extends only to the live candle. Collapsible popup panel. Bigger chart + Analyzer windows.

**🎯 AOS 15m — new index-chart overlay + paper tracker (Option Scalp)**
- 6-factor CE/PE score + CHoCH + real-daily HTF bias + EMA9 trend-ride, on the NIFTY/BankNIFTY index pane (any TF; best 15m). Honest framing (futures-validated; options theta differs).
- Live paper position: CE-above-EMA entry filter, SL = prev candle low/high, breakeven at 1:1, trend-ride/SL/BE/15:00 exit — shown as a banner + panel (paper, index-R).

**Option Scalp reliability** — carried from 1.10.x audit fixes.

---

## v1.10.0 — 2026-10-31

**Horizon (Morning Brief) — full redesign**
- New Market Mood Index hero (composite Fear/Greed sentiment) + component tiles at the top; SEBI-safe (market data only, no advice/signal).
- Reordered for a trader's morning read: Mood → Flows & Positioning → Market Breadth → Sector Rotation → Sector Constituents → India.
- Market Breadth on the full ~843-stock Avatara universe (labelled); Sector Rotation shows all 9 sectors with a labelled trend score.
- New **Sector Constituents** block (116 sector-index stocks: live A/D + top gainers/losers).
- Indian benchmarks as a table with PDH/PDL (SENSEX · NIFTY · BankNifty · FinNifty · Midcap · BANKEX · GIFT).
- MCX commodities section (Indian ₹ futures, last-session change + PDH/PDL); CPR folded into each index card; brand heading in the Avatara font (Cinzel).
- Added expiry flag, Participant OI bias, and per-index CPR. Removed trade-signal surfaces from the brief (it's a brief, not a signal generator).

**Dashboard**
- Colourful MCX Market-Galaxy cards (parity with the index cards) + colored multi-TF strip.

**Option Scalp — reliability (P0/P1 audit fixes)**
- Fixed the T2 line (was 2.0R) to the actual 2.5R via the centralized helper, across Cockpit + Analysis modal.
- Removed the misleading "Systematic Execution" live auto-order controls (auto-scalp is retired); the toggle now only gates HIGH-signal Telegram alerts.
- Added Kill controls to Credit-Spread + Scalp-Harness (with a visible "blocks new entries; open positions still exit" note); MCX variants aligned to pdhl+eve; chart-preview TF-switch white-screen guard.

**Platform**
- Candle-sync morning top-up (warehouse no longer trails a session); screener scan cache + prewarm; participant-OI cash change; Telegram delivery.

---

## v1.9.9 — 2026-10-28  ·  Participant OI popup — bigger, fits one screen (PATCH)

UI-only: the 🧭 Participant OI Bias popup is now wider (`max-w-1360px`, `h-94vh`) and laid out to fit
on one screen without scrolling — compact one-line context note, and the participant table split into
two side-by-side halves (FII/Pro | Client/DII) under the NIFTY/BANKNIFTY verdict cards.
FILES: components/ParticipantOIModal.tsx. No backend change.

---

## v1.9.8 — 2026-10-28  ·  Participant OI — composite verdict/plan cards (MINOR)

Adds the **analysis view** to the 🧭 Participant OI Bias panel (the piece the raw table in v1.9.7
was missing): per-index **NIFTY / BANKNIFTY verdict cards** — headline bias, score /100 with a
bear↔bull gauge, top-3 weighted drivers, caution flags and a Hinglish Plan line.

- **Composite score** ports the user's scoring model: labels → ±3/±2/±1/0, weighted
  (FII-fut×3; FII/Pro-opt & FII-cash×2; Pro-fut×1; **Client inverted/contra**; DII-cash×1) → /42×100;
  BankNifty = NIFTY×1.15 + FII-stock-fut tilt. Verdict/confidence/drivers/cautions/plan match the model.
- **FII/DII cash** now auto-fetched from NSE `fiidiiTradeReact` (₹ Cr net; verified vs screenshot:
  27-Oct FII +4240 Cr, DII −1250 Cr) and folded into the score + shown as rows.
- **Honesty kept front-and-centre:** bias labels are our own net-OI (level-based) derivation and may
  differ from Sensibull's buildup/change-based reads; bank-sector tilt isn't auto-sourced (neutral);
  and the whole thing stays **CONTEXT ONLY — overlay on price, backtest showed no next-day edge.**

FILES: services/participant_oi.py · lib/api.ts · components/ParticipantOIModal.tsx
RISK: low (read-only, additive). ROLLBACK: revert the three files.

DATA TIMING: NSE FII/DII cash ~6-6:30 PM IST, participant OI ~7-7:30 PM IST; before that the panel
shows the prior trading day (the correct input for the current day's lean). ↻ Refresh pulls new data.

---

## v1.9.7 — 2026-10-28  ·  Participant OI Bias panel — CONTEXT ONLY (MINOR)

**New Dashboard panel: 🧭 Participant OI Bias** (FII / Pro / Client / DII positioning, Sensibull-style).
Opens from the Dashboard header.

- **Source = NSE free EOD file** `fao_participant_oi` (fetched directly, **not from Kite** — Kite has
  no participant breakdown). Shows the latest available day + day-over-day change per
  participant × segment (Index Futures, Stock Futures, Index Options, Stock Options), with a
  two-sided Bearish·Bullish bias bar, Net OI and Change. Numbers verified against Sensibull exactly
  (e.g. 27-Oct FII Index-Fut net −2.21L / +56,048).
- Backend caches ~3h and persists last-good to disk (shows ⚠ last-good if NSE is unreachable).
- **Explicitly CONTEXT ONLY, not a trading signal.** An honest backtest (2019-2026, 1917 days,
  TRAIN→OOS) found no robust next-day direction edge — tiny effect, mostly in the overnight gap,
  and it reverses out-of-sample (non-stationary). So it drives NO engine/gate; a prominent banner
  says so. It only shows who is positioned how.

FILES: services/participant_oi.py · api/v1/participant_oi.py (+ router reg) · lib/api.ts ·
components/ParticipantOIModal.tsx · components/DashboardView.tsx
RISK: low (read-only, external EOD fetch, no engine wiring). ROLLBACK: remove the router line + files.

---

## v1.9.6 — 2026-10-28  ·  Research Paper Trades: entry/exit time + margin + Reset (MINOR)

**The Research Paper Trades panel — the one track missed in v1.9.5 — now matches the rest.**
It already auto-runs the research engine's per-TF forward paper ladder; it just didn't show
entry/exit time, margin, or a Reset.

- **Opened / In / Out datetime** — open trades show when they opened; recent closes show both
  entry time and exit time (parsed from the UTC ledger, rendered in IST).
- **Margin~** — this harness sizes by RISK (1R = ₹10,000, stop 1×ATR), not by capital, so margin
  is the balance a futures-equivalent position of the same risk would block:
  `notional × ~12%` where `notional = risk × entry / ATR`. Shown on open + closed rows; labeled
  approximate.
- **Reset** — `POST /research/paper/reset` + a confirm-guarded 🗑 Reset button clears all open +
  closed research paper trades & P&L (the Auto setting is kept).
- Backward-compatible: the JSONL ledger simply gains `entry_ts` / `margin` keys on new closes;
  legacy rows show `—` for those two fields.

FILES: services/research_paper_trader.py · api/v1/research.py · lib/api.ts ·
components/scalp/NakshatraResearchPaperModal.tsx
RISK: low (paper-only, additive, no schema migration). ROLLBACK: revert the four files + rebuild.

---

## v1.9.5 — 2026-10-28  ·  Per-engine Reset + Entry/Exit time + Margin everywhere (MINOR)

**Every paper engine/basket now shows entry time, exit time, and the ₹ margin/balance each
trade ties up — and has its own 🗑 Reset button.** Added across Premium-Pop, Credit-Spread,
Scalp-Harness, Short-Vol, Gamma-Blast (the five research engines) and the N-Score, Value+Pre-
Momentum and Hero-Momentum baskets.

- **Margin/balance** (computed at the store layer, so it shows on open + closed rows everywhere):
  long single-leg options (pop / gamma / harness) = premium debit (entry × lot_size × qty);
  credit-spread = defined risk (max_loss × lot_size × lots); short-vol = SPAN+exposure APPROX
  (strike × lot_size × lots × 0.11); positional baskets already show deployed ₹ capital.
- **Entry/Exit datetime** columns added to each panel (data existed; now rendered).
- **Reset**: each engine gets `POST /<engine>/reset` + a confirm-guarded 🗑 Reset button that
  clears ALL that engine's paper trades & P&L (engine settings/capital are preserved). Backs
  nothing else — one engine's reset never touches another's table.
- **Fix:** Scalp-Harness `ts_exit` was written in UTC (`datetime('now')`) while `ts_entry` is
  IST, so closes showed ~5.5h BEFORE their entry — now `datetime('now','localtime')`.

FILES: pop_store / gamma_blast_store / scalp_harness_store / shortvol_store / credit_spread_store /
heromomo_store / value_basket_store / nscore_positional (+ reset, margin, ts fix); api v1 pop /
credit_spread / scalp_harness / shortvol / gamma_blast / heromomo / value_basket / screener
(+ /reset); frontend api.ts + the 8 panels. Paper only.

## v1.9.4 — 2026-10-27  ·  FIX: paper engines strand positions after a cached-token respawn (PATCH)

**Open paper positions no longer strand unmanaged after an auto-respawn.** The 12 paper-engine
pollers (idx, mcx, oibias, aosfut, gamma_blast, pop, shortvol, credit_spread, scalp_harness,
portfolio_risk, heromomo, value_basket) were started ONLY from the post-auth hook (auth.py), which
runs on a fresh `/auth/exchange` UI login. The auto-respawn watchdog brings the backend back by
hydrating the CACHED token (no login), so after a mid-session respawn the new process ran `main.py`
startup (hub, trackers, liveness…) but NOT these workers — any open paper position then stranded
with no one to close it (its 15:30 session-exit never fired). Seen live 2026-10-27: an 11:57
respawn left the idx BANKNIFTY #14 long open past 15:30 until a manual tick closed it. Fix: start
the 12 pollers in `main.py`'s authenticated-startup block too (same rationale and pattern as
`momentum_observer`); `start()` is idempotent and `tick()` self-gates (exits always run, entries
stay gated by each engine's enable/kill), so a cached-token boot is safe. FILE: main.py.

**Also (gamma_blast diagnostics):** the Gamma-Blast worker now logs its entry-window skip reason
once per day (`not a NIFTY expiry day` / `|mom| X% < 0.1%` / `no momentum data` / `no ATM leg`), so
a "why no trade today?" is answerable from the log without a forensic replay. FILE:
gamma_blast_worker.py. Paper, no behaviour change.

## v1.9.3 — 2026-10-27  ·  HOTFIX: Credit-Spread engine 'flavor' KeyError (PATCH)

**Credit-Spread engine was broken since inception.** `enter()`'s `open_spread()` payload left out
the `flavor` field, which the store requires (`t["flavor"]`) → `KeyError: 'flavor'` on every tick
whenever a spread was buildable (spamming `credit_spread_worker tick error: 'flavor'` in the logs),
so the engine had NEVER actually opened a spread (0 rows, no forward-survivorship data). Fixed by
adding `"flavor": fl` to the payload. Verified: open_spread accepts the payload, no KeyError. Paper,
still gated OFF by default (IV-gate must be ON to fire). FILE: credit_spread_engine.py.

## v1.9.2 — 2026-10-26  ·  N-Score basket drawdown control (A regime-gate + B crash-stop) (PATCH)

**N-Score positional basket — stop the bleed.** The basket held losers to time-exit with no
stop, so in the cold Sept-Oct 2026 momentum regime they ran to −18% (backtest tail −83%); the
Sept-entered batch averaged −7%. Verified fix (scratchpad nscore_ab_verify, 110k signals, 20-bar):
**(A) regime gate** — `enter()` skips new entries when NIFTY < its 200-SMA (reuses heromomo
`_regime_on`, fail-OPEN); backtest avg +1.84→+2.02%, 2026 +2.3→+3.3% (skips weak-regime batches).
**(B) −12% catastrophic stop** — new `crash_stop()` runs every tick and closes any OPEN position
down ≥12% from entry; backtest worst −83% → −12% for only ~0.2-0.4%/trade of average. A+B together:
avg +1.61% (keeps ~87% of the base edge), worst −12%, 2026 +3.2%. Existing open positions get the
−12% cap on the next cycle. (2025 stays ~−1.3% in every variant — the edge is regime-dependent; this
is damage control, not a new edge.) FILES: nscore_positional.py. Paper.

## v1.9.1 — 2026-10-26  ·  Sector-Fut control panel (PATCH)

**Sector-on-Futures UI.** The `sectorfut` engine (shipped in 1.9.0) now has a dedicated panel,
opened from the **🔵 Sector-Fut** button in the Sector tab header: Auto/Kill toggles, net paper
P&L, the **R:R** (the whole point — vs the options-sector's 1.18), win%, avg-win/avg-loss, and
open + recent-closes tables. Frontend-only (backend unchanged from 1.9.0). Paper, OFF by default.

## v1.9.0 — 2026-10-23  ·  NEW Sector-on-Futures paper engine (MINOR)

**New paper engine — Sector-on-Futures (`sectorfut`).** The sector-rotation signal (the same
fno_engine opportunities the Sector tab produces — BUY_CE/BUY_PE on a stock) expressed on the
stock's FRONT FUTURE instead of a bought option. Motivation: the live options-sector trades
bled theta — small capped wins, full-SL big losses (R:R 1.18, net carried by one outlier); a
faithful backtest of the same setup as STOCK gives a symmetric R:R ~1.4 (no theta). This engine:
BUY_CE → long future, BUY_PE → short future; ladder on the underlying — SL 1.5% / T1 1.5%→breakeven
/ T2 3% (2R) + a 0.6R giveback trail; HIGH-confidence + score≥7, max 5/day; liveness + account-risk
gated. Runs in PARALLEL with the existing options-sector engine for a live A/B. source_mode
'sectorfut', paper, OFF by default — forward-validate before any live capital. Appears in the
Journal / Performance / Account (Sector-Fut tile); dedicated control panel to follow.

## v1.8.9 — 2026-10-23  ·  HOTFIX: timezone crash in Index/MCX frames (PATCH)

**Critical hotfix.** v1.8.8's closed-bar entry fix added `b["date"] + timedelta <= now`, where the
Kite bar timestamp is timezone-AWARE (IST) but `_ist_now()` is naive → `can't compare offset-naive
and offset-aware datetimes`. This crashed `session_frame` in the Index (idx_data) and MCX (mcx_data)
engines, so the Index/MCX **charts + status returned Internal Server Error** (the engines' exits kept
running — the failure was caught in tick — but the UI reads 500'd). Slipped past dev smoke-tests
because those ran without a live Kite feed (tz-aware bars). Fixed with `b["date"].replace(tzinfo=None)`
in idx_data, mcx_data and aosfut_engine. Paper only; no trade/journal data affected.

## v1.8.8 — 2026-10-22  ·  Forming-bar entry fix + NEW AOS Trend-Ride futures engine (MINOR)

**Forming-bar entry fix (Index PDH/PDL · MCX · ORB).** The intraday breakout engines decided
entries on the in-progress (forming) bar, so a 09:15 opening-tick poke counted as a confirmed
break — today (10-22) the Index engine fired NIFTY + BankNIFTY shorts at 09:15:21 on the opening
bar, both reversed. Fixed: entries + the EMA9/VWAP trend-ride exit now decide on COMPLETED bars
only (`sig_last`/day-range from closed bars; the realistic-fill open is honest); the live price is
still used for stops so exits react immediately. Backtest-verified OLD vs NEW (NIFTY 5m 685 days +
equity ORB): winners IDENTICAL, net IMPROVES (idx +12,709 vs +11,262; ORB +5.7% vs −0.7%). The two
invalid 10-22 index entries were cancelled on the client.

**NEW paper engine — AOS Trend-Ride on index FUTURES.** The "Options Scalper v2" 15-min signal,
expressed on the NIFTY/BankNIFTY FUTURE instead of a bought option. A full faithful study on real
option premiums showed the signal is a directional ~40%-win edge that DIES to theta as an option
buy (PF 0.87-0.97) and is the wrong structure to sell (credit-spread 0.52) — but on the future
(no theta) it is PF ~1.26-1.36, all three years positive. Runs TWO signal variants in PARALLEL for
a live forward A/B: **6-Factor + RSI-momentum** (EMA9 trend-ride exit) and **VWAP-cross + EMA9/21
confirm** (VWAP cross-back exit). Closed-bar discipline, SL 2×ATR, max 3/day/variant. View + toggle
from the Index tab's 🌀 Trend-Ride panel (side-by-side variant P&L). source_mode 'aostr', paper,
OFF by default — forward-validate before any live capital. (In-sample study; forward A/B decides.)

## v1.8.7 — 2026-10-21  ·  NEW Hero Momentum preset + positional engine (MINOR)

**New preset + engine — Hero Momentum (optimised positional universal).** Distilled from a full
study of the screener presets (correlation + combined + hero-factor optimisation + survivorship-
clean + DD-reduction): the three factors that matter are near-52W-high (pos52w≥85), trend-alignment
(price>EMA50>EMA200) and relative-strength (RS>0); ranked by 6-mo momentum. Breakout/volume/pullback
add-ons tested and dropped (no lift). Validated survivorship-clean on a 641-stock point-in-time
liquidity-gated pool: CAGR ~18%, PF ~1.8, OOS +22%, win 37%, and a market-REGIME filter (new entries
only when NIFTY>200-SMA) cuts MaxDD 33%→27%. (1) **🏆 Hero Momentum screener preset** (the stock
screen, appears as a chip). (2) **Hero Momentum positional paper engine** — candidate source = that
preset, up to 12 equal-weight slots, regime-gated, rides the trend, exits on close<EMA50 / pos52w<70
/ 4×ATR stop. source_mode 'heromomo', paper, OFF by default, own kill-switch, journal-mirror +
account fold. UI: a 🏆 Hero Momentum panel in the Screener tab's Basket view (Auto/Kill, capital,
live regime indicator, open + recent). Also folded the OI-Bias engine into the paper account (missed
in v1.8.6). The future vehicle is the validated one; this is paper, forward-watch before any live.

**Screener cleanup — 13 presets → 4.** The study above showed the momentum-family presets
(Momentum Breakout / Breakout / Trending / Momentum / Quality Momentum / Leaders) heavily overlap
and are dominated by Hero Momentum. Trimmed the chip list to the 4 orthogonal, individually-validated
edges: 🏆 Hero Momentum, 🌀 Pullback Leader, 🐢 Value+Pre-Momentum, 💰 Dividend. The two delegated
warehouse scanners and the old generic presets are no longer surfaced as chips (scan code kept on
disk, reversible).

**Fundamentals data pipeline — weekly full sweep.** Replaced the daily fundamentals trickle (which
kept falling behind the 7-day freshness window) with a single weekly sweep: every Saturday the
collector refreshes the ENTIRE ~700-stock universe in one shot at a ban-safe 2.5s throttle (~30 min,
market closed). The daily job now warehouses candles only. Fundamentals are quarterly, so one
refresh/week keeps everything comfortably < 7 days fresh. Gated, read-only, fail-soft, retryable.

## v1.8.6 — 2026-10-19  ·  NEW OI-Bias engine (NIFTY directional) (MINOR)

**New paper engine — OI-Bias (NIFTY intraday directional).** At 09:45 it reads the option-chain
OI bias (PCR = ΣPE_OI/ΣCE_OI over ATM±10 strikes of the nearest NIFTY expiry); on a STRONG bias
(PCR > 1.15 bullish / < 0.85 bearish) that AGREES with the price direction since the open, it
trades the NIFTY FUTURE in that direction and exits 15:00. Validated on historical.db (1255 days,
2021-26): +14.8 pts/day, win 57%, t+2.43, 6/6 years positive, OOS-robust (ref/exit plateau) — the
future (no theta) is the validated vehicle. A 📅 WEEKLY-option mode (buy ATM CE/PE, DTE≥2) is
available as a toggle (BS-modelled +3.9%/+5.5%-OOS — survives theta on a weekly, unlike 0-DTE,
but weaker + higher-variance). NIFTY-only (no intraday BankNIFTY OI data). source_mode 'oibias',
paper, OFF by default, own kill-switch, journal-mirror + account fold. UI: 🧭 OI-Bias modal (live
PCR/bias/confluence board, Auto/Kill, Future/Weekly toggle, open + recent) off the Index tab.

## v1.8.5 — 2026-10-19  ·  Live-P&L perf fix + Scalp-Harness strict-only (PATCH)

**Fixed — option-engine `status()` was slow (UI stuck "loading").** The v1.8.4 live-P&L
enrichment made ONE throttled Kite quote PER open leg inside the polled `status()`; with the
shared 1/s quote limiter this serialised N quotes (e.g. 3 open harness shadows → ~4s status),
so the frontend's polls piled up and tabs sat on "loading". Each engine (Premium-Pop,
Credit-Spread, Scalp-Harness, Gamma-Blast) now fetches ALL open legs in ONE batched
`ltp()`/`quote()` call (a single throttle token), fail-soft. Live P&L unchanged, status fast again.

**Scalp-Harness — strict-only trial (current + loose retired).** The 3-variant survivorship
review (608 trades) was monotonic — strict > current > loose on net, RoR and profit factor —
and strict was the only variant positive in the recent 30 days (+₹9.2k, 59% win) while current
(−₹21.2k all-time) and loose (−₹36.1k) kept bleeding. The harness now shadow-trades only the
strict (≥85) variant; current/loose take no new trades. Reversible via the `active_variants`
setting. (Strict is still net-negative all-time — this is a forward-watch trial, not a validated edge.)

## v1.8.4 — 2026-10-14  ·  MCX ORB removed · Option-engine live P&L · Observatory label fix (MINOR)

**MCX — ORB variant removed (no edge).** A 67-day real-MCX test (9 commodities) found the ORB
opening-range variant has no edge in any form — plain (−0.06%/tr t−2.1), prior-day-aligned (all
filters train-negative), DEMA-gated (length sweep 20–800, every length train-negative), and
DEMA334 break+retest multi-TF with optimised TP (break-even at best). It was also buggy: the ORB
break check `day_high ≥ or_high` was trivially true (or_high ⊆ day_high), firing a phantom long at
09:15 every day. `mcx_engine.VARIANTS` is now `(pdhl, eve)` — both backtest-validated; ORB is gone
from trading and the survivorship UI. (The ORB `_signal` was also fixed to a genuine break+hold+
realistic-fill, now dead code but correct.)

**Option engines — live P&L on open positions.** Premium-Pop, Credit-Spread, Scalp-Harness and
Gamma-Blast now show unrealized live P&L on each open position (none did before). Each engine's
`status()` enriches open rows with `live_price`/`live_pnl` (Credit-Spread: `cur_spread`) via its
existing live-quote helper, fail-soft on a quote miss, P&L matching the close formula. The modals/
cards render a coloured Live P&L column. Premium-Pop also gained `recent` history in `status()`.

**Observatory — engine label fix.** MCX trades were mislabelled "Scalp" in the Observatory's
Recent-Trades and Performance-by-Instrument. The portfolio service's synthesized MCX trades set
`engine` but not `source_mode`, and the row builders read `source_mode` (falling back to "scalp").
Fixed — MCX trades now show "MCX".

## v1.8.3 — 2026-10-13  ·  Index PDH/PDL break+hold entry fix (MINOR)

**Fixed:** the Index (PDH/PDL) paper engine fired on single-tick false-break wicks. Seen live —
a NIFTY short triggered at 09:15:43 on a 2.7-pt poke below the prior-day low that instantly
recovered (price spent the day ~300 pts back inside the range). The entry rule was a raw `last`
cross of the level, with no confirmation. It now requires **break + HOLD**: price must break the
level *and* still be holding beyond it by a 0.1% buffer (`last ≥ PDH×1.001` for longs,
`last ≤ PDL×0.999` for shorts), which rejects fading wicks. A tick-walk over the prior closed
trades confirmed all three real winners (incl. the +18k 2026-10-08 gap-down short) still fire,
while the false-break is filtered. Deliberately **no** no-gap gate (unlike MCX): on the index a
gap that keeps running is part of the validated edge, so instead entries now book a **realistic
fill** — if the open already gapped past the level you could not have transacted at the level, so
the fill is the (worse) open, else the level. `session_frame` now carries `day_open`. The stranded
false-break open position was removed from the running client. Entry-logic only; exits unchanged.
Paper-safe.

## v1.8.2 — 2026-10-09  ·  Index/MCX never-strand exit fix (PATCH)

**Fixed:** an Index (PDH/PDL) or MCX position could stay open past its session-close exit when
the live-frame fetch failed at the cutoff (a Kite call that throws after close / a stale evening
token). In `tick()`, `session_frame()` ran before `manage()` and wasn't guarded, so a throw
skipped the exit entirely and stranded the position (seen live: a BANKNIFTY long still open after
the 3:40 close). Now the frame fetch is wrapped (fr=None on failure) and `manage()` ALWAYS runs —
it force-closes at the last price, or at entry when none is available — plus any position from a
PRIOR day is treated session-over and flushed on the next tick. MCX's `manage()` also guards its
close-reference for fr=None. Exits only; entries unchanged. Paper-safe.

## v1.8.1 — 2026-10-09  ·  Gamma-Blast UI (PATCH)

**Gamma-Blast research harness UI.** The NIFTY 0-DTE forward paper research harness (shipped
backend-only in v1.8.0) now has a view: a 🎯 Gamma-Blast button in the Scalp tab opens a modal
with Auto/Kill toggles, an "UNCONFIRMED lead (t~1.5)" banner, stats (paper P&L / closed / win% /
open), the setup line, and open + recent-close tables (contract, momentum %, entry/exit date-time,
premium, SL, P&L). Frontend-only; the harness stays off-default, paper, research-only.

## v1.8.0 — 2026-10-08  ·  NSE 3:40 close + hedge chart fix (MINOR)

**NSE extended F&O market close 3:30 PM → 3:40 PM (effective Aug 2026).** Every engine's
market-close-relative time window was shifted +10 min so nothing exits/stops ~10 min early or
mis-reads session end (the offset before close is preserved, not a blind +10 everywhere):
- liveness market-open window → 15:40; idx hold-to-close exit → 15:30; shortvol EOD force-close
  → 15:30 (the validated 10:40 edge-exit is unchanged); pop/credit "stop new near close" → 15:20;
  position_tracker expiry + EOD MIS square-off → 15:30; scalp-harness EOD → 15:30; hedge entry
  window end → 15:25; Greeks session-close (TTE) → 3:30; daily candle-sync fire → 15:50;
  zone-scheduler no-entry → 15:10 and EOD report → 15:40.
- MCX (commodity timings) and all backtest files (historical 3:30-era data) are untouched.
  Note: the EOD/expiry square-off now models the new close; a real broker's MIS auto-square time
  is broker policy — verify before any live trading.

**Gamma-Blast forward paper research harness (NIFTY 0-DTE, OFF by default).** An exhaustive
0-DTE option sweep (time/TF/OI/strike/trigger/exit + optimize + cross-instrument) found no
confirmed systematic edge — but one lead was sign-consistent and outlier-robust: a late-day
momentum-continuation ATM buy (14:30 entry, 60-min move ≥0.1%, SL 40%, hold near close), which
backtested train +45% t1.7 → test +56% t1.5. That's a gamma-convexity lottery (the underlying
doesn't continue; the option wins via gamma on the rare big move), and t<2 = unconfirmed. This
harness runs that exact setup FORWARD on paper to see if it holds under the new 3:40 session —
it does not assert an edge, is off by default, paper-only, and is kept out of the Account total.

**Hedge basis chart fix.** A pre-open / opening-auction basis spike (futures dislocate before
liquidity settles; the annualization amplifies it) read |z|≥2 and painted a solid red/green
"signal" dot that the engine never traded (it's outside the 09:20–15:25 window and the price is
dislocated). Those misled the eye. The chart now paints a solid signal dot only for non-artifact
bars (basis within a robust median ± K·MAD); an artifact spike gets a faint hollow ring with a
"not tradable" tooltip. The basis line still shows the spike.

## v1.7.9 — 2026-10-06  ·  MCX overnight-strand fix (PATCH)

**Fixed:** an MCX position whose session-close cutoff was missed because the live feed was
down at the time (a stale Kite token in the late evening session, or the app not ticking at
23:30/16:55) now force-closes on the next good tick instead of stranding an extra full day.
The old check `now_hhmm >= exit_time` is a plain string compare valid only within one calendar
day, so an eve trade opened yesterday read `"11:10" >= "23:30"` = false this morning and stayed
open. `manage()` now treats any position whose `trade_date` is before today as session-over and
flushes it (reason "session-close (stale)"). Exits only — entries unchanged. Paper-safe.

## v1.7.8 — 2026-10-05  ·  Portfolio-risk observe gate (MINOR)

**Added — Phase-0 OBSERVE-ONLY portfolio risk brain** (`portfolio_risk.py` + worker + API):
a single cross-engine view that evaluates portfolio-level gates but ENFORCES NOTHING — it
only logs "would-block" advisories so we can watch, over a few weeks, what a portfolio layer
would have stopped before wiring it into any engine's entry. Fills the gap the per-engine caps
miss: net DIRECTIONAL exposure by bucket (metals/energy/index — the 2026-09-23 MCX correlated
pile-up), portfolio drawdown vs a realized peak, a VIX circuit-breaker and an event-calendar
blackout. Reuses the existing `risk.aggregate_open_mtm()`/`account_risk_ok()` rather than
re-deriving them. Zero-risk by construction (no engine consults it to decide entries yet).
- New `GET /api/v1/risk/portfolio-advisory` + a 🛡 Portfolio Risk readout in the Risk modal
  (net-exposure buckets, DD, VIX, event, 20d containment, per-gate would-block status).
- A 180s observe-only worker logs breaches to decision_log. Additive, paper-safe.

## v1.7.7 — 2026-09-27  ·  MCX entry-rule fix + A/B/C/D capital plans (MINOR)

**Why:** MCX paper was bleeding on the client (−₹3.2L, metals 0/9). Investigation found it
was NOT edge decay — a 90-day real-MCX backtest showed the PDH/PDL edge is intact and
regime-robust (metals pooled +₹20k/trade, 74% win, t4.13). The loss was two execution bugs
on ~one gap-and-fade day (2026-09-23): entering on the opening GAP, and oversized contracts.

**Fixed — MCX engine**
- **pdhl entry v2 (no-gap + break + hold):** only enters when the session opened at/inside the
  prior-day level (no overnight gap), price broke it intraday, and is holding past it by a small
  buffer. Skips the gap-fade set that caused the bleed. (Validated on 90d real MCX.)
- **Per-trade ₹-risk cap:** blocks oversize contracts (e.g. full SILVER ~₹1.76L risk/trade).
- **Max-concurrent cap:** stops correlated metals piling up in one session.

**Added — A/B/C/D capital plans** (default **B**, tuned for a ~₹3L account on 90d real-MCX):
- **A Safe** (micro only) · **B Balanced** GOLDM+SILVERMIC ~+6.8%/mo maxDD 1.9% · **C Growth**
  +SILVERM · **D Aggressive** +COPPER/3-concurrent. Each caps universe + per-trade risk +
  concurrent. Switching to the higher-risk **C/D shows a risk-confirm popup**.
- MCX auto stays OFF until forward paper-verify; changes are additive and paper-safe.

## v1.7.6 — 2026-09-21  ·  Analyzer audit + evidence-based edges + Value basket (MINOR)

- **Stock Analyzer — full audit remediation + evidence-based rebuild.** A 5-advisor audit (then a verify re-run) fixed correctness, honesty and robustness across the board: the header price now shows the LIVE price (was a stale completed close), the verdict no longer inflates thin data into "STRONG BUY", each verdict carries an honest "signal read, not a backtested predictive score" caveat, screener/yfinance fetches are time-bounded (a slow data source can't hang the app), stale fundamentals are re-fetched and flagged, and dozens of smaller display/guard fixes. Security review: clean.
- **Analyzer now shows the VALIDATED tradeable edge**, not just the heuristic verdict — a "🎯 Pullback-Leader Entry" callout fires when a leader is resting at its EMA20 (uptrend + 6-mo momentum + upper-52W, not extended), the backtest-validated coil setup (+0.95–1.26%/40d, t≈4). The composite verdict is demoted to context.
- **Fundamentals re-weighted by evidence.** A point-in-time factor study showed VALUE (low PE) is the one fundamental with a real forward edge, ROE/quality is anti-predictive, and the rest are noise — so the verdict now weights value fully, neutralizes ROE, halves growth and drops the noise factors (raw values still shown).
- **New 🐢 Value + Pre-Momentum basket (paper, off by default).** The evidence-backed "find it before the run" strategy: cheap names that haven't run yet (a study found these had a 3-year ≥2x hit-rate of 38% vs 22% base, with the lowest downside). A new Screener preset lists candidates + a full positional paper basket engine (Screener → Basket) auto-builds and forward-tracks them (~2-year holds, capital-sized). Shows in Performance + Portfolio.
- **Screener: 🎯 55-70 N-Score sweet-spot.** A bucket study found the 55-70 N-Score band is the reliable sweet-spot (best forward return with significance and enough candidates; ≥70 is rare / often already extended) — it's now highlighted in the table and has its own 55-70 toolbar filter.
- **Screener performance fix.** A full-universe scan no longer overlays live prices on all ~700 stocks before filtering (it starved the Kite quote limiter during market hours and could hang for minutes) — the live overlay now runs only on the shown results.

## v1.7.5 — 2026-09-21  ·  Index tab richer (chart + overlays) (PATCH)

- **📈 Index tab is now as rich as MCX.** It gained the full candlestick chart with the front-future's prior-day High/Low + opening-range levels and the Pivot (Traditional/Fibonacci) · Liquidity-zone · Trendline overlays, plus a Live-breakouts board and Positions panel side by side, index cards with a range bar, and its own Observatory (Trader-DNA + equity curve). The chart component is now shared with MCX (one component, both tabs), no duplication.

## v1.7.4 — 2026-09-19  ·  Index PDH/PDL engine + MCX live P&L% (MINOR)

- **New 📈 Index PDH/PDL engine (paper, OFF by default).** NIFTY/BANKNIFTY intraday **futures** breakout — the validated cross-market edge (honest 5-yr backtest: NIFTY +0.23%/trade OOS t6.8, BankNIFTY +0.15% OOS t3.3; both long AND short work, not beta). **Tuned config** from a 60-config sweep: prior-day High/Low break → entry AT the level, stop = other side of the range, **NO fixed target — hold to the session close** (hold-to-close beat every target-R), entry window **≤12:00**, one trade per index per day. Trades the FUT (no theta — options bleed it). Own kill-switch; force-paper.
- **📈 Index tab** — per-index breakout board (PDH/PDL, live state, distance-to-level, day move), positions with **live P&L + %**, Auto/Kill toggles, and a 🔭 Observatory (Trader-DNA radar + equity curve + KPIs).
- **Wired like every other engine** — folds into the Paper Account (📈 tile, balance-safe), the Performance report (engine filter + By-Engine), and the Portfolio dashboard. Closed trades mirror into the journal.
- **MCX positions now show live P&L %** per entry (return on margin) alongside the ₹ figure, plus the raw price-move % in the hover.

## v1.7.3 — 2026-09-18  ·  MCX commodity tab + per-tab Observatory + reporting parity (MINOR)

- **New 🪙 MCX Commodity tab (paper, OFF by default).** Intraday single-instrument futures on the MCX metals/energy/base-metals complex. Three variants run in parallel for forward survivorship: **pdhl** (prior-day High/Low breakout → hold to close — the backtest-validated edge, metals pooled OOS t5.2, long+short both work), **eve** (evening momentum-continuation, OOS t3.72), **orb** (marginal shadow). Entry at the breakout signal level. Live Breakouts board + Positions (live P&L / notional / est. margin), 📈 Macro context (not a signal), 🗺 Heatmap, 🔗 Correlation table.
- **MCX chart overlays** — front-contract candles + PDH/PDL/opening-range, plus **Pivot levels** (Traditional / Fibonacci), **Liquidity zones** (unswept swing highs/lows as border-less boxes, extended until swept) and **Trendlines** (independent extended rays); toggle Piv · Liq · Trend. Deeper history so past liquidity/trendlines are scrollable. Right-click for fit/stretch/auto-scale.
- **Per-tab 🔭 Observatory.** The inline Account card was removed from every mode; each tab (Scalp · Sector · Hedge · MCX) now opens its own Observatory popup — account + full Portfolio dashboard (Trader-DNA radar · equity curve · KPIs) + trades. The Dashboard rolls all engines up account-wide.
- **MCX everywhere the other engines are.** Closed MCX trades mirror into the trade journal (reporting) + fold into the Paper Account total via their own store (like Hedge/ShortVol — balance-safe, no double-count). MCX now shows in the Performance report (engine filter + By-Engine), the Account card (🪙 tile) and the Dashboard Market Galaxy (paged rich cards with live ticks + option-chain read).
- **Guide/Dashboard help updated** — new 🔭 Observatory and 🪙 MCX guide sections; Paper Account / Performance / About content refreshed to current engines.
- **Screener: fresh-not-chased + fundamentals age.** Default preset is now **`pullback_leader`** (🌀 — leaders riding their EMA20 BEFORE the breakout) instead of `mom_breakout`; a **"🌱 Fresh only"** toggle (default ON) hides names whose AVWAP-from-52W-low state is **extended** (the chasing zone). Fundamentals now surface their age — a **📊 Fundamentals Nd old** chip (median, amber when oldest >10d) + a per-row **Fund Nd** column.

## v1.7.2 — 2026-09-15  ·  Trade-chart fixes + Scalp-Harness & Hedge-kill UI + store.py split (PATCH)

- **T2 (auto-close) line now matches where the trade REALLY closes.** The chart and trade card computed T2 as `2 × T1 − entry` (2.0R), but the backend tracker auto-closes at **2.5R** for scalp AND orb (`SCALP_T2_R`/`ORB_T2_R = 2.5`). So the chart drew T2 too low — a winner looked like it "crossed the TP but didn't close" when in fact the real auto-close sat higher. A shared `lib/trailLadder.ts` now derives the T2 price at the engine's true multiple (scalp/orb 2.5R, sector 2.0R), used by the chart line, the card, and the manual "@ T2" button.
- **The trail-status label is now engine-aware.** After 1.5R the card always read "candle-to-candle trail active", but only scalp/engine actually candle-trail — ORB and Sector lock the SL at +1R and HOLD to T2 (their premiums are gamma-heavy). ORB/Sector rows now read "holding to T2 (no candle trail)", so the SL not trailing is no longer mistaken for a bug.
- **Manual "@ LTP" close no longer fills at a stale price.** The close (and the card's live P&L) preferred the frontend WS tick, which can freeze if an option's subscription stops streaming while the chart keeps advancing via its periodic REST refresh — so a "@ LTP" close once filled well below the price the chart was showing. It now prefers the server-resolved `last_price` (WS→REST fallback, refreshed each poll, can't silently freeze), and the same price drives the displayed P&L and the close so they always agree. (Paper slippage still applies on paper fills per the Scalp-settings `paper_slippage_rs` — set it to 0 for an exact-LTP paper close.)
- **Scalp Harness cockpit (🎯 Harness button in the Scalp view).**

- **Scalp Harness cockpit (🎯 Harness button in the Scalp view).** A popup for the strictness harness: an overall row, a per-variant survivorship table (Strict ≥85 / Current / Loose ≥75) ranked by **Return-on-Risk + Worst-trade** with a **Survivor?** (trustworthy) badge, plus open shadows and recent closes. Auto ON/OFF toggle; the toolbar button blinks with the live open-shadow count.
- **Hedge kill-switch toggle** — a `🛡 Kill` / `🛑 KILL ON` button next to the Hedge auto toggle in the Hedge view, wired to `/risk/kill-switch/hedge`. Blocks new calendar spreads (open spreads still exit via the tracker).
- **`store.py` (1860 lines) decomposed** — shared SQLite primitives moved to `db/store_core.py` (`_conn`, `get_meta`/`set_meta`, `init_db`, `MIGRATIONS`) and the auto-trade/trade-mode settings to `db/store_settings.py` (`global_trade_mode`, LIVE-gate 2FA, `effective_auto_mode`, sector/scalp auto). `store.py` (now 1633 lines) imports and **re-exports** them, so every `from app.db.store import …` keeps working unchanged; submodules import only from `store_core` (no circular imports). Verified: full app + all engine consumers import, and `effective_auto_mode` behaves identically. Pure refactor — ships with the next deploy.

## v1.7.1 — 2026-09-12  ·  Order-safety hardening + WS keepalive (PATCH)

Audit-confirmed order-safety gaps closed + a WS "OFFLINE" flap fix. Safety/reliability only.

- **ORB Radar manual buy now honours the global LIVE switch.** `POST /api/v1/sectors/orb-radar/buy` checked the ORB kill-switch but — unlike every sibling entry (e.g. `/sectors/enter`) — did **not** verify the daily-expiring **global LIVE arm** (with 2FA). A `mode:"live"` call could therefore place a real broker order while global LIVE was OFF. It now returns **403 "LIVE not armed"** exactly like the auto path and the other entry endpoints. Paper entries (the default) are unaffected.
- **Backend API-token gate fails CLOSED in packaged builds.** When `NAKSHATRA_API_TOKEN` was unset, the loopback trading API served **every** `/api/` request unauthenticated. That is correct for dev, but in a *packaged* build the Electron shell always injects a token, so an unset token there means misconfiguration/tampering — the gate now **refuses the API (503)** in that case instead of running open. Dev (not packaged, no token) stays open exactly as before; packaged with a valid token is unchanged.
- **Manual entries now enforce the cross-engine open-drawdown gate.** The account gate (`account_risk_ok` — realized P&L **plus** open unrealized MTM across all engines vs the day cap) was applied on the auto paths (auto-scan, scalp worker) and the shared entry helper, but the manual HTTP entry endpoints (`/trades/enter`, `/sectors/enter`) only saw the **realized-only** daily/weekly caps via `compute_risk_state().halted`. `account_risk_ok` is now folded into `compute_risk_state`'s `halted` (a new `account_drawdown` breach), so every entry path — manual and auto — pauses new entries on the same open-drawdown backstop. Exits are never gated (`halted` is consulted only at entry). ORB-Radar manual buy was already covered (routes through the shared helper's direct `account_risk_ok` call).
- **N-Score positional is now live-capable — but OFF by default.** The strategy audit rated it the least-fragile promote candidate (equity, defined downside), so it was wired for real trading: a live CNC equity BUY with fill reconciliation on entry and the matching SELL on exit (anchored to the actual fill, never a phantom row; a failed SELL leaves the position open and retries — never abandoned), plus `trade_mode`/`entry_order_id`/`exit_order_id` columns and clearance in `VALIDATED_EDGE_ENGINES`. It stays **paper by default**: real orders fire only when the global LIVE switch is armed AND the engine toggle is on; the default (global paper) papers exactly as before. The edge is marginal — size the first live runs small.
- **New Scalp strictness harness (paper).** Three score-threshold variants — **strict (≥85) / current / loose (≥75)** — shadow-trade the same scalp scan candidates in parallel on paper, so you can watch forward which strictness survives. It isolates the one knob (score cutoff), tracks each variant's shadow trades to SL/target/EOD, and reports **risk-normalized** survivorship (return-on-risk + worst-trade + a trustworthy gate) rather than raw ₹/win-rate (a looser variant simply takes more trades). New `/api/v1/scalp-harness/*` endpoints + a 20s worker; paper only, never a broker order, independent kill-switch, default ON for data collection. (Cockpit UI card is a follow-up.)
- **Hedge auto entries fill next-bar, not same-bar.** The auto calendar fill happened at the very bar that generated the signal — the look-ahead the backtest was rewritten to remove (it had inflated results ~4×). A fresh signal now ARMS a pending fill and the open happens on the next poll at the re-fetched price (all guards re-run at fill time); manual/force entries still fill immediately. With the earlier net-of-cost change, paper hedge P&L now tracks the honest backtest on both fill and cost.
- **Post-audit follow-ups (batch 1).**
  - **Account daily/weekly loss cap defaults raised** to ₹15,000 / ₹45,000 (were ₹3,000 / ₹10,000) — the old default was smaller than a single Short-Vol straddle's P99 loss (~₹6,150), making the account backstop decorative and the per-engine sub-caps unreachable.
  - **Hedge now has its own kill-switch** (`/api/v1/risk/kill-switch/hedge`), symmetric with scalp/sector/orb — halts new calendar-spread entries (open spreads still exit via the tracker) instead of relying only on disarming the auto toggle.
  - **Credit-Spread SL level clamped to the achievable max (spread width)** — a wide spread's `credit×(1+sl_mult)` could sit above the width, so the "stop" was unreachable; the stored SL is now an honest, hittable level (risk was always bounded by width regardless).
  - **Confluence/flow risk-sizer** now logs when it can't resolve a lot size (dormant path; same or-1 class as the live-path fix).
- **Strategy audit — honest risk + honest paper data (4-advisor edge audit).** The edge claims across the suite are weaker than prior notes recorded (details in the audit); these fixes make the risk and the paper comparison honest rather than changing any strategy:
  - **Short-Vol sizing is now honest.** At the default ₹10L / 0.2% the sizer floors to 1 lot whose P99 loss (₹6,150) is ~**0.62%** of capital — 3× the advertised 0.2%; the "0.2%/trade" was false at the floor. `sizing_detail()` now surfaces the ACTUAL risk %, an `oversized` flag, and whether the account cap even covers one lot, and logs a warning at entry. (Real risk reduction = set capital/risk to fit a whole lot — a user setting, not a magic number.)
  - **Short-Vol exposure stays visible when one leg goes untickable.** The account-risk fold required BOTH straddle legs to be priced; a single missing leg read the position as flat-zero and invisible on exactly the volatile day it matters. It now marks the priced leg (missing leg held flat) so the loss is seen; the straddle still counts as unmarked for the feed-outage fail-closed.
  - **Hedge paper P&L is net of cost.** Calendar closes now subtract the round-trip slippage (6 NIFTY / 12 BANKNIFTY pts) the validating backtest charged, instead of booking gross — so paper matches the honest backtest. (The separate same-bar-fill look-ahead in the live path is noted for a later structural fix.)
  - **Credit-Spread survivorship is risk-normalized.** The flavor comparison added **return-on-risk** (₹ P&L per ₹ of defined risk deployed), **worst_trade** (the tail), and a **`trustworthy`** gate (≥20 closed AND ≥1 loss) — so a flavor can't "win" merely by sizing into more premium, by a high win-rate that hasn't met its tail, or on too few trades.
  - **ORB & Scalp marked UNVALIDATED in-tree.** Their headline positive numbers appear only in docstring prose with no committed backtest that reproduces them; the docstrings now say so. Both stay paper-only.
- **Engine-audit Group C — housekeeping / consistency.**
  - **Hedge expiry square-off is independent of a live quote.** The near-contract expiry force-close sat behind the live-spread check, so an illiquid future (no live spread) skipped it and could strand the position into the roll. The cutoff is now evaluated first, on the position's own expiry dates.
  - **Hedge auto defaults to BANKNIFTY-only.** The defensive fallback for `HEDGE_AUTO_UNDERLYINGS` re-admitted NIFTY (which has no validated calendar edge); it now defaults to `["BANKNIFTY"]` so a config removal/rename can't quietly start trading NIFTY.
  - **Short-Vol eligibility is pinned to today.** `today_status` returns the last IV-rank row; if the live IV couldn't be appended (dead token / no quote) that row is yesterday's — its rank/expiry flag no longer gates today's entry (the entry is skipped until today's row exists).
  - **Retired FLOW flags labelled inert.** `FLOW_AUTO_ENABLED` / `FLOW_ENGINE_ENABLED` have zero consumers (the flow loop was physically removed); the comment now says so, so no one flips them expecting flow to revive.
  - **Stale docstring fixed** (`auto_workers` said `ENGINE_AUTO_ENABLED` was armed; it is `False`/de-armed).
  - *Noted, not changed:* Hedge has no independent kill-switch (a small feature needing UI — relies on the arm toggle + 2R cap today); Credit-Spread `sl_debit` can exceed the structural max-loss on a wide spread so the SL never fires before the defined max (risk stays bounded by width — flagged to confirm intent, not changed to avoid a survivorship-data discontinuity).
- **Engine-audit Group B — fail-closed discipline + data-quality (the recurring "missing data → permit" theme).**
  - **Scalp no longer enters blind when its 5m data is missing.** If the underlying 5m fetch returned empty (a Kite hist rate-limit / error), the whole quality block (chop / opening-range / max-pain / exhaustion) was silently skipped and scalp entered on score+zone alone. It now **blocks** (`quality_no_5m_data`) — can't verify, don't enter.
  - **The live-guard fails CLOSED.** If the validated-edge list can't be read (rename / circular import / packaging miss), `effective_auto_mode` swallowed the error and returned `"live"`. It now coerces to **paper** — the single choke point in front of real orders can't silently fail open.
  - **Holiday guard on Premium-Pop / Credit-Spread / Short-Vol.** They only rejected weekends; on a weekday NSE holiday the chain returns frozen prior-session prices, so they would "trade" on stale data (and Short-Vol would write a bogus IV-rank row). A holiday is now treated like a non-trading day (entries blocked, management deferred to the next session).
  - **ORB enters only when price is beyond the range NOW.** The breakout check fired if any earlier bar had crossed the opening range — so a poke that faded still triggered a fresh, late entry into a dead breakout. It now requires the current close to be beyond the range.
  - **Mis-sized lot → skip, not size-to-1.** Scalp, Sector and Hedge resolved lot size as `… or 1` / `… or DEFAULT_LOT_SIZE(1)`; on an instruments-sync gap (e.g. just after an expiry roll) the lot silently collapsed to 1 and the trade logged at ~1/75th qty, corrupting P&L and every account/cap aggregate. All three now **skip the entry** when no real lot size resolves.
  - **EOD 15:20 square-off no-quote fallback is now worst-case, not break-even.** The intraday flatten booked entry price (a fake break-even) when no quote was available; it now books the trade's SL (the honest conservative outcome for a position still open at 15:20).
- **Engine-audit Group A — Short-Vol safety + kill-switch semantics (highest-blast findings from the engine audit).**
  - **Short-Vol can no longer orphan a naked short straddle.** Its exit priced the locked strike from a narrow ±6-strike chain window, so a large intraday move (exactly when the straddle is deepest in loss) pushed the strike out of the window → the 10:40 and 15:20 exits both returned "exit-fail" and the **naked short was carried overnight with unbounded risk**. The exit window is widened to ±25, and the mandatory 15:20 exit now **force-closes** at a conservative intrinsic value from the current ATM (`|spot − strike|` on the ITM leg) when the strike still can't be priced — the position is never stranded.
  - **The kill-switch (and disabling an engine) no longer freezes exits.** On Short-Vol, Premium-Pop and Credit-Spread the per-tick `is_enabled()/kill_on()` check returned *before* the manage/exit step — so flipping the kill-switch or turning an engine OFF while a position was open **abandoned that position** (it never hit its SL or next-day/EOD exit). Exits/`manage()` now run on any trading day regardless of enable/kill; only **new entries** are gated. (Weekend still skips management so a next-day exit lands on the next trading session, not Saturday.)
  - **Short-Vol is locked to NIFTY.** Its edge, P99 tail (82 pts) and lot (75) are validated for NIFTY only; a `?symbol=BANKNIFTY` call would have shorted a BNF straddle sized with NIFTY lot/tail (qty & P&L ~2.14× off, mis-sized naked risk). Non-NIFTY entries are now rejected.
- **Paper engines are more honest (Premium-Pop / Credit-Spread / Short-Vol).** Three optimism biases that would have flattered the forward survivorship data:
  - **No-quote exits no longer fake a break-even.** The mandatory next-day time-exit, when a leg couldn't be priced, closed *flat* (at entry premium / at full credit) — a best-case outcome that inflated win-rate. It now closes at the **worst-case we'd have honoured**: Premium-Pop at its −50% SL premium, Credit-Spread at its SL debit. Conservative, so a no-quote day can't manufacture a win.
  - **Credit-Spread entry credit is haircut for slippage.** The chain gives only LTP, but you sell the shorts at the (lower) bid and buy the wings at the (higher) ask — so the LTP/mid credit was optimistic. A modest half-spread per leg (0.5 pt/leg, tunable) is now subtracted at entry.
  - **Short-Vol exposure is visible to the account risk backstop.** The Short-Vol short-straddle book (the one paper engine cleared for LIVE) sat outside `aggregate_open_mtm`, so a live straddle would be invisible to every cross-engine cap. Its correctly-signed short MTM `(entry − current) × size` is now folded in (and an unmarked straddle counts toward the feed-outage fail-closed). Other paper engines stay isolated by design.
- **Kite access token encrypted at rest.** The daily Zerodha access token (a bearer credential to the trading account) was cached as **plaintext** in `access_token.json`, readable by any local process. It is now stored DPAPI-encrypted (per-user, Windows) via the same helper the API creds use; loading transparently decrypts and still reads a legacy plaintext cache (re-encrypted on the next save). The date stays clear (it's only the TTL check).
- **Candle warehouse never stores a still-forming bar.** `upsert_candles` wrote whatever bars it was handed (INSERT OR REPLACE); a backfill that reached into the current session could persist the in-progress final candle, which an engine might then read as a completed bar. A completed-bar guard now drops any bar whose period hasn't closed yet (`ts + interval ≤ now`, using the true UTC epoch the store already keeps); it re-inserts once the bar closes, leaves historical backfills untouched, and skips unknown intervals so nothing is dropped by surprise.
- **Renderer hardening (Electron shell).** `setWindowOpenHandler` handed **any** URL to `shell.openExternal` — a compromised/injected renderer could launch a `file://` or custom-scheme URL as a program. It now opens only `http/https/mailto` and denies the rest; a new `will-navigate` guard stops the app frame from ever navigating away from its own content (stray/injected navigations are refused, web links go to the OS browser). A **Content-Security-Policy** is now injected into the built `index.html` (build-only, so the dev server's HMR is untouched): `script-src 'self'` (the app loads only its own bundled module — no inline, no eval), styles allow inline + Google Fonts, and **`connect-src` is limited to the loopback backend** so a compromised renderer can't exfiltrate to an arbitrary host; `object-src 'none'`, `base-uri 'self'`, `frame-ancestors 'none'`.
- **Per-engine ₹ loss-cap settings now accept the right engines.** The `daily_loss_by_engine` / `weekly_loss_by_engine` save path validated against a stale hardcoded list `(scalp, sector, hedge, flow)` — so **ORB and Screener caps were silently dropped** (they can't be keyed here) while **hedge** (its own store) and the **retired flow** engine were accepted into a dict the per-engine path never reads. It now validates against `ENGINE_KEYS` (`scalp, sector, orb, screener`) — matching the other per-engine settings — and the seeded defaults drop the dead hedge/flow keys. ORB/Screener without an explicit cap fall back to the generic per-engine sub-cap, unchanged, and can now be set in Risk → Engine Limits.
- **Intraday positions are flattened at the 15:20 MIS square-off — no overnight ghost.** The position tracker force-closed an option only on its *expiry* day; a non-expiry intraday MIS position that the ladder (SL/T1/T2/stall) hadn't closed could be carried past the broker's ~15:20 auto-square-off, leaving a phantom-open journal row — and next session's manage/exit would then fire a **naked SELL** against a position that no longer existed. A new EOD square-off now flattens **any** still-open intraday position (scalp/sector/orb) at 15:20 IST (live LTP → last cached tick → flat fallback, stuck-proof), before the broker does. Paper and live both — paper gains intraday realism; the overnight engines (Premium-Pop / Credit-Spread / Short-Vol / Hedge) run their own workers and are untouched.
- **Loss caps no longer fail OPEN during a market-hours feed outage.** `aggregate_open_mtm` marks an un-tickable position as ₹0 (it never fabricates a loss), so during a *systemic* feed stall a bleeding book read flat and the open-drawdown account cap couldn't trip — new entries were admitted on a blind book. `account_risk_ok` now fails **CLOSED**: when the feed is stale **and the market is open** while open positions can't be marked, it pauses new entries (cap unverifiable). Gated on `market_open`, so weekend/after-hours **paper testing is unaffected** (no live feed then), and a fresh feed with a single illiquid unmarked strike does not block. Because the account gate is folded into `compute_risk_state.halted` (this release), the pause applies to every entry path — manual and auto.
- **"WS OFFLINE" no longer flaps when the market is quiet.** The renderer↔backend WebSocket carries live ticks but had no keepalive, so when no tick flowed for a while (market closed, a weekend, a thin book) the pipe sat silent, an idle timeout somewhere in the path dropped it, and the status bar flashed **WS OFFLINE** — then reconnected, idled, and dropped again. The backend WS now sends a lightweight app-level **ping every 20s** when no tick is pending, so the transport stays LIVE regardless of market state (the client ignores unknown message types — the ping is a no-op there). The client's reconnect backoff is also capped at **3s** (was 15s) so any real drop — e.g. a dev reload — recovers almost immediately instead of lingering. Note: the *feed* indicator (KiteTicker upstream, sector sidebar) still reads offline outside market hours by design — there simply are no ticks then.
This release remediates the Expert-Council audit's fix-first list. **Deferred / not addressed here:** auto-update **code-signing** (blocked — needs an Authenticode certificate; the installer is currently unsigned, so a compromised feed remains the residual risk); **backend license enforcement** (accepted as UI-only for now — a separate revenue feature, not a safety fix); **`store.py` split** (a large refactor, tracked as tech-debt).

- Change type: PATCH · `sectors.orb_radar_buy` adds the existing global-LIVE guard · `main._require_api_token` fail-closed when packaged-without-token · `compute_risk_state` folds `account_risk_ok` into `halted` (additive breach key; entry-gate + display consumers only) · `account_risk_ok` fails closed on a market-hours feed outage with unmarked positions · `position_tracker._maybe_eod_squareoff` flattens intraday MIS at 15:20 · per-engine ₹-cap whitelist → `ENGINE_KEYS` + defaults drop dead hedge/flow · `aggregate_open_mtm` folds Short-Vol short-straddle MTM · Premium-Pop / Credit-Spread worst-case no-quote exit + Credit-Spread entry slippage haircut · Electron `setWindowOpenHandler`/`will-navigate` allowlist + build-only CSP meta · `market_data.upsert_candles` completed-bar guard · `kite` access-token DPAPI-encrypted at rest · `stream.ws` idle keepalive ping + `lib/ws.ts` faster reconnect backoff · no schema/API contract change · backward-compatible. Tested: py_compile + import + middleware matrix (dev-open / packaged-fail-closed / wrong-token 401 / right-token 200 / health+OPTIONS exempt) + global-mode-default guard + risk-fold behavioural (normal→not-halted, forced account block→halted with account reason + breach flag) + enumerated all `compute_risk_state` consumers = entry/display only (no exit path).

## v1.7.0 — 2026-09-07  ·  Credit-Spread paper engine (MINOR)

- **New 🦅 Credit-Spread engine** (Scalp view toolbar → popup) — a defined-risk short-vol paper engine that runs **all four flavors in parallel** for forward survivorship: **Iron Condor** (non-directional), **Bull Put** (bullish/neutral), **Bear Call** (bearish/neutral), **Iron Fly** (ATM). At 09:20 (with a late catch-up to 14:00) on the nearest weekly (DTE≥2) it opens one spread per enabled flavor: short leg N strikes OTM, protective wing W strikes beyond (offset+width selection). **Exit:** target = 50% of credit captured, SL = 1× credit loss, mandatory next-day 09:20 exit (flat fallback if a leg can't be priced — never stuck). Mark-based management (Σ short − Σ long).
- **Survivorship-first:** IV-Rank is **recorded on every trade**; the IV-Rank entry gate is **OFF by default** (maximise comparable data — later slice edge by *flavor × IV-rank*; toggle ON to restrict to validated high-IV mornings). Per-flavor tagging + a survivorship table (Trades · Win% · Net P&L · Open) with per-flavor enable/disable toggles, Auto ON/OFF, and a blinking toolbar button with the open-spread count.
- Paper only, own kill-switch, `source_mode 'credit_spread'`. NOT backtestable (weekly-held options history absent) → forward-paper validation, same as Premium-Pop / Short-Vol.
- Change type: MINOR · additive new engine + `/credit-spread/*` endpoints + new UI · no existing engine/schema touched · backward-compatible.

## v1.6.5 — 2026-09-04  ·  Premium-Pop stuck-exit fix (PATCH)

- **Premium-Pop overnight trades never get stuck.** The next-day 09:20 time-exit was skipped whenever the option leg couldn't be priced that tick (a momentary quote gap right after the open, an illiquid strike, a subscription hiccup) — leaving the position OPEN indefinitely and blocking the next day's snapshot from reading as fresh. The time-exit is now **mandatory**: it uses the live premium when available, else falls back to a flat close (cost-only), so an overnight leg always closes on the next trading day. Together with the earlier late-09:20 catch-up snapshot, the engine now survives quote hiccups and late logins.
- Change type: PATCH · `premium_pop_engine.manage` time-exit no longer requires a live quote · no schema/API change · backward-compatible.

## v1.6.4 — 2026-09-03  ·  Monthly P&L view (PATCH)

- **Performance defaults to the current month** (month-to-date) with a new **"This Month"** preset (30D/90D/1Y/…/ALL still available). A rolling 30-day default straddled two months and could read net-negative even when the account was up overall — the monthly view is the intuitive one.
- **Account card P&L strip now shows Monthly** — Daily · Weekly · **Monthly** (calendar month-to-date), computed in the risk service alongside daily/weekly.
- Change type: PATCH · report default + additive Monthly figure · no schema/API break · backward-compatible.

## v1.6.3 — 2026-09-02  ·  Account P&L tally fix (PATCH)

- **Account P&L now tallies** — the per-engine tiles on the Account card sum to the balance. **Hedge** and **Short-Vol** realized P&L were shown as their own tiles but were left out of the account total (the total counted only Scalp / Sector / ORB from the trade journal), so the tiles didn't add up to the balance. They are now folded into the total (once — no double-count, since the journal loop only sums the active journal engines). Balance, available, return %, today's P&L and the trade/win counts now reflect all active paper engines. The Performance report keeps its own scope (date-range + retired-engine history) by design.
- Change type: PATCH · `compute_paper_account` total now includes the Hedge + Short-Vol paper stores · no schema/API change · backward-compatible.

## v1.6.2 — 2026-09-02  ·  Celestial rename + Premium-Pop fix + Help refresh (PATCH)

- **Celestial (Nakshatra) naming** across the Dashboard: "Market Context" → **Market Galaxy**, Morning Brief → **🌅 Horizon** (Morning Outlook), Index Internals → **🗺 Star Map**, and the Portfolio/Cockpit analytics modal → **🔭 Observatory**. (The Scalp view's own chart "Cockpit" is unchanged.)
- **Premium-Pop late catch-up** — if the app / Kite session comes up AFTER the 09:20–09:25 snapshot window, the engine now still arms the day on the first tick up to 14:00 (base = first observed ~₹100 premium), instead of skipping the whole day. A late login no longer deads the engine.
- **Deep Research polish** — red disclaimer after the report; if every AI provider fails the popup shows the real reason and prompts for a Gemini key (no silent blank); the Market Context block is colour-coded (regime / VIX / PCR / IV / OI walls).
- **In-app Help refreshed** to match the current app — documents Nakshatra Research, the Short-Vol / Premium-Pop popups, Analyser Deep Research + BYO-key, the Observatory button, and SENSEX in Market Pulse; stale names and the retired Flow reference cleaned up.
- Change type: PATCH · rename + engine-timing fix + docs · no schema/API change · backward-compatible.

## v1.6.1 — 2026-09-01  ·  Deep Research polish (PATCH)

- **Provider failures are now visible, not silent.** If every configured AI provider fails to return a report (e.g. OpenRouter's free models are currently unavailable per-account), the Deep Research popup shows the real reason (provider · model · HTTP error) and prompts you to add a **Gemini** key (the most reliable free option, tried first in the cascade) — instead of a blank report.
- **Red disclaimer** after the AI report sections (AI research for decision support only — not financial advice / not a live signal).
- **Market Context is colour-coded** — Regime (green/red/gold), India VIX (by level), PCR (green put-heavy / red call-heavy + tilt label), ATM IV, and Call/Put OI walls now render as coloured chips.
- Change type: PATCH · Deep Research UX + provider error surfacing · no schema/API change · backward-compatible.

## v1.6.0 — 2026-09-01  ·  Nakshatra Research + central-serve + Scalp declutter (MINOR)

- **New "🧠 Nakshatra Research" view** (button in the Scalp view → full modal) — the standalone Nakshatra-Research engine's read for NIFTY/BankNIFTY, presented like Meridian's research: a colour-coded **signal** (Buy/Overweight/Hold/Underweight/Sell) with its 1D basis + price target + horizon; a **deterministic snapshot** (structure/trend/ADX/RSI/ATR/levels — Python-computed ground truth); a **multi-timeframe read** (weekly→intraday) with clickable **per-TF trade plans** (entry/stop/T1/T2, 1×ATR stop · 1.5R/3R targets); the full **agent report chain** (Market/News/Sentiment/Fundamentals · Bull/Bear · Research Manager · Trader + deterministic risk-check · Risk Debate · Final + deterministic target-validation) rendered as rich markdown; a **📝 Paper** auto-trade track (per-TF forward paper P&L / win% / open trades, scale-out ladder); and **PDF export**. Research / decision-support only — deterministic risk gates are authoritative; the AI never overrides them and no order is ever placed.
- **Central-serve** — the research engine + its LLM key run only on a central machine, which publishes result JSON to the download server; clients simply **fetch** the published research over HTTP (no key, no engine on the client). Read-only API: GET `/research/snapshot` (composite snapshot the engine consumes) + GET `/research/output` / `/research/list` (a bridge that reads the local dir on the central machine, else the remote server). No existing logic changed; the engine runs as a fully separate process.
- **Scalp view declutter** — Short-Vol and Premium-Pop no longer take permanent space; each opens in its **own popup** from a toolbar button that **blinks independently** (with a live count) whenever that engine holds an active trade, each showing win rate · R:R · net P&L · open trades. The Scalp paper account stays visible, full-width.
- **Analyser: Research on the Verdict tab + Deep Research popup.** The Verdict tab shows a one-line reconciled Research read (deterministic stance + a **verdict-alignment** check so the Analyser verdict and the research stance never silently contradict — divergences are explained, e.g. "Analyser BUY, Research NO-TRADE: R:R below gate"). A **🔬 Deep Research** button opens a popup with the full deterministic read (Tier-1 verdict, multi-timeframe bias ladder, options/regime/breadth context) **plus** an optional full multi-agent LLM report.
- **Deep Research is BYO-key + multi-provider.** Bring your OWN free AI key (Gemini → Groq → OpenRouter → OpenAI cascade); the full report chain (Market/News/Sentiment/Fundamentals · Bull/Bear · Research Manager · Trader · Risk · Final) then runs in the backend for **any stock** on demand. Keys are entered masked and stored **encrypted on your PC (Windows DPAPI)** — never uploaded, never shared, and never returned to the UI in plaintext. Indices (NIFTY/BankNIFTY) still use the zero-key central-serve research. The instant deterministic Confluence Scorer is ported into the backend (`GET /research/score`); deep LLM research is `POST /research/deep`; keys via `/research/keys`.
- **Dashboard: "Portfolio" renamed "🎛 Cockpit"** (same Trader-DNA & analytics view).
- Change type: MINOR · additive read-only endpoints + new/relocated UI · existing trading logic untouched · backward-compatible. The research modal shows "run the engine" until the central engine has published results.

## v1.5.75 — 2026-08-27  ·  Premium-Pop trades panel (PATCH) + version baseline → 1.x

- **Version baseline moved to 1.x** (production/stable). Was 0.5.75; the number is otherwise unchanged (1.5.75). Semantic-versioning continues from here (next PATCH 1.5.76, MINOR 1.6.0, MAJOR 2.0.0). No functional or behavioural change from the major-number bump; in-app auto-update still applies normally (1.5.75 &gt; 0.5.74).
- **Premium-Pop now has a LIVE + HISTORY trades panel** beside its card (mirrors the Short-Vol Trades panel): live open legs (entry/SL) and closed history with per-trade P&L, points and WIN/LOSS. Fills the empty space next to the Premium-Pop card.
- Change type: PATCH · additive UI on existing `/pop/positions` data · no backend/API/schema change · Short-Vol layout untouched · backward-compatible.

- **Premium-Pop now has a LIVE + HISTORY trades panel** beside its card (mirrors the Short-Vol Trades panel): live open legs (entry/SL) and closed history with per-trade P&L, points and WIN/LOSS. Fills the empty space next to the Premium-Pop card.
- Change type: PATCH · additive UI on existing `/pop/positions` data · no backend/API/schema change · Short-Vol layout untouched · backward-compatible.

## v0.5.74 — 2026-08-27  ·  Premium-Pop paper engine (new)

- **New "Premium-Pop" paper engine** (NIFTY + BankNIFTY, Scalp view). At 09:20 it finds the ~₹100-premium CE and PE on the nearest weekly with ≥2 days to expiry, watches both, and paper-buys whichever premium pops **+50%** — stop-loss at 50% of entry, exit next day 09:20. Leg mode is switchable: buy only the **first** leg to pop, or **both** if both pop. Independent kill-switch; runs paper-only.
- **Honest note:** this strategy holds overnight, but the only option history available is single-day (0-DTE), so it **cannot be backtested** — the engine is forward-paper only and its panel reads as an accruing track record, not a validated edge. It must clear the usual paper bar before any live consideration.

## v0.5.73 — 2026-08-27  ·  Basket capital-based sizing

- **Basket now sizes by capital, not a fixed slot count.** You set the basket capital (default ₹5,00,000); the basket invests at most `capital ÷ hold-days` (~₹25k/day for a 20-day hold) and never lets total deployed exceed the capital. It **self-recycles** as positions close — so it can't stall abruptly the way the old 15-slot cap did once it filled. Positions are conviction-weighted (higher N-Score gets more ₹).
- **New "Capital sizing" panel** — shows Capital, Deployed (+utilisation%), Available, Daily budget, and Invest-today, so you can see exactly how much the basket will deploy each day.
- **Real share quantities** — each position's ₹ size is now computed and stored at entry (was a client-side what-if). The Basket ₹ box is saved to the backend and drives the actual sizing. Existing positions are back-filled automatically on first load.

## v0.5.72 — 2026-08-26  ·  Morning Brief fix

- **Fixed: Morning Brief showed a raw error page instead of the brief.** It was loaded by URL in a frame, which can't send the app's security token, so the token gate (added in v0.5.64) rejected it. The brief is now fetched with the token and rendered in place — it opens correctly again, with a clear loading/error state.

## v0.5.71 — 2026-08-25  ·  Short-Vol engine fix (was permanently dormant)

- **Fixed: the Short-Vol candidate could never become eligible.** The 60-day IV-Rank history was seeded only when its table was empty, but the daily live-IV recorder wrote the first row first — so the ~1,255-day historical seed never loaded, IV-Rank stayed blank, and the engine was stuck "NO-TRADE" forever. Seeding now backfills the history regardless (without overwriting live rows). Existing installs are healed automatically on next start; IV-Rank now computes and the engine will fire whenever IV-Rank ≥ 70 on a non-expiry day.
- **Clearer Short-Vol panel** — shows how many of the last 60 days were eligible and the last eligible date, and explains that dormancy in calm markets is by design (the edge only exists on high-IV days, ~1 in 5). So a quiet reading no longer looks broken.

## v0.5.70 — 2026-08-20  ·  Basket P&L — All vs Today

- **P&L All / P&L Today toggle** — the basket can now show either lifetime P&L (since entry) or *today's* P&L: open names marked from the previous close to the live price, plus any positions closed today (realized). Both the ₹ tiles and the open table switch with the toggle.
- **Faster basket load** — open positions are now priced with a single batched quote instead of one call per name, which also feeds the "today" previous-close. This is much friendlier to the new Kite rate-limiter (quote ≈ 1/s) — a multi-name basket no longer serialises into a slow load.

## v0.5.69 — 2026-08-20  ·  Positional basket ₹ P&L

- **Basket shows money, not just percent** — every open and closed name now shows its ₹ P&L alongside the %, plus per-name shares and amount invested.
- **Closed grouped by exit date** — closed positions are rolled up per day (with that day's ₹/% P&L); click a day to expand its individual trades.
- **Live + Closed P&L totals** — the stats strip adds a "Live P&L (₹)" and "Closed P&L (₹)" tile, each with amount and percent; the open basket also shows total Invested / Current / P&L.
- **Fixed missing share qty on high-priced names** — a name like BAJAJ-AUTO (~₹11,700) was rounding to 0 shares at a small basket size, hiding its qty and P&L; every position now shows at least 1 share, and the default basket size is ₹5,00,000 for realistic counts. Closed P&L is realized (locked at exit) — it does not change; only the ₹ figure scales with your basket-size what-if.

## v0.5.68 — 2026-08-20  ·  Kite rate-limiter + chart fixes

- **Central Kite rate-limiter** — all price/candle reads now pass through a shared, process-wide pacer so the app's many background workers can never collectively exceed Zerodha's per-second API limits. The app was tripping Kite's "Too many requests" ~150× (historical) and ~35× (quote) — causing brief blank charts, stale Market Pulse cells and occasional ADX gaps. Historical paced to 2.5/s, quotes to 1/s (just under Kite's caps); order/position calls stay ungated (latency-sensitive). Tunable in rules.py.
- **Preview chart no longer squeezed** — CE/PE and sector buy previews open on the last ~120 candles at a readable width (was cramming ~3 days of 1-min bars into the pane); scroll back for history, live bars follow the right edge.
- **Charts never flash blank on timeframe switch** — switching m/3m/5m/15m keeps the last chart visible while the new data loads; empty/failed loads now show a clear message + Retry instead of a silent blank canvas (scalp + sector preview modals).
- **Full window title** — the title bar now reads "AVATARA NAKSHATRA · Indian Market Terminal".

## v0.5.67 — 2026-08-19  ·  Hygiene cleanup (audit P2)

- Removed dead/orphaned research code; corrected stale in-app documentation.
- Backtest calendar-expiry fix (weekly Thursday → Tuesday from 2025-09-01) for the net-P&amp;L study.
- Internal: the app version now has a single source (package.json) so it can no longer drift between screens.

## v0.5.66 — 2026-08-19  ·  Edge-safety &amp; hardening (audit P1-B)

- **Validated-edge live guard** — only edges validated out-of-sample (short-vol, BankNIFTY hedge) can ever auto-execute LIVE; scalp/sector/ORB/confluence are held to PAPER even under the global LIVE switch. Add an engine to the allow-list only after validating it.
- **Confluence engine de-armed** — it dispatched on PDH/PDL/CPR location setups that have no backtested edge; now off (still paper-wired for observation).
- **API secret encrypted at rest** — your Kite API secret is now stored with the OS keystore (Windows DPAPI) instead of plaintext; existing secrets are migrated automatically on first launch.
- **More honest backtests** — the option backtests now use the real calendar expiry (a mislabeled column had made the DTE filter a no-op), and the scalp/flow P&amp;L model now includes transaction cost + theta decay instead of reading cost-free.

## v0.5.65 — 2026-08-19  ·  Honesty &amp; consistency (audit P1)

- **Consistent engine labels everywhere** — ORB trades now show as "ORB" (not "Scalp") in the Journal and Performance; one shared engine name/colour map across Journal, Performance and Portfolio.
- **Retired Confluence/Engine mode fully hidden** — it can no longer be opened via the Navigator or a signal jump.
- **Low-sample warnings** — Short-Vol and IV-Rank paper stats now flag when the sample is too small to read as a track record; the Scalp context strip is labelled "context, not a signal".
- **Honest engine docs** — internal wording corrected so it no longer describes the Confluence location setups as "the edge" (they have no backtested edge; paper-only).

## v0.5.64 — 2026-08-18  ·  Security &amp; safety hardening (audit P0)

- **API is now authenticated.** The local backend requires a per-session token on every request — a stray web page open in your browser can no longer reach the trading API on 127.0.0.1.
- **Manual order-path safety** — the naked-short guard, fill-reconciliation, and the global LIVE-arm check now also cover the manual entry/exit endpoints (previously only the auto engines had them); qty must be &gt; 0.
- **Crash resilience** — the backend now auto-restarts if it dies unexpectedly, and writes a rotating log file so incidents are diagnosable.
- **Stale-data guard** — the Screener now warns when its stock warehouse is out of date instead of silently showing frozen technicals.

## v0.5.63 — 2026-08-18

- **Portfolio → Dashboard popup** — Portfolio is no longer a top-level tab; open it from the "📊 Portfolio" chip on the Dashboard (full-screen popup).
- **Portfolio numbers fixed** — equity / return% / drawdown now use the real paper-account starting balance from the DB (was a hard-coded ₹10L base), computed over the trades actually in the DB.
- **Performance-by-instrument** — long list now scrolls (capped height + sticky header) instead of stretching the page.

## v0.5.62 — 2026-08-18

- **Portfolio view (new tab)** — "Trader DNA" 6-factor radial-bloom profile (Hit Rate / Profit Factor / Payoff / Expectancy / Discipline / Frequency), inferred trading style + auto tips, 8 KPI tiles, and 12 analytics panels (equity curve, drawdown, PnL by IST-session/weekday/hour, hold-time dist, monthly, long-vs-short, streaks, best/worst, per-instrument + recent with Engine column). Per-engine filter; realized/backward-looking framing (no edge claims).
- **OI Bias panel** — live intraday CE-OI vs PE-OI (Spider-style) in Market Analysis, with 1m/3m/5m/15m/30m/1H timeframes and per-minute hover tooltip. Context only (crossover has no backtested edge).
- **Short-Vol** — trades now surface everywhere like hedge (Journal / Performance / Report / Account tile) via mirror-to-journal; new Live + History trades panel in Scalp. Config confirmed optimal (IV-Rank≥70, 09:20→10:40, no PCR/wings/stops) by an OOS optimization sweep.
- **Screener** — Growth-Leader + Monthly-Oversold-Quality presets over the wider warehouse; sector coverage backfilled 28%→95%; MCap + EPS-CAGR columns; oversold rows now fully enriched (N-Score/S-Trend/RS/SecRk).
- **RSI fix** — app-wide switch to Wilder's RSI (matches TradingView; corrects the monthly-RSI mismatch).
- **Positional basket** — no longer trades on market-closed days or re-enters the same open symbol.
- **Cleanup** — retired Flow engine removed (no backtested edge); ChainMap kept.

## v0.5.61 — 2026-08-15

**Short-Vol engine + cockpit (Scalp view) — new, research-validated, paper-first**
- **IV-Rank(60d) implied-side signal**: today's 09:20 ATM IV vs its own trailing-60-day distribution. `eligible = IV-Rank ≥ 70 AND non-expiry`. This is the ONLY validated intraday edge from the full NIFTY edge-discovery program (7 hypotheses tested; conditioning the variance-risk-premium on high IV-rank is what makes it harvestable). New `/iv-rank/*` API + seeded from a bundled 5-yr ATM-IV series (no 34 GB dependency on the client).
- **Short-Vol paper engine**: on an eligible day, 09:20 SHORT the ATM straddle → 10:40 **time-exit** (no stop, no wings — both proven harmful/uneconomic in forensics). A3 position-sizing (lots so a P99-loss day ≈ 0.2% of capital), independent kill-switch, `source_mode='shortvol'` (isolated from scalp/sector/orb). **Paper only; default ON for forward validation** — turn off anytime (choice persists).
- **Scalp-view cockpit card**: live IV-Rank gauge + eligibility + expiry/entry/exit + engine ON/OFF + kill + open position + paper P&L. Direction-neutral. The IVS-EXP realized-range panel remains a **separate risk context**, not an entry gate.
- Also bundles **nscore_positional v2** (consolidated positional edges).
- Note: forward paper-validation is required before any live capital (recent-year edge softness is an open question the paper run will answer).

## v0.5.60 — 2026-08-14

**Screener — backtest-driven upgrades**
- **N-Score retuned (v2b)**: composite is now Trend 50 + Momentum 40 + Volume 10. A bucket forward-IC study found the Freshness bucket anti-predictive (t≈−4.5) and Fundamentals ~0, dragging the old score's edge to zero; the retune lifts the top-vs-bottom decile spread from +0.77% (t1.22) to +2.45% (t3.49) at 40d. Freshness & Fundamentals are now shown as tags, not scored.
- **New 🎯 Setup column + "🌀 Pullback Leader / Coil" preset** — the backtest-validated EARLY entry (stacked uptrend + 6-mo momentum + riding the EMA20 ±3% + upper 52W range; +~1% excess/40d, t≈4). Catches leaders before the breakout (complements the late Momentum-Breakout).
- **New vsEMA20 column** — % from the 20-EMA (the pullback entry zone).
- Removed 4 low-value/redundant columns (Gap%, Base, 52W↓, Div%).
- **Cold-scan fix**: the first Screener scan after a restart no longer stalls — it uses the warehouse-confirmed Supertrend (fast, non-blocking, and more correct: read off closed bars) instead of triggering a live universe-wide scan; per-symbol result cached daily.

## v0.5.59 — 2026-08-13 (hotfix)

- **Fixes login broken in 0.5.58**: `app.core.kite.login_url()` was accidentally removed while adding the token-reset helper, so "Login to Kite" raised `module 'app.core.kite' has no attribute 'login_url'`. Restored. (reset_kite retained.)

## v0.5.58 — 2026-08-13

**Safety (P0) — live order-handling hardening**
- Blocked a naked-short path: a live-labelled scalp row with no broker BUY can no longer fire a SELL; scalp auto is structurally paper until a real live path exists.
- Broker SELL failure now KEEPS the position open + retries (was: journal closed while position stayed live).
- Fill reconciliation on live BUYs — entry price + qty now taken from the actual fill (no more phantom price / oversell on partials).
- Liveness watchdog: detects dead Kite token / frozen feed, auto-resets the client + rebuilds the ticker, and blocks NEW entries on stale data (exits unaffected). Surfaced in /health.
- Aggregate cross-engine cap: new entries halt when realized + open unrealized MTM breaches the account day cap.

**Reliability (P1)**
- All DB paths now resolve to absolute backend-anchored locations (fixes a wrong-CWD writing to the wrong ./data DB); market_data.db on WAL; worker supervision auto-restarts dead daemon threads (fixed a sector-worker double-spawn on re-login).

**Data & research (P2/P3)**
- Complete EOD sync at 15:40: equity + index/sectoral + breadth + fundamentals + option-chain snapshot. Fundamentals now from screener.in (24yr history, point-in-time).
- New Regime Engine (daily macro: trend/vol/risk/rotation) + a buy-the-fear breadth-washout alert; regime chip in the scalp scanner; timescale labels across market widgets.

## v0.5.57 — 2026-08-11

**Hedge — far-leg staleness fix (unblocks manual + auto calendar entries)**
- The calendar-spread entry guard rejected an entry if either leg's last on-exchange trade was older than 90s (a real protection against building a spread on a dead/pre-open price — the 2026-07-21 phantom-spread bug). But the **far (next-month) leg is structurally illiquid** — 2-3 minutes between prints is normal in a live session — so legitimate manual entries (and any auto entry when a signal fires) were wrongly blocked as "stale far leg … dead price". The far leg now gets its own **5-minute** freshness bar; the liquid near leg stays strict at 90s. A genuinely dead leg (prior-session close) is hours stale and still caught.

---

## v0.5.56 — 2026-08-11

**Engine risk tuning — scalp / sector / ORB (all backtested)**
- **Scalp:** SL/T1/T2 are now **%-based on premium** instead of fixed points. A fixed 15-pt stop was a 2.5% noise-stop on a ₹500 BANKNIFTY premium (churned by the bid-ask) and a 32% mega-loss on a ₹40 NIFTY premium — percentages hold the risk:reward at every premium. **T2 widened 2.0R → 2.5R** (3yr / 4,626-trade backtest: wider captures the directional tail the trail already protects the downside of; tighter T1/T2 *reduced* the edge and was rejected). **Stall arm 12 → 10 min** (cuts a dead trade to ~−0.3R sooner). 1R = 10%, T2 = +25%.
- **Sector:** added a **multi-day stall**. A sector position that hasn't moved +0.5R after ~3 days now has its stop pulled toward break-even, so a going-nowhere hold (e.g. one that sat 4 days to −25%) exits near-BE instead of a full stop — and stops bleeding theta. Backtested +ve on 11yr of daily data, directionally and on theta. T2 kept at 2.0R (widening only adds theta on multi-day holds).
- **ORB:** was mistakenly using **sector's wide multi-day risk** (SL 25% / T2 2R / no stall) even though ORB is an **intraday** opening-range breakout. Backtest (26 F&O stocks, 10.4k breakouts, 2yr 5m) showed that combo had ~zero edge; ORB now uses its proper **intraday** risk — tight SL (10%), 2.5R target, 10-min stall — lifting it to a clear positive, OOS-robust edge. (ORB is paper-first / off by default.)

---

## v0.5.55 — 2026-08-11

**Signals freshness = real cross only + daily-candle auto-sync**
- **Freshness counts only from a genuine cross.** The Dual-Supertrend freshness (Nc / 🔥) now measures candles since the last real **red↔green** flip. A brief "mixed" wobble (one Supertrend flipping for a candle or two inside an established trend) no longer resets the count to a fake-fresh `1c` — only crossing all the way to the opposite alignment does. So `🔥 1c` now means a stock genuinely just crossed, not that it hiccuped.
- **Daily-candle warehouse auto-sync.** The warehouse's daily candles could drift stale (found frozen months back), which silently fed old data to every daily technical — Supertrend, RSI, ADX, N-Score technical, RS, 52-week, AVWAP — even though the live price looked correct. New forward top-up keeps it current:
  - **Automatic:** runs once per day after the 15:30 close (≥16:05 IST), skipping weekends/holidays, so the next session opens on fresh data.
  - **Manual:** a **⟳ Candles** button in the Screener toolbar (next to ⟳ Data) tops-up on demand and re-scans when done — best clicked after the close.

---

## v0.5.54 — 2026-08-10

**Scanner S-Trend fix — matches the chart**
- The main Scanner's daily Supertrend column now uses the **live daily bars** (the same source as the chart and the Signals tab), not the periodically-rebuilt daily warehouse — which could be several sessions stale and, because Supertrend is path-dependent, disagree with the chart near a flip (e.g. BSE showing green while the chart was red). It's cached + background-refreshed, with a warehouse-confirmed fallback (today's forming candle excluded) so the column is never blank while the live scan warms up.

---

## v0.5.53 — 2026-08-10

**Main Scanner — inline Daily Supertrend column** (re-release of the v0.5.52 update under a clean version — the same-version overwrite broke the auto-updater's checksum, so this ships it properly).
- The main N-Score Scanner now has an **S-Trend** column: daily Dual-Supertrend state (🟢 both green · 🔴 both red · ⚪ cross) plus freshness (Nc candles since the flip, 🔥 for fresh). Computed free from the daily bars the scanner already loads — sortable to surface the freshest flips across all 531 names. (The ⑆ Signals tab keeps the intraday 15m/1h/4h view.)

---

## v0.5.52 — 2026-08-10

**Signals scanner — universe toggle + signal freshness**
- New **Universe** toggle: **F&O** (~216, options-tradeable) or **All 500** (~531 nifty500, incl. cash-only names).
- Each name now shows **how many candles ago the dual-Supertrend flipped** (Nc) — the lists are sorted freshest-first, with a 🔥 on flips in the last 2 candles. Fresh alignment is far more actionable than one that's been green/red for dozens of bars.

**Main Scanner — inline Daily Supertrend column**
- The main N-Score Scanner now has an **S-Trend** column: daily Dual-Supertrend state (🟢 both green · 🔴 both red · ⚪ cross) plus freshness (Nc candles since the flip, 🔥 for fresh). Computed free from the daily bars the scanner already loads — sortable to surface the freshest flips across all 531 names. (The ⑆ Signals tab keeps the intraday 15m/1h/4h view.)

---

## v0.5.51 — 2026-08-10

**Signals scanner → full F&O (background)**
- The "⑆ Signals" Dual-Supertrend scanner now covers the **full F&O universe (~216 names)**, up from 27 liquid leaders.
- Runs as a **throttled background scan** (~2.5 req/s, well under the broker limit) and caches per timeframe at its bar cadence (15m→15min, 1h→30min, 4h→60min, 1d→3h). The UI reads the cache instantly and shows "scanning…" during the first pass (~1-2 min); each name is fetched once per bar period, not per view — so no rate-limit issue.

---

## v0.5.50 — 2026-08-10

**Screener → new "⑆ Signals" scanner (Dual Supertrend + ORB)**
- A display-only scan of liquid F&O names: lists **Both-Green** (bullish) and **Both-Red** (bearish) Dual-Supertrend (10-2 & 7-3) names at a selectable timeframe (**15m / 1h / 4h / 1d**), with an **ON/OFF** switch.
- Optional **ORB filter** (first **5m / 15m / 1h**) keeps only names that also broke their opening range in the same direction.
- Watchlist / filter tool — click a name to analyze. Not a validated auto-trade signal (kept scan-only by design).

---

## v0.5.49 — 2026-08-10

**Sector + ORB trades unified, closed-trade fixes**
- The Sector view now shows **Sector and ORB (Radar) trades in one combined list** with a single total count and one Close-All (they share the sector desk; engine caps stay separate). No more split section.
- ORB trade charts now show the **underlying share + the option** side-by-side (like sector), not just the option.
- A **carry-forward position that closes today** now stays in the journal — added a closed-today feed so it isn't dropped from both the today-entries and open feeds.
- **Closed-trade chart header now shows the realized exit P&L** (exit price + booked ₹), not a fake "live" P&L computed off the still-ticking option premium.

---

## v0.5.48 — 2026-08-08

- **2FA setup now shows a scannable QR** — point Google Authenticator / Authy at it (＋ → Scan a QR code), with the manual setup key kept as a fallback.
- **Intraday Radar (ORB) trades now show** in the Sector view — a new "🚀 Today's Radar (ORB) Trades" section (open + closed + live chart + Close-All). They were hidden after ORB got its own `source_mode='orb'` tag; the sector panels only listed sector trades.

---

## v0.5.47 — 2026-08-08

**LIVE-gate 2FA (Google Authenticator)**
- The master PAPER→LIVE switch can now be protected with TOTP 2FA. Set it up in Risk → ⚙ Settings → "🔐 LIVE Gate · 2FA" (add the setup key to Google Authenticator / Authy, confirm a code). When ON, flipping to 🔴 LIVE requires the current 6-digit code — the backend verifies it before the gate opens (local state won't flip on a wrong/missing code). Pure-stdlib TOTP, no new dependency.

**Screener basket — manual close + rolling capacity**
- Each open paper position now has a **✕ Close** button, plus **✕ Close All**, closing at the current market price (best clicked in market hours).
- The positional basket is now a proper **rolling** book — concurrent cap raised to 40 (≈ 2/day × 20-day hold) and always multi-position, so it keeps taking the freshest signals daily instead of freezing for a full hold once full.

**ORB — take all the top breakouts**
- ORB auto now runs multi-position and enters the **top 3-4** strong-sector opening-range breakouts (ranked by sector momentum), not just the first one. Cap 4 = the backtested edge zone (ranks past that are noise).

---

## v0.5.46 — 2026-08-06

**Screener positional basket — richer open positions + conviction sizing**
- Each open paper position now shows **Live price · Live P&L% · Age (held/target) · Size**. Live P&L marks each name to the current price.
- New **conviction Size** column — position weight ∝ N-Score (backtest: higher N-Score earns materially more, Q4 +4.86% vs Q1 +1.78%), with a "Basket ₹" what-if input that turns the weight into a share qty per name.
- Confirmed via honest backtest (entries fixed, exit varied): a priced stop-loss / take-profit **hurts** this edge — the pure ~20-day time-hold is best — so the basket deliberately has no SL/TP. Only conviction sizing was added.

---

## v0.5.45 — 2026-08-06

**In-app docs refreshed everywhere**
- Help / Guide, the Navigator assistant, and the Dashboard now reflect the current engines and features: ORB is live-capable (not paper-only), charts use EMA20/EMA50/SMA200 + Dual Supertrend, the verdict shows the Pullback-to-EMA20 read + Supertrend badge, concurrency is per-engine (no global multi-position toggle), Close-All exists, and Flow is retired. Removed the stale "Flow" engine chip from the Dashboard.

**Report & Backtest cover more engines**
- **Report** now has an **ORB** engine filter and a new **Screener** tab (N-Score positional paper basket — closed/win%/avg-return/open + trades). The By-Engine roll-up already groups every engine that traded.
- **Backtest** adds a **Hedge** tab — the calendar-spread mean-reversion walk-forward (overall metrics + train/test split + trades) for BANKNIFTY/NIFTY.

**Per-engine controls (from v0.5.44, now surfaced end-to-end)**
- Unified Risk "Engines" panel: per engine — auto ON/OFF + paper/LIVE + kill-switch + multi-position caps. ORB gained its own paper/LIVE mode + kill-switch.

---

## v0.5.44 — 2026-08-06

**Dual Supertrend on every chart**
- Dual Supertrend overlay (ST1 10-2 **bold**, ST2 7-3 normal) now draws on all charts — Scalp, Sector, Equity Analyzer, cockpit, previews. Global **⑆ ST** toggle to show/hide.
- Analyzer verdict shows a **non-scoring** Dual-Supertrend badge (both green / both red / mixed). Backtest showed it's redundant with the EMA20/SMA200 verdict and shorting both-red loses in Indian equities, so it's a visual confirm only — the score is unchanged.

**Per-engine multi-position caps**
- Each engine (Scalp / Sector / ORB / Screener) now has its own **multi-entry ON/OFF toggle** + editable **max concurrent** and **max daily** limits, in Risk → ⚙ Settings → **Engine Limits**. Multi-entry OFF = one position at a time (current behaviour, default).
- ORB trades are now tracked independently (`source_mode='orb'`) with their own BE-only trailing tracker, separate from Sector.
- **Risk panel reconciled** — position/trade counts are now controlled per-engine end-to-end: the Status panel's new **Engine Caps** card, the Settings caps, and the backend entry gate all show and enforce the same numbers. Account-wide ₹ loss caps stay as-is.

---

## v0.5.43 — 2026-08-05

- Analyzer verdict + chart switched to **EMA20 / EMA50 / SMA200** (backtested best mix), added the positional **pullback-to-EMA20** read, Intraday **Radar (ORB+sector)** section with manual buy, sector/scalp **Close-All** with live P&L, and slippage fixes on Close-All exits.

---

## v0.5.42 — 2026-08-02

**Login screen fix**
- The Kite auth / login screen now uses a wide 2-column layout (market/requirements/founder on the left, the login steps + Submit on the right) so all content fits the screen without the bottom getting cut off — same content, half the height.

---

## v0.5.41 — 2026-07-30

**Screener export fix**
- Excel/PDF exports now round numbers to 2 decimals (no more raw floats like 26.43366 / 28.9999999).
- All export table headers are centre-aligned.

---

## v0.5.40 — 2026-07-30

**Screener UX**
- The composite score is now branded **N-Score** (Nakshatra Score) everywhere.
- Clicking a stock now opens the full **Analyzer in an 80%-viewport pop-up** instead of navigating
  away — the screener list stays put behind it.
- **⬇ Excel (CSV)** and **⬇ PDF** exports of the visible (sorted / filtered / watchlist) rows.
- Auth + Credentials cards widened (the startup / connect screen is roomier).

---

## v0.5.39 — 2026-07-30

**Screener v2 — big upgrade**
- **Sector-rotation rank (SecRk)** column + a new **Leaders in Leading Sectors** preset — ties
  the screener to the one proven edge (sector rotation); the swing cousin of ORB.
- **Preset forward-edge badges** — each preset chip carries a ✓ (real forward return, t≥2) or ⚠
  (measured, no edge) from a mini-backtest, so you see which screens actually work (fundamental/RS
  presets show n/a — can't be point-in-time replayed).
- **New columns:** RS-NH (RS-line new high), Gap%, 52W↓ (distance below the high), weekly RSI/ADX,
  ATR%, D/E. Plus the composite Score column and 📌 Top Picks already shipped.
- **⚙ Custom filters** — build a min/max screen on any column, stacked on the active preset.
- **⭐ Watchlist** — star any row to a personal list (saved locally); a chip filters to just those.

**Docs**
- Navigator + Help/Guide refreshed for the Screener v2, the ORB engine, and the current engine set
  (Scalp / Sector / Hedge / ORB — Flow retired). New ORB guide section.

---

## v0.5.38 — 2026-07-30

**ORB 5m + sector — new PAPER engine**
- New 🚀 ORB engine in the Auto-Trade Control (paper-only, off by default). Fires a
  paper sector entry when a stock in a strong (top-3) / weak (bottom-3) rotation sector,
  above/below its SMA20, breaks its first-5-minute opening range in the aligned
  direction. Backtested edge: plain ORB loses, but ORB gated by sector rotation flips
  positive and holds out-of-sample (5m: full t2.80, OOS t2.36, win 56.5%). Paper-first
  while the live/option-P&L edge is confirmed. Trades tag as "ORB5+SECTOR".

**Screener**
- New **Score** column — composite quality 0-100 (Trend + Momentum + Freshness + Volume +
  Fundamentals), colour-graded, hover for the breakdown. Default sort by Score,
  top-quartile rows tinted, plus a **📌 Top Picks** strip (best 5). Ranking aid, not a
  buy signal.
- **⟳ Data** now runs the FULL fundamentals sweep (every stale symbol), so PE / ROE /
  Div% / Sector fill in one pass instead of 60/night.

**Signal log**
- Retired **Flow** rows are hidden from Performance → Signals (and the engine filter),
  so old Flow history no longer reads as "still firing".

**Open-trade / chart price — now live like the share**
- The option chart/header/card used to freeze because the option symbol wasn't
  subscribed to the WS ticker (only at entry, lost overnight / across a restart) while
  the share stayed subscribed via the sector scan. The position tracker now re-ensures
  every open position's option is subscribed each cycle, so options stream live ticks
  exactly like the share. Belt-and-braces: the trade chart also silently re-fetches
  candles every 20s, and the option header falls back to the server-resolved LTP / last
  candle when a tick is momentarily absent — so the LTP and P&L% never sit stale.

---

## v0.5.37 — 2026-07-30

**Open position LTP fix**
- Open position cards were stuck at the entry price when the client had no live
  WebSocket tick for that option symbol (e.g. an overnight sector position whose
  option isn't re-subscribed to the ticker on a fresh session) — the chart showed
  the true price via REST while the card showed entry. `/trades/open` and
  `/trades/today` now attach a server-resolved live `last_price` (WS → REST quote,
  the same source the position tracker uses to trail the SL), and the card falls
  back to it when no WS tick is present. Unrealised P&L on the card is now correct.

---

## v0.5.36 — 2026-07-30

**Trade journal fix**
- Overnight open positions now show in the trade journal again. The panel fetched
  only `/trades/today` (filtered by entry date), so a position opened on a prior day
  and still open dropped off the list — even though its chart (which reads
  `/trades/open`) kept showing it. The list now merges today's trades with all open
  trades, so any still-open position renders regardless of entry date. Purely a
  display fix — the position tracker always managed these trades by source_mode, so
  SL/target trailing was never affected.

---

## v0.5.35 — 2026-07-29

**Stock Screener (new top-level tab)**
- The Screener is now its own tab in the left nav (no longer a toggle inside the
  Analyzer — that felt mixed/congested). Full-screen scan of the ~523-stock F&O +
  large/mid-cap universe over a nightly daily-bar warehouse.
- Click any row → deep-dive in the Analyzer (cross-tab hand-off); 📈 for its chart.
- New **AVWAP↑** column — % above the anchored VWAP from the 52-week low (🟢≤6% fresh ·
  🟡≤15% early · 🔴>15% extended) plus **Base** = candles since that 52W low. Tells you
  at a glance whether an entry is fresh or already stretched. Both sortable.
- Presets: RS Leaders, Breakout, Oversold, Trending, Momentum (RSI≥55+ADX≥25+EMA
  golden-cross), Value, Dividend, Quality Momentum. Live-LTP overlay when market open.

**Backtest**
- **Scalp + Sector backtests now take a From→To date range** (not just one day).
  Leave From blank for a single-day replay; set it (or use the 1W/1M/3M quick buttons)
  to replay the whole window and see aggregated trades, win%, net points and one
  combined equity curve. Each trade/signal is tagged with its date. 120-day cap.

**Hedge**
- Close-robustness: expired-leg spreads settle via a futures-EOD/entry fallback when
  no live quote exists (stuck open spreads can now always be closed).
- Near-expiry entry guard blocks new spreads too close to expiry (even on force).
- Auto-trade is BANKNIFTY-only (honest next-bar backtest: BANKNIFTY has a robust
  calendar-spread edge, NIFTY doesn't).

**Data collector**
- Self-heal: basis runs that land 0 rows stay retryable (no more permanent stale-basis
  holes), plus a startup catch-up backfill for missed weekdays.

**Sector trade chart**
- Share + option charts side-by-side, right-click stretch, Classic/Fib pivots, header
  price + Δpts + Δ%. Relative-Strength rows are clickable → drill popup. Dashboard
  NIFTY/BankNIFTY cards update live on WS ticks.

**Flow — retired**
- Flow had no backtested edge (faithful real-option replay: −2.9%/trade). Hidden from
  the UI (nav, backtest, auto-trade, guide, navigator) and gated off in the backend;
  code retained.

---

## v0.5.34 — 2026-07-29

**Hedge**
- Open spreads now show **live mark-to-market P&L** — each open position carries `now`
  spread + running ₹P&L (green/red), with an **Open MTM** total in the panel header.
  Previously an open spread showed only its entry and no running P&L.
- **Close robustness:** exiting/squaring a spread whose leg has no live quote (an
  expired near future being the classic case) now settles at the last EOD close
  instead of failing with "no live quote". Fixes stranded positions that could be
  neither auto-squared nor manually exited.
- **Near-leg expiry guard:** entries whose near leg is within the expiry cutoff are
  blocked (even discretionary force entries) — no more calendars that strand on day one.
- **Auto-entry = BANKNIFTY only.** Honest next-bar-fill backtest (2024-2026) shows
  BANKNIFTY calendar mean-reversion has a robust edge while NIFTY does not; NIFTY stays
  available for discretionary manual entry.
- **Backtest is honest now:** the calendar backtest fills entry/exit on the *next* bar
  (not the signal bar). The old same-bar fill overstated results ~4x and produced an
  impossible "100% win / 0 drawdown" — gone.

**Warehouse / data**
- The basis collector **self-heals** on startup: a 7-day catch-up backfills any missing
  weekday so the "stale basis" warning can't linger after a closed evening.
- A 0-row collection (e.g. an expired token) is no longer marked done — it stays
  retryable instead of silently locking a day out of the warehouse.

---

## v0.5.33 — 2026-07-28

- **New: "Buy anyway" on illiquid sector options.** A stock option whose bid-ask spread is wider than 5% of the premium (or with thin volume/OI) is blocked from entry — sensible for the auto-trader, but it also stopped manual discretionary buys on the less-liquid names. Manual entry (the Enter button and Manual Buy) now shows the liquidity warning and offers a **⚠ Buy anyway** — you consciously accept the wider slippage. The auto-trader stays strict.

## v0.5.32 — 2026-07-28

- **New: per-engine risk caps.** The daily/weekly loss stop used a single ₹1,500 per-engine sub-cap for everything — but a sector stock option (qty 3600) risks ~₹20k on one trade while a scalp NIFTY option risks far less, so the sector engine halted after the first small loss and manual entries were blocked. Each engine now has its own daily loss cap (Scalp / Sector / Hedge / Flow), editable in the Risk panel, with weekly derived from it. Sensible defaults ship (Sector ₹25k, Hedge ₹15k, Flow ₹10k, Scalp ₹8k daily).
- **Fix: blocked entries showed a cryptic "503 Service Unavailable".** When a risk gate stopped an entry (halt, cooldown, kill switch), the real reason was buried behind the HTTP status. Errors now surface the actual message — e.g. "Risk halt active — sector daily cap" — so you know exactly why and what to change.
- **Fix: wrong ATM strike on sector signals.** The suggested strike was computed from the *index* strike gap (NIFTY 50 or BankNIFTY, i.e. 50/100 points) applied to individual stocks — so a ₹124 stock like CANBK rounded to an ATM of 100, and BANKBARODA (₹240) to 250. The ATM is now the stock's actual nearest listed option strike (CANBK → 124, BANKBARODA → 240), with the OTM steps taken from the real strike spacing. This also fixes the option that the Enter/Manual Buy resolves from that row.
- **Fix: a stock in two sector indices showed twice.** BANKBARODA belongs to both NIFTY BANK and NIFTY PSU BANK, so it was scored once per sector and appeared as two rows. Signals now keep only the best-scoring entry per stock+side.

---

## v0.5.31 — 2026-07-27

- **New: 🔭 Radar tab in Sector Signals.** The auto-trade signal fires at score ≥ 90 — a momentum confirmation that, by the time it prints, has often already run. Radar surfaces the *building* setups earlier: a broader scan (below the signal threshold, watch tier included) of sector-aligned stocks, ranked by readiness — freshest first, then closest to their trigger (a `→Trig` column shows the distance to the day-high for CE / day-low for PE, or `✓brk` once broken). Each candidate is tagged 🟢 FRESH / 🟡 OK / 🔴 STRETCHED so you can tell at a glance whether it's an early entry or already extended, with a "hide stretched" and "sector-aligned only" filter. The 💰 on any row opens the Manual Buy preview pre-filled, so you watch on your own chart and enter on your trigger — the signal stays a confirmation; Radar is for getting in ahead of it, on your read.

- **Manual Buy polish.** The preview window is bigger, and its chart no longer opens squished — the candles now show stretched to a comfortable width by default (the most recent ~45 bars) instead of the whole thin history crammed into a corner. **Right-click the chart** for a menu: Reset zoom, Fit all bars, or Go to latest — same as the other charts in the app.
- **Sector layout — blank space filled.** Manual Buy and the Signals feed now sit stacked in the left column with Sector Strength tall on the right, so the empty area under Signals (when few opportunities pass the filters) is put to use instead of sitting blank.

- **Sector exit trail tightened (sector only).** After a sector trade hits its target and the stop trails up, it was giving back 0.75R behind the peak — so a move that peaked just above target (e.g. the 2026-07-22 BANDHANBNK 200 PE, which topped at 1.14× the risk unit) locked barely +0.4R before the pullback stopped it out. The sector giveback is now 0.6R, which locks meaningfully more at those typical peaks while still leaving room for the gamma-heavy swings sector option premiums make. Scalp and the other engines are unchanged. (This is a moderate, deliberate tune — the sample of completed sector trades is too small to claim more.)
- **Manual Buy, upgraded.** The Sector "✋ Manual Buy" panel is now a proper picker instead of free typing: start typing a stock and a **dropdown of matching F&O stocks** appears; pick one and the **strikes auto-fetch**, with the dropdown defaulting to the **ATM** strike (spot shown alongside). It also has its own **Paper / Live** switch right in the panel — you no longer have to hunt for the global toggle. **Preview** now opens a **live option candle chart** (1m / 5m / 15m) with the premium, SL and T1 marked on it, the full Greeks/OI/volume strip, and the Buy button. A live buy is a real order, so it asks for a second confirming click. Everything still enters through the sector risk gates (kill-switch, cooldowns, one-at-a-time, liquidity).

---

## v0.5.28 — 2026-07-22

- **New: Manual Buy in Sector mode.** A "✋ Manual Buy" panel now sits above the FnO Opportunities feed. Pick any FnO stock, choose CE/PE, type a strike and quantity (lots), and Preview shows the live premium, SL/T1, delta, IV, OI and volume for that option — then Buy enters it. You no longer have to wait for the scanner to surface an idea. The entry runs through the exact same risk gates as auto and opportunity entries (kill-switch, loss-streak cooldown, post-SL cooldown, one-position-at-a-time, and the liquidity check), and it respects the global paper/live toggle. (Includes everything from v0.5.27 below.)

---

## v0.5.27 — 2026-07-22

- **Fix (crash): changing the trade chart's timeframe blanked the whole app.** On the Sector (and Scalp) trade chart, switching the timeframe down from **m** to a coarser one white-screened the app. The live-tick handler re-runs the instant the timeframe changes — before the chart is rebuilt for the new interval — so it was still pointing at the old (finer) chart; the coarser time-bucket floored *below* the last 1-minute bar, and the charting library throws on any backward update. That throw, uncaught, took down the entire UI. The handler now never updates a bar backward and is fully guarded, and the historical bars are sorted/de-duplicated before they reach the chart, so no candle data can blank the app again. (Includes everything from v0.5.26 below.)

---

## v0.5.26 — 2026-07-22

- **Fix: a hedge trade held overnight read as impossible.** A calendar spread entered on 2026-07-21 at 09:07 and closed the next morning showed in the report as "2026-07-22 · 09:07 → 09:18" — an entry seven minutes before the market opens — and sorted below the previous day's trades for no visible reason. The row was stamping the *close* date next to the *entry* time. Every trade now shows its true entry day, an **overnight badge** when it was carried across a session, and the exit time carries its own date, so a multi-day hold can never read as a single impossible one.
- **Fix: the hedge trade's analysis view was blank.** A calendar spread carries spread-native detail (entry z, both legs, expiries) with none of the fields a single-leg option trade has, so the 🔍 view — which assumed an option — rendered nothing. Hedge trades now open a dedicated 🧮 Hedge Analysis view.
- **Fix: today's hedge P&L didn't match today's hedge list.** Today P&L counts a spread by the day it *closed*, but the closed-trade list only showed spreads *entered* today — so a spread carried overnight showed a non-zero Today P&L with no trade beneath it to explain it. The list now includes anything closed today, so the number and the rows always describe the same trades.
- **Fix (important): a phantom hedge "win" was inflating the numbers.** A paper calendar spread entered at 09:07 — before the open — read a fresh price on one futures leg against a stale prior-session price on the other, inventing a spread of 132.5 points (the real level was ~90) and a false signal. It "reverted" to 90 at the real open only because the entry number was fictional, booking a +₹2,568 paper win that never happened. Two guards now prevent this: **no entries outside 09:20–15:15**, and **both legs must have traded within the last 90 seconds** or the spread is refused. The two historical false signals (this one and an earlier BankNIFTY one from a stale data backfill) are marked **void** — still visible for the record, struck-through, and removed from every win-rate and P&L figure.

---

## v0.5.25 — 2026-07-20

- **New: Hedge now appears in the Performance report.** A dedicated 🧮 Hedge tab shows each closed calendar spread the way a spread actually reads — entry z, both futures legs, both expiries, spread in→out, net ₹ — and its win-rate counts only *resolved* spreads (a flat spread is neither a win nor a loss). Hedge is also in the engine filter now; the retired Engine is out of the filter but its historical trades still show under By Engine. Behind the scenes each closed spread is also mirrored into the trade journal so the unified counts include it — but its "%" there is an **R-multiple** (P&L ÷ risk reference), because a spread has no honest percentage return: 89.0 → 91.3 is +₹149, not "+2.58%".
- **Fix: a flat hedge read "LOSS, ₹0.00".** The result was decided from the raw floating-point P&L (which was −1e-13 — pure noise) while the stored number was rounded to 0.00. Label and value came from two different numbers. Any mean-reversion spread that closes near its entry lives in exactly that noise band, so every genuinely flat trade was being marked a loss. Both are now decided from the same rounded value.
- **Fix (important): the NIFTY / BankNIFTY tab never controlled what traded.** Scalp's auto-trader has always scanned *both* underlyings — the tab was only a view — so having NIFTY open on screen did nothing to stop BankNIFTY entering. That looked like exposure control and wasn't. Scalp now has an explicit **per-underlying arm** in the Auto-Trade panel (`● NIFTY` / `● BankNIFTY`), independent of whichever tab you are looking at, so switching charts can never change what is trading. Both start armed, i.e. today's behaviour, now visible and under your control.
- **Fix: one underlying's stop-loss froze the other.** The post-SL cooldown is a *whipsaw* guard — its own example is "CE stop, then PE stop on the same strike" — but it was symbol-blind, so a BankNIFTY stop blocked NIFTY for 15 minutes too. Measured on 2026-07-20: NIFTY was blocked **11 seconds** after a BankNIFTY stop, then again 4 seconds after the next one, and BankNIFTY (which signals more often) took every scalp trade of the session. The chop guard is now per-underlying. The day's actual brakes — loss-streak cooldown and the daily/weekly ₹ caps — stay **global** on purpose: a bad day should still slow the whole engine down.
- **Fix: the Signals tab under-reported scalp.** The auto-trader's own entry path never wrote a decision row, so 2026-07-20 read "0 executed / 14 decisions" while five trades were live — the executed rows came only from a separate signal-dispatch path. The worker now records what it actually did, entries and rejections both.
- **New: futures 1-minute + Open Interest collection (Data Warehouse).** Index data is permanent — Kite serves years of it on demand — but a futures contract's intraday history *vanishes when it expires*, and volume/OI exist nowhere else. So after market close the warehouse now captures 1-minute bars with OI for the front three NIFTY and BankNIFTY contracts, rolling automatically as they expire. Coarser timeframes are derived from the 1-minute base (proven identical to Kite's native bars, to the paisa), so nothing coarser needs to be stored or re-fetched.

---

## v0.5.24 — 2026-07-17

- **New: Data Warehouse now stores candles.** A `candles` table plus a backfill that pages Kite's history *backwards*. One Kite request is capped (90 days for 5m), which is why every strategy read so far was stuck at ~3 months — and why the earlier Matrix verdict rested on 38 trades and meant nothing. The backfill walks that cap back window by window: **3 years of NIFTY and BankNIFTY at 5m and 15m — 55,428 bars per symbol — fetched in 28 seconds**. Every window is an idempotent upsert, so a run can be interrupted and resumed. It lives in the user-data warehouse, so it survives updates.
- **New: Silent Observer.** Measures one strategy forward and **places no orders — there is no execution path in it at all**. It logs a signal, then books what would have happened by replaying our own 1.5R ladder over the candles. Signals recorded before the observer's first run are stored as `seed` and excluded from its verdict: that history was already visible when the strategy was chosen, so reading it back as forward evidence would be self-deception rather than a test. Only bars after it starts count.
- **Why this strategy and not the eight others**: eight public indicators were ported and measured against the 3-year history this release makes possible. All eight were rejected — see DECISIONS.md D-016/D-017 for each verdict. One configuration survived out-of-sample and is now being watched, not traded.
- **The exit ladder was measured, and it holds.** Replayed over the same entries with the same 1R against a matched 2:1 ceiling, it improved **10 of 10** signal/symbol combinations, cutting drawdown 2-5x. It cannot invent an edge — on the worst script it lifted −223R to exactly zero — but it improves every signal it touches.

---

## v0.5.23 — 2026-07-17

- **Fix: the background update download silently wedged and never finished.** Two releases in a row died partway — v0.5.21 at 25.6 MB, v0.5.22 at 8.7 MB — while the panel sat on "Downloading in the background…" forever. The cause was **differential download**: rather than fetching the installer, electron-updater rebuilds it from blocks of the *previously cached* installer and downloads only what changed. That needs the cached installer to match the running version. Ours was v0.5.1 from June 10 — twenty releases stale, because every release since was installed by hand and a manual install never refreshes that cache. So the block diff was near-total and the transfer wedged. Measured while stuck: a plain download of the same file ran at **1.44 MB/s** (the whole 183 MB in ~2 min) while the updater's temp file hadn't grown a single byte in 15 s — the network was never the problem. Differential download is now **off**: one full GET, no cache dependency.
- **Fix: a failed update was indistinguishable from a slow one.** Every handler logged to a console that a packaged app never shows, so nothing reached the screen — this is *why* the wedge went unnoticed for two days. The panel now shows a real progress bar with percent, MB, and speed; "Retry" and "Download manually" buttons appear on failure; and updater events are written to `updater.log` in the app's data folder so a future stall leaves evidence.
- **New: stall watchdog.** electron-updater emits no event when a download simply stops progressing, so nothing could tell a wedged transfer from a slow one. If no progress arrives for 90 s, the app now says so instead of waiting forever.

---

## v0.5.22 — 2026-07-16

- **Fix: chart time axis showed UTC, not IST.** Lightweight-charts renders its x-axis straight from the timestamps it's given, and three chart surfaces passed real-UTC epochs through untouched — so a 09:15 IST candle was labelled **03:45**, every bar reading 5:30 behind the market. Surfaced on the Sector trade chart, but the same component powers the Scalp trade chart, so both were wrong. The cockpit already shifted its bars into IST and was correct; the fix brings the rest in line, so every chart in the app now reads the same clock:
  - **Trade Chart** (Sector + Scalp) — bars, the live-tick candle, and the entry/exit markers all moved onto the IST axis together. The markers previously compensated for the unshifted axis with an offset subtraction; that compensation is gone now that the axis itself is right.
  - **Preview Chart** (pre-entry candidate preview) — same shift for bars and the live-tick candle.
  - **Stock Chart** (Stock Analyser) — same shift. This also fixes a **date off-by-one on daily charts**: Kite stamps daily candles 00:00 IST, which as real UTC lands at 18:30 the *previous* evening, so every daily bar was drawn on the wrong date. Session VWAP's day-bucket was re-based to match the shifted bars, so its sessions still reset on the correct IST day.

---

## v0.5.21 — 2026-07-16

- **Fix (important): Hedge could trade on a signal that never existed.** The z-score is "today's basis vs the trailing 60-day window" — but nothing checked that the window was actually *recent*. With a stale warehouse the engine happily scored today's basis against months-old history and traded the result. This fired for real: mid-backfill, BankNIFTY scored **z = −2.12** and the paper auto-entry took a spread; once the warehouse was complete the *same moment* scored **z = +0.02**. There was no signal — only a data artifact, and nothing warned. A **data-freshness gate** now runs before any z interpretation: if the newest stored bar is older than 5 days, the signal is `NONE` with the stale date and age spelled out, and z is not published at all. (The false paper position was closed at ₹0.)
- **The daily EOD collector now actually runs.** It was env-gated OFF from when the warehouse was a research side-project — but Hedging depends on a fresh basis series, so the warehouse would decay after one backfill and (with the new gate) Hedge would quietly switch itself off days later. It's now enabled in the packaged app, so the basis series stays current on its own.
- **New: Hedge P&L strip** — today's P&L + closed count, open spreads, and all-time P&L with W/L and win-rate, across the top of the Hedge view.
- **Fix: the basis chart no longer freezes.** It fetched once on mount, so while a backfill was pouring data in the chart sat on its opening snapshot and looked broken. It now refreshes every 30s.

---

## v0.5.20 — 2026-07-16

- **Fix: the Data Warehouse was wiped on every update.** The backend defaults its warehouse paths to `./data/…` — relative to the process's working directory — and the app spawns it with `cwd` set to the **install folder**, which the installer replaces on each update. So the basis history (and with it the hedge z-score) was orphaned every single time you updated, leaving "No basis history yet" and a permanently blank z-score. The trade journal survived only because `NAKSHATRA_DB_PATH` was already pinned to the user-data folder; the warehouse env vars existed but were never passed. Both are now pinned to user-data alongside the journal — **backfill once and it persists across updates.**
- **Engine removed from the Auto-Trade panel.** The 🧠 Engine arm/disarm switch is gone: its confluence read is now an optional **Scalp score modifier** (the 🧠 toggle in the Scalp toolbar), not a fourth engine taking its own positions. MASTER no longer arms it, and the "n/N armed" counter now reflects only the engines you can actually see. The backend dispatcher and EngineView stay wired so it can be restored.

---

## v0.5.19 — 2026-07-16

- **Fix: "Check for Updates" now actually auto-installs.** The background-download + "Restart Now" updater (electron-updater) has shipped since v0.5.5 and ran on the daily auto-check — but the ⚙ **Check for Updates** button was still wired to the *legacy* path: it read `update.json`, then opened the browser at the installer URL and left you to download and install by hand. The button now triggers the real updater: the installer downloads in the background (app stays usable), you get one **Restart Now / Later** prompt, and it installs + relaunches itself. Browser download remains as a fallback if the updater can't run. *(This is the last manual install — from v0.5.19 onward it's one click.)*
- **Fix: per-engine risk isolation.** The post-SL cooldown and the loss-streak counter were **global** — ANY engine's stop-loss froze *every* engine for 15 min, and any two losses (even from different engines) triggered the 30-min streak cooldown for all of them. On 16 Jul this is what silenced Scalp and Sector for most of the session: the Engine's losses kept tripping cooldowns that weren't its to trip. Both are now scoped per engine — Scalp's SL only pauses Scalp, Sector's only pauses Sector.
- **New: selectable loss-cap scope (Risk panel).** Daily/weekly caps can now be applied three ways: **Two-tier** (default — each engine gets its own sub-cap AND the account keeps an outer cap, so one engine burning its budget doesn't freeze the others while total account risk stays bounded), **Per-engine** (each engine gets the full cap, no account stop — the panel warns that the account can then lose engines × cap in a day), or **Global** (legacy shared cap).
- **Fix: Hedge entry was blocked at any capital.** The 20%-allocation gate imported a function that doesn't exist, so the `ImportError` was silently swallowed and the paper capital always read back as ₹1,00,000 — meaning a NIFTY spread (~₹25k margin) exceeded "20% of ₹1L" **no matter what capital you configured**. Manual and auto hedge entries were impossible. Fixed to read the real paper account.
- **New: Engine confluence as a Scalp modifier (opt-in, default OFF).** The multi-engine confluence read no longer needs its own dispatcher: with the 🧠 **Confluence** toggle on, a confluence that agrees with the scalp side adds points and one that opposes subtracts (same shape as the VWAP/HTF modifiers). Off by default — there is no evidence yet that it improves scalp's win-rate; turn it on and judge it from the Signals tab.

---

## v0.5.18 — 2026-07-16

- **Fix: Hedge view no longer blank / 500.** The calendar-spread scanner crashed (`no such table: basis_series`) whenever the Data Warehouse had never been initialised — the default on a fresh client. The warehouse DB now self-heals its schema on first read, so an empty warehouse returns cleanly: the Hedge view shows the **live spread + basis + fair-carry/deviation** with a clear "run warehouse backfill" note instead of a dead panel.
- **New: Signals tab in the Performance report.** Every auto-dispatch decision across **all four engines** (Scalp / Sector / Flow / Engine + Hedge) is logged to a persistent `decision_log` and surfaced in a new **📡 Signals** tab — so you see not just the trades that fired, but **every signal evaluated and *why it didn't execute*** (kill-switch, loss-cap, cooldown, open-trade, score below threshold, OR bias, auto-trade disarmed…). Per-engine fire-rate summary, All/Executed/Blocked filter, CSV export; 10-min dedup so a fast scanner doesn't flood the log.
- **Hedge chart is now interactive.** The basis %/z-score chart gets a **hover tooltip** (date · basis% · fair% · deviation · z · SELL/BUY), a crosshair, y-grid + 6 x-axis date labels, a pulsing **live "now" marker** (current basis + signal), and a **3M / 6M / 1Y / All** range zoom. Plus a **futures-legs table** (near/next contract · expiry · LTP · lot) and a **basis spreadsheet** (full history + CSV).
- **New: Hedge auto-entry (paper).** An **AUTO ON/OFF** toggle arms a background tick that enters a paper calendar spread on each z-signal, subject to the usual gates (1 spread/symbol · 2R daily · 20% alloc · expiry cutoff). **Live auto is not available — Phase 4 is hard-disabled; auto is paper-only.**
- **New: Hedge manual entry.** Every scanner card now has an **Enter (manual)** action for a discretionary paper entry even with no z-signal (side taken from the basis tilt). Paper-only.
- **Engine mode retired from the UI.** The 🧠 Engine tab and its P&L tile are hidden — the Account card now shows **Scalp / Sector / Flow / Hedge** (Hedge P&L is now a true all-time number), and keyboard **5** switches to Hedge. The Engine view and backend confluence engine stay wired for later.

---

## v0.5.17 — 2026-07-15

- **Sector: profit-locking trail ladder (was breakeven-only).** Sector trades now get the same level-based ladder as scalp — T1 → move stop to breakeven, then a 0.75R giveback trail up to 1.5R, then lock +1R and hold to T2 — instead of sitting flat at breakeven after T1. The noisy candle-to-candle trail stays **off** for sector (its option premiums are gamma-heavy, so bar-by-bar trailing whipsaws); sector gets the clean level ladder only. Scalp/Engine unchanged, Flow still breakeven-only.
- **Hedge backtest: correctness fixes + transaction costs.** Fixed two backtest bugs that flattered results: (1) entries could open at `|z|` already past the stop (degenerate, exited next bar) — now bounded to the `[Z_ENTRY, Z_STOP)` band; (2) `max_adverse_z` and the stop counted favourable overshoot past the mean as "adverse" — the stop now fires only on genuinely adverse moves and adverse-excursion is measured on the entry side. Added a **transaction-cost model** (round-trip slippage + a roll charge when a trade is held across the near-expiry rollover), so backtest expectancy is now **net, not gross**. On real 2-year NSE data the calendar-spread edge survives net-of-cost and holds out-of-sample (NIFTY +13 pts/trade, BankNIFTY +97 pts/trade). Costs are config-tunable in `hedge_config.py`.

---

## v0.5.16 — 2026-07-15

- **Scalp: profit no longer fully surrendered between T1 and 1.5R.** The stop used to sit flat at breakeven from T1 until the 1.5R lock, so a move that peaked ~1.35R and reversed exited at ₹0. The stop now ratchets up in that band, trailing 0.75R behind the running R (a 1.35R peak locks +0.6R). A 3-day replay improved net by ~+1R and roughly doubled the win count. Sector/Flow/Engine trailing is unchanged.
- **Data Warehouse: instant historical backfill from NSE.** A new loader pulls the free NSE F&O UDiFF bhavcopy (index futures + option chains, back to ~mid-2024), builds the continuous basis series and computes IV/greeks — so the hedging calendar-spread backtest has real multi-month history immediately, instead of waiting for forward collection (`POST /warehouse/backfill-nse`).
- Fix: the Hedge view no longer shows a permanently "Loading market pulse…" strip.

---

## v0.5.15 — 2026-07-10

- **New: Hedging mode — Calendar Spread (paper).** A market-neutral engine that trades the near-vs-next index futures spread. Signal is a z-score mean-reversion on the continuous, roll-adjusted **annualised basis %**, validated against **cost-of-carry** (r − d). Includes a live scanner, spread dashboard (z / basis / fair-carry / deviation / confidence / expected-reversion), a full backtest (win-rate, expectancy, half-life, max-drawdown, profit-factor, walk-forward), paper 2-leg execution with net-P&L, and risk gates (1 spread/symbol · 2R daily stop · 20% portfolio · expiry square-off). NIFTY + BankNIFTY, current vs next month. Live execution is a later phase.
- **New: Data Warehouse (founder-gated).** A daily post-market collector stores index/futures EOD (+OI), the continuous basis series, and full option-chain snapshots with computed IV + greeks to a local store — the proprietary dataset that powers the hedging backtest, walk-forward, and future research. Off by default (`NAKSHATRA_DATA_COLLECTOR`); zero impact on normal clients.

---

## v0.5.14 — 2026-07-10

- **Sector SL/target are now percentage-based, not fixed rupee points.** The old fixed ±₹15/₹30 offsets broke for low-premium stock options — a ₹13 option got its SL clamped to ₹0.05 (risking the whole premium) and its T1 set at ₹28 (+115%, unreachable). SL/T1/T2 now scale with the premium (−25% / +25% / +50%), so the risk:reward holds at any option price. Scalp is unchanged (index options sit in a predictable premium band). Existing open sector trades were left as-is.

---

## v0.5.13 — 2026-07-09

- **Scalp Opening-Range gate is now ADX-aware.** The OR gate held scalp entries inside the opening range until a breakout — but on a strongly trending morning (ADX ≥ 28) that breakout is a redundant second confirmation, and it kept the engine out of clear trends (e.g. a 100-score CE not firing while price ground up just under the OR high). When ADX ≥ `OR_ADX_OVERRIDE` (28), an inside-range entry is now allowed with a directional bias read off the OR midpoint (upper half → CE, lower half → PE). Choppy, low-ADX days still get the full breakout gate, so whipsaw protection is unchanged.

---

## v0.5.12 — 2026-07-07

- **Options never carried into settlement.** The position tracker now force-closes any option position on its expiry day at 15:20 (or immediately if already expired) — a previous build left an expired NIFTY 24400 CE stranded open for two days, blocking the Flow engine and mispricing the paper book. Closes at the live LTP, or worthless if already past settlement.
- **Flow auto-trade restricted to setups with a proven edge.** Signal-resolution stats showed OIAD (36% win), GWBC (17%), VCP (25%), PLI (26%) and PRF (38%) auto-traded below breakeven, while MPMF (79%) and EGT (100%) held up. Auto-entry now fires only on the `{MPMF, EGT, SML}` whitelist; the rest still emit signals to the UI/Telegram but no longer auto-fire. (Score ≥90 alone wasn't filtering them — a 93-score OIAD still won ~36%.)
- **Confluence (Engine) now has a minimum-conviction floor.** The engine dispatched with no score gate and fired at final_score 40–55 (all losers). It now requires the combined confluence `final_score ≥ 70` before an auto-dispatch — consistent with a single engine needing strength ≥90 to fire solo.

---

## v0.5.11 — 2026-07-07

- **Stock Analyzer scoring engine overhaul.** Weighted (continuous) RSI, MACD zero-line filter, direction-confirmed volume context, RSI divergence, 52-week position, sector-relative strength and multi-timeframe alignment now feed the score. A correlation cap stops MA200 + 52W-position + rel-strength from triple-counting the same "how far price ran," and an ADX confidence gate scales the technical total instead of being scored itself. Live analyze + backtest now share one scorer (`compute_tech_scores`) so they can never drift.
- **Confluence split into Technical vs Fundamental**, with divergence detection — e.g. a weak chart on strong fundamentals reads as an *accumulation watch* rather than a plain sell.
- **Actionable Verdict + Position Guide.** The verdict now separates *what it is* (state) from *what to do*, with distinct advice for holders vs new buyers, and a freshness read (fresh / extended / exhausted) so an over-extended move isn't mistaken for a fresh entry. Positioned honestly as a description tool, not a price forecast.
- **Anchored VWAP (AVWAP)** from the 52-week low — daily/weekly reports no longer show "VWAP n/a."
- **PDF report** tightened: Sections 2 + 3 fit on one page, the verdict page fits cleanly, and the dark disclaimer footer now bleeds to the physical page edge (no trailing white space). Added the Avatara Trading Suite strip (Nakshatra + Meridian).
- **Flow + Engine views** now show a **Today's Trades** panel — side-by-side Open | Closed with a PnL summary (P&L · W/L · win-rate · live positions), matching Sector.

---

## v0.5.10 — 2026-07-05

- **Fix:** Performance report crashed on load (`/performance/summary` returned 422 "engine required") — the engine-filter helper had accidentally captured the route decorator. Report + Engine filter now work.
- **Flow + Engine auto-trade now live to the toggle.** The 🕹️ Auto-Trade Control switch is the real control for all four engines (no hidden dormant flag). Still paper-first — the global PAPER/LIVE gate keeps everything paper unless you go Live, and Live resets daily.
- New **AVATARA NAKSHATRA logo + app icon** (gold hexagon-cube constellation emblem).

---

## v0.5.9 — 2026-07-03

**Trade-mode gate & per-engine paper/live**
- New floating 🕹️ **Auto-Trade Control** — arm/disarm all four engines (Scalp/Sector/Flow/Engine) from one place: MASTER toggle + per-engine switch + 📄 Paper / 🔴 Live selector.
- The header **📄 PAPER / 🔴 LIVE** switch is now the single hard-rules authority — no engine can run LIVE unless it's LIVE (backend coerces engine live→paper otherwise).
- **Daily-connect** — LIVE auto-resets to Paper every new day (matches Kite's daily token); re-arm each morning. The Live confirmation now shows a **founder's note**.
- Risk panel opens with a Global Trade Gate + a live mirror of all four engines' arm state & mode.

**Analysis gate-trace (real pass/fail)**
- Every auto-entry records the actual gate results at entry — analysis modals show real ✓/✕ instead of a hardcoded "ALL PASSED". Flow & Engine trades get their own analysis view. (New trades only.)

**Reports & journal**
- Performance: richer Summary (Profit Factor · Expectancy · Gross P/L · Largest Win/Loss + cumulative equity curve), a **By Engine** tab, an **Engine filter** on every tab, tab reorder, and one-click **Excel** (multi-sheet) + **PDF** (branded) export.
- Journal: Engine + Mode filters, per-row engine badge, Excel export, live auto-refresh.
- **Reset Paper Stats** — wipe paper P&L + trade count to zero (License & Update panel); live is never touched.

**Backtest**
- Sector thresholds now imported from `rules.py` (in lock-step with live); scalp backtest honours the live session gates (no entry before 09:45 or after 15:00).

> Auto-trade remains **paper-first**; real broker order routing is Phase 6 (a "live" label logs the journal, it does not yet place a real Kite order).

---

## v0.5.6 — 2026-06-23

- **🌅 Morning Brief — fully internal.** Now generated inside Nakshatra from its own
  data (no external project, no Telegram, no background logo): India context
  (NIFTY/BankNIFTY + SENSEX/India VIX/GIFT), global indices (US/Europe/Asia with
  country labels), commodities, FX/crypto ($/₹ symbols), FII/DII flows, sector
  rotation and headlines — change shown as points **and** %. Auto-loads once on the
  day's first open; cached for re-open. Fixed the blank/black iframe (origin) issue.
- **🎯 Scalp M4 — higher-TF alignment penalty.** −12 when a scalp side opposes BOTH
  the 1H and Day bias (PE while 1H+D = BUY, etc.), time-gated to after 10:00 IST so
  the opening 30 min stays free. Soft — strong reversals still fire.
- **⚡ News pop-up.** Market-hours only (09:15–15:30 IST) + freshness gate (newest
  headline ≤ 15 min) + the actual headline title and a “Read full story” link.
- **🧭 Navigator.** Draggable in-app guide (53 topics) — Q&A, jump-to-screen,
  first-run tour, per-mode tips, clear-chat.
- **Dashboard fixes (live).** ADX (bars/candles key mismatch), VWAP (expired-future
  → live), self-refresh of VWAP/CPR/PDH/PDL, bias folds in 1H+D vote.
- Electron CommonJS marker is now recurrence-proofed in dev + build.

## v0.5.5 — 2026-06-22

Market-intelligence pop-ups, Flow backtest, equity curves, and a batch of UX polish.

### Added
- **⚡ Market Intelligence velocity pop-up** — background detector (all modes) that
  clusters news headlines into market topics (Geopolitics, RBI/Rates, Inflation,
  US Fed, FII/DII, Crude, Rupee, Budget, Banking, SEBI, Results, Tariff) and pops
  only when a topic's 3h coverage spikes vs its 24h baseline. Shows the rule-based
  **NIFTY bias** (bullish/bearish), sectors in play, velocity stats, sources, and a
  headline link with optional sound. One pop per topic; re-arms on cooldown.
  Backed by `/news/velocity` + a `news_findings` history table.
- **⏪ Backtest 🌊 Flow tab** — replays a trend-filtered range-breakout entry graded
  by the **exact live Flow model** (WIN +0.15% favourable before −0.10% adverse
  within 60 min, else EXPIRED). OI/gamma/Max-Pain confluence is not historically
  reconstructable, so it validates timing & direction only (clearly labelled).
- **📈 Equity curve + max drawdown** on Scalp & Flow backtests — cumulative-points
  curve with per-trade WIN/LOSS dots.

### Changed
- Backtest ₹ estimate now uses the **live F&O lot** from the instruments table
  (fallback NIFTY 65 / BankNIFTY 30) instead of a stale hardcoded 75/35.
- Scalp/Flow intraday replays fixed to **3 / 5 min** — a single trading day has too
  few bars (~25 at 15 min) for the ADX(14)+EMA21 warmup. Friendlier error otherwise.

### Notes
- Also bundles prior in-progress UX work: Sector trades-only chart, trend-gate split
  (wrong-direction vs weak-sector), Flow & Engine page upgrades, multi-position
  toggle + per-mode Lot Qty, watchlist/dividend screener upgrades, cockpit 3m default
  + projected-S/R fix, Chain Map in Option Scalp.

---

## v0.5.4 — 2026-06-20

Multi-engine release — confluence brain, master dashboard, scalp cockpit, auto-journal.

### Added
- **🛰 Master Dashboard mode** — session-start market-context screen for NIFTY &
  BankNIFTY: regime + ADX, bias, multi-TF strip (5m/15m/1H/D), key levels
  (CE/PE wall · PDH/PDL · VWAP · max-pain), positioning (PCR/ATM/VIX), suggested
  option (strike + Δ/IV), engine-readiness chips, account gate checklist + P&L,
  and a session clock.
- **🧠 Multi-Engine room** — confluence decision pipeline L0 Pre-Flow → L1 Intents
  (SCALP + FLOW + PA) → L2 Confluence (regime-weighted, min-agreement, veto,
  location bucket) → L3 Execution → **paper dispatch** (disarmed by default) →
  L4 trade management. Win-rate-by-location journal feeds adaptive weights.
- **🛰 Scalp Cockpit** — live index spot (pts + %), CE/PE leg cells (live WS ticks),
  mini-charts with VWAP + **projected-S/R** (index levels mapped to premium via
  Δ + Γ, live baseline tracks theta), Dashboard-sourced overlays (PDH/PDL/walls/
  CPR/max-pain), and a symmetric-OTM strike selector (±5).
- **🧾 Auto-Journal** — every closed trade auto-generates a post-trade review
  (outcome · R-multiple · BE/1.5R · hold-time · origin engine + a lesson).
- **Signal-origin badge** — each trade shows which engine fired it
  (🧠 confluence · SCALP · SECTOR · MANUAL).
- **Analyzer Seasonality tab** — monthly-return grid · win-rate · current-month
  bias (also PDF Section 04).

### Changed
- Flow's active signals now also feed the FLOW intent in the Engine confluence.
- Index chart line styling — RES/SUP thicker, VP levels thin-solid, VP axis labels
  hidden (shown on zone boxes); applied to the normal chart and the popup.
- ⚙ Controls moved from a collapsible side-console to a fixed header button.
- Help centre fully refreshed (Getting Started · Dashboard Mode · Scalp Cockpit ·
  Multi-Engine · Auto-Journal · Seasonality).

> Confluence dispatch is **paper-only and disarmed by default** (engine_auto OFF).

---

## v0.5.1 — 2026-06-10

Quality-of-life on top of v0.5.0.

### Added
- **Keyboard shortcuts** — `Ctrl+1/2/3/4` switch Scalp/Sector/Flow/Analyze;
  `J/N/B/P/R` open Journal/News/Backtest/Performance/Risk; `/` jumps to Analyze +
  focuses search; `Shift+P` toggles Paper/Live; `?` shows the cheatsheet; `Esc`
  closes; `Ctrl+Shift+K` opens the Risk/Kill-switch panel. Single-key shortcuts are
  input-guarded (won't fire while typing); dangerous actions are never single-key.
- **Flow Trade Map** — every Flow signal now shows the spot-proxy levels that
  decide its outcome: entry, 🎯 target (±0.25%), 🛑 stop (∓0.15%), plus the option
  entry premium captured at signal time (e.g. "23350 PE @ ₹68"). Shown on both the
  live feed and history, so WIN/LOSS is self-explanatory.

---

## v0.5.0 — 2026-06-10

Big feature release: a new **Flow** mode, a multi-timeframe **Sector Table**
screener, the **Dividend** screener split into Passive-Income / Long-Term, and
**Signal Freshness** wired across the analyzer.

### Added
- **🌊 Flow mode** — options-microstructure signal engine (signal-only, no auto-trade).
  Reads dealer/writer positioning from the live option chain on a 3-minute cadence
  and fires 10 setups: GWBC, SML, MPMF, OIAD, ALVB, EGT, LTR, PRF, VCP, PLI.
  9-factor 0–100 score with a regime hard-gate (TREND / RANGE / COMPRESSION).
  Spot-proxy outcome resolver tracks a real, honest win-rate (EXPIRED excluded).
  NIFTY + BANKNIFTY. Inside the base licence — no extra gate.
- **🏭 Sector Table** (Watchlist screeners) — pick a sector, every stock is scored
  with the same Analyzer verdict (RSI · MACD · MA20/50/200 · ADX · Volume) across
  **three timeframes at once: 15m · 1h · Day**. An **Align** column shows how many
  timeframes agree (▲3/3 = strongest confluence). Click a row to expand the full
  parameter X-ray per timeframe. Parallel fetch — a whole sector loads in seconds.
- **💰 Dividend screener split** into two sections:
  **💵 Passive Income** (high-yield, sorted by yield) and
  **📈 Long-Term** (quality compounders, best accumulation-zone first), each with
  its own average-yield stat.
- **🟢 Signal Freshness** — shared engine across Stock Analyzer + both screeners.
  Classifies a verdict as FRESH / IN-PROGRESS / EXTENDED / EXHAUSTED with age +
  move-% since trigger, so you stop chasing signals after the move already ran.
- **Journal scan-and-discard upload** — attach images / PDFs to a journal entry;
  text is extracted in-browser (OCR / PDF) and the file is discarded, never stored.
- **← Watchlist** back button in the Stock Analyzer to return to the screeners.

### Changed
- **Scalp v2 quality gates** — ADX fail-safe, chop filter, opening-range bias,
  max-pain pin guard, plus soft VWAP / Trend directional modifiers.
- Best-Entry screener replaced by the richer multi-timeframe Sector Table.
- Help / User Guide / About docs updated for Flow, Sector Table, Dividend split
  and Signal Freshness.

### Fixed
- **Flow engine stuck "warming up"** — engine now (re)starts on a fresh UI login,
  not only on startup-with-cached-token.
- **Sector Table empty "—" cells** — switched to the rate-limit-retry candle
  fetcher and capped parallelism so cells no longer come back blank under Kite
  rate limits.
- Dev-server port moved to **5176** so Nakshatra and Meridian can run side-by-side.

---

## v0.4.1 — Scalp risk + quality engine
- Layered scalp gate engine (5 risk + 5 quality + 4 per-opportunity).
- 2-loss day-stop, 11:30 entry cutoff, concurrent-position block.
- Independent scalp / sector kill switches.

## v0.3.0 — In-app licence + updates
- In-app License tab, manual "Check for Updates", My Licenses panel.

## v0.2.0 — First packaged build
- Backend frozen via PyInstaller, Electron installer + portable ZIP.
