Open-source shell-driven market scanner workspace for US equities and India NSE equities, with local history, archived reports, diff views, and a browser dashboard.
This repository is structured so the code can be public while the proprietary scan thresholds and broker credentials stay local-only.
Modern, IDE-like full-screen dashboard with Control Center and terminal output.
Live terminal momentum scanning and polished report summaries.
- US scanner with resume/fresh workflows, reports, diffs, history, sector views, exports, and daily automation helpers
- India scanner with optional Fyers integration, cap-class summaries, reports, diffs, history, exports, and daily automation helpers
- Shared SQLite state and archive storage for scan progress, historical events, and generated artifacts
- A browser dashboard with a Control Center that can launch commands and render polished structured output
- Open-source-safe packaging that keeps private conditions and broker credentials outside tracked source
| Path | Purpose |
|---|---|
start_scan.sh |
US launcher |
India_scan.sh |
India launcher |
scanner.py |
US scan engine |
india_scanner.py |
India scan engine |
scan_state.py |
Shared history, reporting, export, diff, doctor, and archive tooling |
scan_conditions_loader.py |
Loads local private scan conditions |
scan_conditions.example.json |
Public template for private scan conditions |
.env.example |
Public template for optional Fyers credentials |
dashboard.html |
Frontend dashboard |
api.py |
FastAPI backend for dashboard command execution and SSE streaming |
start_dashboard.sh |
Dashboard launcher |
doc/ |
Detailed command and architecture notes |
This repo intentionally does not commit live broker credentials or the real scan thresholds.
Tracked public files:
.env.examplescan_conditions.example.json
Local private files:
.env.scanner_secrets/scan_conditions.jsonscan_conditions.local.json
Generated local artifacts that should remain private:
scanner_results.jsonscanner_results_YYYY-MM-DD.jsonindia_results.jsonindia_results_YYYY-MM-DD.jsonscan_state.dbscan_mega_history.dbexports/backups/fyersApi.logfyersRequests.log
Those generated files can reveal strategy behavior even if the source code is clean, so they are ignored by .gitignore.
- Python 3.8+
- Bash
- Git
- A browser for the dashboard
- Optional: Fyers credentials for richer India market data
git clone https://github.com/Vikkrantpol/US_India_Signal_Lab.git
cd US_India_Signal_Labmkdir -p .scanner_secrets
cp scan_conditions.example.json .scanner_secrets/scan_conditions.json
chmod 700 .scanner_secrets
chmod 600 .scanner_secrets/scan_conditions.jsonThen replace every placeholder value in .scanner_secrets/scan_conditions.json with your real local thresholds.
Alternative location:
export SCAN_CONDITIONS_FILE=/absolute/path/to/scan_conditions.jsonIf you want Fyers-backed India data:
cp .env.example .envThen fill in the local values in .env.
If you leave .env blank, the India scanner still works in fallback mode without Fyers.
US:
./start_scan.sh runIndia:
./India_scan.sh run./start_dashboard.shThen open:
http://localhost:8000/dashboard.html
scan_conditions_loader.py resolves the private scan-conditions file in this order:
SCAN_CONDITIONS_FILE.scanner_secrets/scan_conditions.jsonscan_conditions.local.json$XDG_CONFIG_HOME/us_in_scanner/scan_conditions.json~/.us_in_scanner/scan_conditions.json
That lets you keep the exact thresholds outside the repo without changing the launcher commands.
Run ./start_scan.sh help for the full built-in help.
| Command | Purpose |
|---|---|
run |
Resume/update US scan from current working state |
fresh |
Reset US working state, remove active US outputs, and rescan |
summary |
Show latest top-30 US table |
artifact-history |
Show archived generated outputs |
archive-query |
Query archived command-output rows |
ticker-history TICKER |
Show one ticker's archived timeline |
leaderboard |
Show current and historical leaders |
sector-report [sector] |
Show latest sector summary or drill into one sector |
sector-history [sector] |
Show archived sector snapshots or one sector timeline |
sector ... |
Friendly alias wrapper for sector workflows |
new-highs |
Show latest high-proximity names |
compare-markets |
Compare latest US and India outputs |
daily |
Run both scans, then diff/report/compare/export workflow |
daily-full |
Run both scans plus extended review tables and exports |
doctor |
Run environment and data health checks |
| `export [csv | md |
diff |
Compare latest US results against previous snapshot |
report |
Generate richer US report and archive it |
history |
Show archived US scan history |
download |
Refresh the US market-universe download step |
clean |
Remove .venv/ |
help |
Show launcher help |
Run ./India_scan.sh help for the full built-in help.
| Command | Purpose |
|---|---|
run |
Resume/update India scan |
fresh |
Reset India working state and rescan |
summary |
Show latest top-30 India table |
smallcap |
Show latest India smallcap table |
midcap |
Show latest India midcap table |
largecap |
Show latest India largecap table |
artifact-history |
Show archived generated outputs |
archive-query |
Query archived command-output rows |
ticker-history SYMBOL |
Show one symbol's archived timeline |
leaderboard |
Show current and historical leaders |
sector-report [sector] |
Show latest sector summary or drill into one sector |
sector-history [sector] |
Show archived sector snapshots or one sector timeline |
sector ... |
Friendly alias wrapper for sector workflows |
new-highs |
Show latest high-proximity names |
compare-markets |
Compare latest India and US outputs |
daily |
Run both scans, then diff/report/compare/export workflow |
daily-full |
Run both scans plus extended review tables and exports |
doctor |
Run environment and data health checks |
| `export [csv | md |
diff |
Compare latest India results against previous snapshot |
report |
Generate richer India report and archive it |
history |
Show archived India scan history |
help |
Show launcher help |
The dashboard consists of:
dashboard.htmlfor the frontendapi.pyfor the FastAPI backendstart_dashboard.shfor the local launch flow
Current dashboard behavior includes:
- collapsible Control Center
- independent scrolling for command navigation and workspace panels
- live command execution via backend streaming
- polished report cards and tables instead of raw terminal dumps
- market-aware command actions for US and India workflows
start_dashboard.sh will:
- activate
venv/ - install
fastapi,uvicorn,sse-starlette, andhttpxif needed - start the FastAPI app from
api.py
| File or Folder | Purpose |
|---|---|
scanner_results.json |
Latest US result set |
scanner_results_YYYY-MM-DD.json |
Dated US snapshots |
india_results.json |
Latest India result set |
india_results_YYYY-MM-DD.json |
Dated India snapshots |
scan_state.db |
Current resume state and latest scan metadata |
scan_mega_history.db |
Permanent archive of scan events and generated artifacts |
exports/ |
CSV/Markdown/workflow export bundles |
These are runtime artifacts, not public source assets.
To keep the repo public while preserving privacy:
- commit code, templates, and docs
- keep real thresholds in
.scanner_secrets/scan_conditions.jsonor another local path - keep broker credentials in
.env - do not publish generated result JSON, databases, logs, exports, or backup folders
The current .gitignore is already set up for that model.
Create the local file from the template:
mkdir -p .scanner_secrets
cp scan_conditions.example.json .scanner_secrets/scan_conditions.jsonOr point SCAN_CONDITIONS_FILE to your private file.
You can still run ./India_scan.sh run without broker credentials. The scanner falls back where possible, but some live-limit or market-microstructure enrichments will not be available.
If the dashboard backend fails due to missing FastAPI dependencies, rerun:
./start_dashboard.shThe script installs the required packages into venv/ automatically.
doc/start_scan.mddoc/India_scan.mddoc/start_dashboard.mddoc/launcher_command_reference.mddoc/US_IN_Scanner_Documentation.mddoc/open_source_release.md
The committed repo is designed to keep these private:
- real broker keys
- real scan thresholds
Only placeholder templates are committed. If you share the working directory manually instead of pushing through git, you still need to exclude the private local files and generated artifacts listed above.
The current 15-minute runtime is primarily limited by the aggressive rate-limiting required for scraping external data providers. To reduce the runtime to under 4 minutes, the following architecture is planned:
- Hard Scan (Weekly): Performs full yFinance
.infolookups for fundamentals (PE, Growth, Margins). These are stored in a localfundamental_cache. - Cached Scan (Daily): Merges the cached fundamentals with live price data from the Broker API.
- Direct Quotes: Using Fyers (India) and high-speed US broker APIs to fetch CMP, volume, and 52-week proximity data in bulk.
- Bulk Requests: Sending batches of 50-100 symbols per API call to eliminate per-ticker loop latency.
- Minimized Sleep: Transitioning from 1-3 second per-ticker delays to 1-2 second per-chunk pauses.
- Concurrent Processing: Leveraging asynchronous I/O and bulk history downloads for technical indicator calculations (EMAs, RSI).

