Mainboard Screener
Relevant source files
The following files were used as context for generating this wiki page:
Mainboard Screener is a quantitative equity research tool that filters the National Stock Exchange (NSE) mainboard universe based on technical, fundamental, and momentum criteria. It executes screens against precomputed browser snapshots of the latest published trading session or falls back to a Python-based evaluator for complex historical queries.
The system supports visual filter building, boolean logic (Match All/Match Any), and text-based query inputs. It provides paginated results with sorting capabilities, including technical indicators like RVOL, RSI, and Relative Strength (RS) ratings.
Sources: frontend/README.md:10-15, frontend/src/components/ExploreTab.tsx:1-50
Architecture and Data Flow
The Mainboard Screener operates through a coordinated flow between the frontend React application, a Web Worker for local computation, and an optional Python backend for historical evaluation.
Request Execution Flow
The ExploreTab component manages the UI state and constructs a ScreenerRunRequest. This request includes the expression tree, universe selection, and sorting parameters. The screenerApi then resolves the request by either processing the snapshot in a browser worker or sending it to the Python bridge.
This diagram illustrates the decision logic for local vs. remote screen execution.
Sources: frontend/README.md:213-225, frontend/src/components/ExploreTab.tsx:68-81
Screening Components
Universe Selection
The screener restricts its scope to specific indices or the broader mainboard. The backend pipeline reconciles the universe against the official NSE EQUITY_L.csv and excludes SME (Small and Medium Enterprises) listings.
| Universe Key | Description |
|---|---|
mainboard | The full NSE Mainboard universe (excluding SME). |
nifty50 | Top 50 liquid stocks on the NSE. |
nifty500 | Top 500 stocks by market capitalization. |
midsmall400 | Mid-cap and Small-cap stocks excluding the Nifty 100. |
custom | A user-defined list of tickers. |
Sources: frontend/src/types/screener.ts:1, DO NOT DELETE EDL PIPELINE/filter_mainboard_universe.py:28-40
Expression Logic
Queries are structured as ExpressionNodes. A group node defines the MatchMode (AND/OR), while condition nodes contain specific indicators and parameters.
- Match All (AND): Every condition in the group must return a match.
- Match Any (OR): At least one condition in the group must return a match.
Sources: frontend/src/types/screener.ts:41-55, frontend/src/utils/nqlParser.ts:125-155
Technical Indicators and Filters
The screener supports several categories of indicators defined in the ConditionCatalog.
Core Indicator Families
- Trend: SMA/EMA comparisons (e.g., Price > SMA 50), MA stacks, and slopes.
- Momentum: Period returns, consecutive up days, and relative volume (RVOL).
- Liquidity: Average daily turnover and delivery percentages.
- Fundamentals: P/E ratios, market capitalization, and financial growth metrics.
- Relative Strength: RS Ratings (Top % of market performance) and RS Line highs versus benchmarks.
Sources: frontend/README.md:120-135, frontend/src/utils/nqlParser.ts:35-100
Indicator Explanation Logic
The nqlParser utility converts technical ActiveCondition objects into human-readable text for the UI.
// Example: Converting RVOL condition to human text
case 'mom_rvol':
explanation = `Relative Volume (20-Day RVOL) is BETWEEN ${p.minRvol}x and ${p.maxRvol}x average volume`;
break;
Sources: frontend/src/utils/nqlParser.ts:80-82
Data Model: StockRow
Matched results are returned as a collection of StockRow objects. This interface defines the data contract for all equities within the scanner.
| Field | Type | Description |
|---|---|---|
symbol | string | The NSE ticker symbol. |
close | number | Closing price of the session. |
changePct | number | Daily percentage return. |
rvol | number | null | 20-day relative volume multiple. |
marketCapCrore | number | Market cap in ₹ Crores. |
rsRating | number | null | Nexus Relative Strength rating (1-99). |
isFno | boolean | Flag indicating F&O segment membership. |
Sources: frontend/src/types/screener.ts:71-180
Result Interactions
The ResultsTable component handles the display and user interactions for the matches.
- Sorting: Users can sort by price, returns, RVOL, or market capitalization.
- Filings Access: A "Filings" link opens the
AnnouncementsPanelfor the specific symbol. - Watchlist: Matched symbols can be added to a local watchlist.
- TradingView Export: The "Copy TradingView" button formats symbols as
NSE:<SYMBOL>for bulk pasting into TradingView watchlists.
Sources: frontend/src/components/ResultsTable.tsx:50-80, frontend/src/components/ResultsTable.tsx:160-185
Conclusion
The Mainboard Screener provides a high-performance interface for equity research by combining precomputed snapshots with a flexible expression engine. By integrating NSE reconciliation in the backend pipeline and local Web Worker execution in the frontend, it ensures accurate and responsive screening across thousands of securities.
Sources: frontend/README.md:320-335