← ClaudeAtlas

market-breadthlisted

Market-wide breadth for Indian equities: how many NSE/BSE stocks are actually joining the index's move. From a folder of stock CSVs (NIFTY 50/500, midcap or smallcap constituents), a yfinance symbol list, or an exchange advances/declines file, breadth.py reports % of stocks above 20/50/200 DMA, the uptrend ratio, advances/declines with an A/D line and divergence against NIFTY, new 52-week highs/lows, the McClellan oscillator and summation index, breadth thrusts, sector participation and a 0–100 health score. Works offline from CSV. Use when the user asks: "is this rally broad-based", "market breadth", "advance decline ratio", "how many stocks are above the 200 DMA", "is NIFTY being carried by a few heavyweights", "are midcaps and smallcaps participating", "McClellan oscillator for NSE", "breadth thrust", "new highs vs new lows", or wants breadth context alongside the market regime.
Shubhamkumartrichy/claude-trading-skills-india · ★ 62 · Data & Documents · score 84
Install: claude install-skill Shubhamkumartrichy/claude-trading-skills-india
# Market Breadth (India) The index tells you where a few large weights went. Breadth tells you what the typical stock did. A NIFTY high made by five heavyweights while most stocks slide is a weaker market than the chart shows. ## 1. Run it ```bash python3 scripts/breadth.py status --csv-dir nifty500/ --benchmark-csv "NIFTY 50.csv" --members ind_nifty500list.csv python3 scripts/breadth.py status --csv-dir nifty500/ --universe-file ind_nifty50list.csv --benchmark-csv nifty.csv python3 scripts/breadth.py status --ad-csv nse_adv_dec.csv # exchange counts, no stock files python3 scripts/breadth.py status --universe-file ind_nifty500list.csv --save-dir nifty500/ # yfinance python3 scripts/breadth.py history --csv-dir nifty500/ --sessions 60 --out breadth.csv --json ``` Stock CSVs are daily OHLCV, one per stock, file stem = symbol (`RELIANCE.csv`, `.NS` is stripped), from `../technical-analysis/scripts/ta.py fetch`, a broker export, or `--save-dir` (caches the Yahoo download: ~500 requests for NIFTY 500). Rows with blank or null prices are skipped. `--pattern` filters the folder; `--universe-file` restricts it to a constituent list, so one NIFTY 500 folder gives NIFTY 50, NIFTY 500 and midcap breadth. `--members` (symbol,sector, or the Industry column of a niftyindices list) adds sector participation. Also: `--as-of DATE` (replay), `--hl-window 252`, `--div-window 20`, `--div-min-pct 1.0`, `--benchmark NAME` (yfinance; NIFTY by default when fetching). ## 2. Getting th