TradeTech Insights — specification v1.0.0-candidate
Status: candidate. Stage thresholds are frozen as 1.0.0 only after the boundary tests pass and the owner has reviewed the chart sanity sample (section 11). Site: insights.tradetechanalytics.com. Public and free, with no login, no registration and no authentication. Light TradeTech styling, mobile first. Scope v1: Discover, Explorer, Stock pages, Methodology, Data status. Out of scope v1: - intraday data; - performance or "hit-rate" statistics; - price targets; - personalised recommendations; - alerts; - any overall investment rating.
Publication position (recorded, not resolved): - Regulatory applicability (SEBI research-analyst framework) is unverified. - Data-publication rights for NSE-derived content are unverified. Permission was requested by the owner on 2026-11-17. - The site must never describe itself as SEBI-approved. It must never say that public availability of NSE files grants republication rights.
1. Inputs (NSE only)
All inputs are public NSE archive files. No broker data is used.
| Input | Source | Stored as |
|---|---|---|
| Cash-market bhavcopy (EQ, BE, BZ, BL) | content/cm/BhavCopy_NSE_CM_0_0_0_YYYYMMDD_F_0000.csv.zip. Before 2024-07-08: content/historical/EQUITIES/...bhav.csv.zip. History to 2026-10-30 is copied read-only from the existing archive data/bhav_cm/ (the same NSE files) |
raw/bhav/YYYY-MM-DD.parquet |
| Corporate actions | Daily PR bundle archives/equities/bhavcopy/pr/PRddmmyy.zip, book-closure file bc*.csv (SYMBOL, SERIES, RECORD_DT, EX_DT, PURPOSE) |
raw/bc/YYYY-MM-DD.csv |
| Index closes (Nifty 500 benchmark) | content/indices/ind_close_all_DDMMYYYY.csv |
raw/index/YYYY-MM-DD.csv |
| Current constituents and industry | content/indices/ind_nifty500list.csv |
raw/constituents/ind_nifty500list_<date>.csv |
| Symbol changes | content/equities/symbolchange.csv |
raw/constituents/symbolchange_<date>.csv |
| Historical membership | NSE index-change snapshots, data/reference/nifty500_constituents.csv (read-only) |
used in place |
- Every stored file is appended to
raw/manifest.jsonlwith its URL, sha256, size and fetch time. Raw files are never overwritten. - The pipeline writes only under
data/insights/. It never modifies the ingestion services, their files ordata/bhav_cm/. - The adjusted data starts on 2018-01-01.
2. Membership
- Current universe (Explorer, Discover, percentiles): the latest
ind_nifty500list.csv, all rows. The file has 501 rows, because NSE's list can exceed 500 names. Industry is NSE'sIndustryfield from the same file. - Historical membership comes from the snapshots. Snapshot k applies to sessions
effective_date_k <= d < effective_date_{k+1}. It is validated per period: - V1 count: the snapshot has 500 or 501 unique symbols.
- V2 chain:
prev ∪ inclusions − exclusions == snapshot, after applying NSE symbol changes dated on or before the effective date. - V3 tradability: every symbol, after renames, has a bhavcopy row within ±5 sessions of the effective date.
- A period that fails V2 or V3 is UNRESOLVED. It is listed in
membership_report.jsonwith the exact symbols involved. - The research proxy file (
members_sf.parquet) is never used. - v1 use of historical membership: "member since" on stock pages (shown only when every period back to that date is resolved; otherwise "membership history unresolved"), and the membership audit page. Historical percentiles are not shown in v1.
- Renames: NSE
symbolchange.csvis the authority. A ticker change with ISIN continuity, but no NSE record, is flagged in the report and is not merged.
3. Adjustment pipeline
Series identity. A ticker, with old tickers merged into new ones per NSE symbol changes. Series priority on a day: EQ > BE > BZ > BL.
Events. Each bc record is classified from PURPOSE (case-insensitive; one record can hold several purposes separated by /):
| Class | Pattern | Factor F (multiplies prices before the ex-date) |
|---|---|---|
| BONUS | BONUS a:b (a new shares for every b held) |
b / (a + b) |
| SPLIT | SPLIT / FV SPLT / FACE VALUE SPLIT … RS x TO RS(RE) y with y < x |
y / x |
| CONSOLIDATION | Same pattern with y > x | y / x |
| DIVIDEND | DIV, DIVIDEND |
none (price-return series; recorded) |
| RIGHTS | RIGHTS |
none; UNSUPPORTED, flagged |
| STRUCTURAL | DEMERGER, SCHEME, ARRANGEMENT, AMALGAMATION, MERGER, REDUCTION, BUY BACK/BUYBACK |
none; UNSUPPORTED, flagged |
| OTHER | anything else (AGM, interest, etc.) | none; ignored |
A BONUS, SPLIT or CONSOLIDATION record whose ratio cannot be parsed is UNPARSED. It is quarantined, and no adjustment is made.
Ex-session. The first session on or after EX_DT (or RECORD_DT if EX_DT is blank). Duplicate records (same symbol, ex-session and purpose) are counted once.
Verification (price evidence confirms; it never creates an event). - Let r = open_ex / close_prev and r_c = close_ex / close_prev. - The event is APPLIED if both hold: 1. |r / F − 1| ≤ 0.20 or |r_c / F − 1| ≤ 0.20; 2. for F ≤ 0.8 (or ≥ 1.25), |log(r / F)| < |log r|, i.e. the observed move is closer to F than to no change. - Otherwise the event is QUARANTINED ("record does not match prices"). - Supporting evidence, when present, is recorded: NSE PREVCLOSE on the ex-session ≈ close_prev × F.
Unexplained discontinuities. - A day is flagged if r or r_c is outside [0.70, 1.43] (about ±30% in log terms) with no APPLIED event that day, or if prevclose_t / close_{t−1} − 1 exceeds 10% in absolute terms with no event. - A flagged day is QUARANTINED: no adjustment is made, and the discontinuity is listed. - A price jump alone never creates an adjustment.
Adjusted series.
- Cumulative factor: A(t) = ∏ F_e over APPLIED events with ex-session > t.
- Adjusted OHLC: open, high, low, close = raw × A(t).
- share_volume_adj = qty / A(t). This is the NSE-reported traded quantity, split-adjusted.
- turnover = NSE-reported traded value in ₹, unadjusted, preserved exactly.
- turnover_equivalent_volume = turnover / close_adj. Close × this field recovers turnover. It is not share volume and is not used for volume charts or volume screens.
Quarantine effect. A QUARANTINED item inside a metric's window blanks that metric (shown "–"), so the stock drops out of every screen and percentile population that uses it; its page lists the item. Windows in sessions: daily change 1; RSI(14), ATR and range expansion 100 (Wilder smoothing); share-volume ratio 21; distance from the 63- and 252-session highs 63 and 252; daily 50/200 crosses 200; returns and percentiles their horizon h; weekly stage, 30-week distance, slope and weekly crosses 175 (34 weeks), shown as stage "Unverified"; weekly RSI 100. Reported turnover is not price-adjusted and is unaffected.
Idempotence and revisions.
- Every run recomputes the store from raw files, so the output is deterministic and has no duplicates.
- revisions.jsonl records any change against the previous run in a symbol's event set, factor or raw-file hash, with the reason.
Adjustment checks (must PASS to publish):
- A1: no duplicate (symbol, date).
- A2: adjusted OHLC is positive and consistent (low ≤ open, close ≤ high).
- A3: every APPLIED event's adjusted ex-day return is within ±25%.
- A4: the latest session is present for ≥ 98% of current constituents. Each missing constituent is listed with a reason; a name with no trade that day is shown as unavailable.
- A5: the Nifty 500 index close is present for the latest session.
- A6: every quarantine is listed in adjust_report.json.
- A7: the raw manifest covers every file used.
Reconciliation (reported, not gating). Daily adjusted close-to-close returns are compared with the research panel panel_sf.parquet on the overlap. The report gives the share of matching days within 0.1% and the symbols that disagree, with the likely cause.
4. Calendar and weekly bars
- Sessions are the dates that have a bhavcopy.
- A week is the Monday–Sunday calendar week. Its bar is: open of the first session, highest high, lowest low, close of the last session, summed
share_volume_adj. - A week is complete only when no NSE session of that week remains after the as-of date.
- Holiday information comes from the bundled NSE calendar.
- Unknown future days count as possible sessions, so an unfinished week is never treated as complete.
- Holiday-shortened weeks are normal weeks.
- A stock's weekly close is missing for a week in which it did not trade.
5. Indicators (adjusted prices unless stated)
| Measure | Definition |
|---|---|
| RSI(14), daily and weekly | Wilder. Changes from close to close. The first average gain and loss are the simple means of the first 14 changes; then avg_t = (13 · avg_{t−1} + x_t) / 14. RSI = 100 − 100 / (1 + RS); RSI = 100 when the average loss is 0 and the average gain is above 0. Needs 15 closes. |
| ATR(14) | Wilder. TR_t = max(H−L, |H−C_{t−1}|, |L−C_{t−1}|) from the second bar. The first ATR is the mean of the first 14 TRs, then Wilder smoothing. ATR% = 100 · ATR / close. |
| 30-week MA | M_w = simple mean of the last 30 completed weekly closes. All 30 must be present. |
| MA slope (4 weeks) | 100 · (M_w / M_{w−4} − 1). |
| Distance from 30-week MA | 100 · (C_w / M_w − 1). |
| Daily SMA 50 / 200 cross | Up on day t if SMA50_t > SMA200_t and SMA50_{t−1} ≤ SMA200_{t−1}; down is the mirror. Confirmed on the validated daily close. |
| Weekly 10/30 cross | Same rule on completed weeks only. Reported separately from the daily cross. |
| Distance from 252-session high | 100 · (C_t / max(H over the last 252 sessions incl. t) − 1). Needs 252 sessions. Labelled "252-session high". |
| Range expansion | TR_t / ATR(14)_{t−1}. The denominator excludes day t. |
| Volume ratio | share_volume_adj_t / mean(share_volume_adj over the 20 sessions before t). Today is excluded. Needs 20 prior valid sessions. |
| Liquidity | Median of reported turnover over the last 20 sessions, in ₹ crore. |
| Returns h = 63, 126, 252 | R = C_t / C_{t−h} − 1, where t−h counts market sessions. Unavailable if the stock has no close on session t−h. Never prorated. |
| Benchmark return | Nifty 500 price index over identical endpoints. |
| Relative performance | 100 · ((1 + R_stock) / (1 + R_bench) − 1). |
| Percentile | Among the current constituents that are eligible for that horizon (return available, not quarantined in the window): average rank of R, ascending, unrounded. P = 100 · (rank − 1) / (N − 1). Unavailable if N < 2. |
All prices are price returns. Dividends are not reinvested.
6. Systematic Weinstein-inspired stages
Each completed week w with C_w, M_w and M_{w−4} available (34 valid weeks) gets a candidate:
| Candidate | Rule |
|---|---|
| Stage 2 — Advancing | dist > +2 and slope > +1 |
| Stage 4 — Declining | dist < −2 and slope < −1 |
| Flat-near-MA | −1 ≤ slope ≤ +1 and −5 ≤ dist ≤ +5 |
| None | otherwise |
A Flat-near-MA candidate becomes: - Stage 1 — Basing, if the last confirmed directional stage was 4; - Stage 3 — Topping/range, if it was 2; - Base-like (origin unknown), if there has been no confirmed directional stage yet.
A week without the inputs is Insufficient history.
Confirmation rules - Confirmation: a candidate (1, 2, 3, 4 or Base-like) seen in two consecutive completed weeks becomes the confirmed stage. It is dated on the second week. - Mixed: two consecutive "None" weeks confirm "Mixed / Transition". - Continuity: an Insufficient week breaks the chain; the next two qualifying weeks are needed. - Pending: a latest-week candidate that differs from the confirmed stage is shown as "pending". - Directional memory: the last confirmed directional stage (2 or 4) is kept through Mixed, 1 and 3. It is updated only by a new confirmation of 2 or 4. - Direct moves: Stage 2 → 4 and 4 → 2 are allowed directly. - Weeks in stage: completed weeks from the confirmation week, counting the confirmation week as 1. There is no minimum residence. - Before any confirmation: the confirmed stage is "Not yet confirmed". - Exclusions: relative strength is not a stage condition. Stages are categories, not ranks.
7. Screens (Discover)
Each card shows: - its rule, timeframe and sort order, with tie-breaker by symbol (A→Z); - the qualifying count and the eligible population N; - the as-of date; - up to 10 matches, and a "view all" link to the Explorer with the filter applied.
Stocks with a quarantine in the relevant window are excluded.
| # | Card | Rule | Sort |
|---|---|---|---|
| S1 | Near 252-session high | distance from 252-session high ≥ −3% | distance, descending |
| S2 | Strongest 6-month relative performance | 126-session percentile ≥ 90 | percentile, descending |
| S3 | Improving 6-month relative performance | 126-session percentile now − 21 sessions ago ≥ +20 points (both on the current universe) | change, descending |
| S4 | Daily range expansion | TR / prior ATR ≥ 2.0 | ratio, descending |
| S5 | Unusual share volume | volume ratio ≥ 2.5 | ratio, descending |
| S6 | Daily 50/200 crossovers (up) | cross up in the last 5 sessions | date (newest first), then symbol |
| S7 | Daily 50/200 crossovers (down) | cross down in the last 5 sessions | date (newest first), then symbol |
| S8 | Confirmed weekly stage changes | confirmation dated in the latest completed week | stage, then symbol |
| S9 | Retracements within Stage 2 | confirmed Stage 2, close 5–15% below the 63-session high, and dist > 0 | depth, ascending |
| S10 | Deteriorating structures | confirmed Stage 2 or 3, slope ≤ 0, close below the 30-week MA | dist, ascending |
Market context: - Nifty 500 close and its 1-, 21- and 63-session changes; - stage distribution (count and % of N); - % above the 30-week MA; - median 126-session percentile (50 by construction, so not shown); - % with RSI(14) above 70 and below 30.
Industry summaries, labelled "Current NIFTY 500 constituents grouped by current NSE industry": - equal-weight mean and median 63-session return; - % in each confirmed stage; - % above the 30-week MA; - median 126-session percentile; - eligible count / members.
These are not index returns. No synthetic cumulative sector indices are published.
8. Explorer
12 default columns: 1. Symbol / company 2. Industry 3. Confirmed stage 4. Weeks in stage 5. 126-session percentile 6. 63-session percentile 7. RSI(14) daily 8. Distance from 30-week MA 9. Four-week MA slope 10. ATR% 11. 20-session median turnover 12. Data quality
Optional columns: daily change; 252-session percentile; weekly RSI; volume ratio; distance from 252-session high; latest daily cross; latest weekly cross; pending stage.
Default order is alphabetical; any column is sortable. There is no overall rank.
9. Stock pages
Each page shows: - Header: company, symbol, industry, ISIN, as-of date, quality flags. - A daily chart (1 year): adjusted close, SMA 50 and 200, share-volume bars. - A weekly chart (3 years): weekly close, the 30-week MA, and a stage band under the chart. - A relative-performance line against the Nifty 500 (1 year, rebased to 100). - Measurements with observations written in neutral language, giving competing evidence side by side. - Stage evidence for the last 10 weeks: candidate, dist, slope, confirmed stage. - Stage history (reconstructed), plus stage changes recorded as published since launch, labelled separately. - Corporate actions: applied, recorded and unsupported. - Quarantines and cautions.
Wording rules: no buy, sell, target, "should" or "recommend".
10. Publication
Gates, all required:
- G1: the raw-data checker (data/status/daily_check.json) reports status OK for the expected session, with a check time after 21:15 IST.
- G2: the NSE raw files for the session are present (bhav, index).
- G3: adjustment checks A1–A7 pass.
- G4: the dashboard checks pass: every constituent has a page; the Explorer JSON is valid with N rows; every internal link resolves; no NaN/Infinity appears in the published JSON; every screen card meets its rule; banned words are absent.
Release flow:
1. Build into a staging directory.
2. Validate it.
3. Copy it to WEB/releases/<build_id>/.
4. Atomically switch the WEB/current symlink.
5. Keep the last 15 releases. Rollback means switching current to a previous valid release.
On failure:
- current is untouched.
- Only WEB/ops/status.json is updated: state, failing gate, last good release and its session.
- The banner on every page reads that file and shows "Data as of
Audit records:
- As published: data/insights/published/<session>[-rN].json.gz holds the full metric snapshot. It is never overwritten; a correction is published as -r2 with a reason.
- data/insights/published/ledger.jsonl records the build id, session, publication time, methodology version, input-manifest hash and output-tree hash.
- Reconstructed histories (stage history before launch) are labelled "reconstructed" everywhere.
Schedule: trader cron at 21:40 IST on weekdays. It waits for G1 until 23:30; if G1 still fails, it records the failure.
11. Acceptance tests (written before the implementation)
Expected values are derived by hand or from published references, not produced by the implementation. Tests live in insights/tests/.
| Area | Tests |
|---|---|
| Membership | Chain reconstruction on a synthetic 3-snapshot log, including a rename; count failure; an unresolved period. |
| Adjustments | Purpose parsing (bonus 1:1 → 0.5, 2:5 → 5/7, FV 10→2 → 0.2, FV 1→10 → 10). A split that matches prices → APPLIED. A record that doesn't match prices → QUARANTINED. A jump with no record → QUARANTINED and not adjusted. Dividend → recorded, no factor. Rights or demerger → UNSUPPORTED. Rerun → identical output and no duplicates. |
| Turnover / volume | close_adj × turnover_equivalent_volume = turnover. share_volume_adj = qty / A. |
| Indicators | RSI against the published Wilder/StockCharts example (first value 70.53). Hand-computed ATR. SMA, slope and distance by hand. |
| Stages | Every boundary (±1, ±2, ±5, equality cases), pending, two-week confirmation, Mixed, direct 2→4, Insufficient breaking the chain, Base-like, Stage 1 versus 3 from directional memory, weeks in stage. |
| Relative strength | Ties (average rank), N < 2, missing horizon, benchmark alignment, the relative formula. |
| Weekly timing | A holiday-shortened week; an unfinished week excluded; a week with no trade for the stock. |
| Missing data | A constituent missing the latest session is listed in A4. A gate failure blocks publication. |
| Publication | A failed gate leaves current unchanged and updates the status; a successful release switches atomically; rollback restores the previous release; as-published files are never overwritten. |
| Reproducibility | Two builds from identical inputs give identical analytical JSON. |
Freeze rule: stage version 1.0.0 is frozen after (a) all boundary tests pass and (b) the owner reviews the chart sanity sample: the 12 stock pages listed in test_report.md, covering advancing, declining, flat, newly listed and corporate-action cases. Thresholds are never tuned for historical returns.
12. Versions
METHODOLOGY_VERSION = "1.0.0-candidate". It appears on the Methodology page, in every JSON file and in the ledger.- Changing any rule bumps the version, and the change is logged on the Methodology page.