# How the numbers are computed

> Where PatternsRadar's NSE data comes from, how it is adjusted and refreshed, what a universe tier means, how indicators are defined, and exactly what the hit-rate replay does and does not measure.

Canonical: https://dev.patternsradar.com/methodology

Every figure on PatternsRadar comes out of the same pipeline: a scan match, an indicator value, a hit rate. This page follows that pipeline from an exchange file to a sentence on a page, and says what is not modelled at each step. Who builds this, and why, is on the [about page](https://dev.patternsradar.com/about.md).

## 1. The data

Prices, volumes and delivery quantities originate in the end-of-day files the National Stock Exchange of India publishes after each session, and reach PatternsRadar through the open-source eod2 dataset (https://github.com/BennyThadikaran/eod2), which applies split and bonus adjustments. The database covers 3,700+ instruments and about 8.3 million daily bars, back to 1995 for the oldest listings. Derivatives fields are per-stock aggregates from the F&O bhavcopy, not option chains. Fundamentals are point-in-time from filings; a stock without parsed results has a null, which never matches. Sector and industry are today's NSE classification with no history. PatternsRadar is not affiliated with, endorsed by or licensed by NSE.

## 2. The refresh

The database is rebuilt every trading evening once the exchange files are available, then checked before it goes live: the last session date must have advanced, symbol and row counts must be in range, and every indicator column must agree with an independent implementation. A build that fails any gate is discarded and the previous session's database keeps serving. Sometimes that means it is a session behind. It is never half-updated.

## 3. Universes

A scan runs over a universe: the top 100, 250, 500 or 1,000 NSE stocks ranked by twenty-day traded turnover, or every actively traded equity. The ranking is recomputed with each refresh and there is no history of past rankings. Each preset scan names a default universe chosen so that its conditions produce a usable list; thin scans use tighter universes. The F&O universe is the set of stocks with derivative contracts on the last session.

## 4. Indicators and patterns

All 42 indicator columns are verified against pandas-ta-classic on every build, to within one millionth. RSI and ATR use Wilder's smoothing, MACD is 12/26/9, Bollinger Bands are a 20-day average with two standard deviations, and simple and exponential averages are their plain definitions. Candlestick patterns are geometric tests on one to three bars, defined in the glossary (https://dev.patternsradar.com/learn.md). Every parameter and default is in the Sift language reference (https://dev.patternsradar.com/docs/sift.md); its 70 example scans are compiled and run in CI.

## 5. Running a scan

A scan is a Sift query compiled to SQL and evaluated as of the last session in the database, or an earlier date if chosen; an offset such as `close[-5]` reads the bar five sessions before that date. The universe is always today's ranking, which is the survivorship caveat the replay inherits. Results are the instruments whose data satisfied every condition, returned as a list with no ranking and no score.

## 6. The hit-rate replay

Each scan page reports what the scan's past matches did next. The replay runs the scan as of each of the last 250 sessions; every match on every day is a signal. For a horizon of 1, 5 or 20 sessions, a signal is a win if the close that many sessions later is above the close on the signal day. Pages show the share of wins, the median close-to-close move and the number of signals behind them. A 70% win rate on eleven signals is noise. Left out, deliberately: transaction costs, slippage, position sizing, any exit rule beyond the fixed horizon, and a universe measured as of today rather than as of each replayed day, which means the replay carries survivorship bias. Use it to compare scans and to catch one that only looks good. It is not a measurement of what a strategy would have returned, and never PatternsRadar's own performance.

## 7. What this is not

PatternsRadar reports which instruments matched criteria you chose. It does not recommend anything: no buy, sell or hold labels, no target prices, no composite scores, no curated picks. It is not registered with SEBI as an investment adviser or a research analyst. Nothing on the site is investment advice: not the scans, the replays, the blog or the alerts. Markets carry risk. Consider taking advice from a SEBI-registered adviser before acting on anything you find here. The [terms](https://dev.patternsradar.com/terms.md) say the same at length.

## Questions

**Is the data real-time?**

No. PatternsRadar uses NSE end-of-day data: one bar per instrument per session, loaded after the close. Every scan, alert and replay is computed on closing data. There is no intraday feed and no BSE coverage.

**What does the hit rate actually measure?**

The scan is run as of each of the last 250 sessions, and every match becomes a signal. A signal counts as a win at a horizon of N sessions if the close N sessions later is above the signal day's close. The win rate is the share of signals that won. The median move is the median close-to-close change. There are no costs, no slippage and no position sizing. The universe is measured as of today, so a stock that has since dropped out of the top 500 is still replayed. That survivorship bias is real. I state it rather than fix it, because fixing it properly needs point-in-time index membership I do not have.

**Is the hit rate a backtest?**

It is a sketch of one. A real backtest needs an entry rule, an exit rule, costs, sizing and a universe measured as of each date. The replay has a fixed horizon and none of the rest. Use it to rank scans against each other and to catch a scan that only looks good on paper. Do not use it to estimate what a strategy would have returned.

**How are the indicators calculated?**

Every indicator column is verified against pandas-ta-classic on every build, to within one millionth. RSI and ATR use Wilder's smoothing; MACD is 12/26/9; moving averages are the plain definitions. The exact parameters and defaults for every field are in the Sift language reference.

**Is PatternsRadar registered with SEBI?**

No. PatternsRadar is a screening and research tool. It is not an investment adviser or a research analyst. It reports which instruments matched criteria you chose. It does not recommend anything, and nothing on the site is investment advice.

[Browse the scan library](https://dev.patternsradar.com/scans.md).

---

Price and delivery data from the [eod2](https://github.com/BennyThadikaran/eod2) dataset: National Stock Exchange of India end-of-day files, split- and bonus-adjusted, updated after each close. Not affiliated with or endorsed by NSE. PatternsRadar is a research tool. Nothing here is investment advice or a recommendation to buy or sell anything.
