Логотип Market Breadth

Market Breadth

Спільнота
Shubhamkumartrichy
market-breadth

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
Назва навичкиmarket-breadth
Зірки
57
Форки
11
Файли в пакеті
1
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 1

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: Shubhamkumartrichy. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Market Breadth у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/Shubhamkumartrichy/claude-trading-skills-india/tree/main/skills/market-breadth
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Shubhamkumartrichy/claude-trading-skills-india.git /tmp/claude-trading-skills-india
mkdir -p .claude/skills
cp -r /tmp/claude-trading-skills-india/skills/market-breadth .claude/skills/market-breadth
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Market Breadth в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Market Breadth, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Market Breadth не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

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 the data

  • Constituents: niftyindices.com, each index page, "Index Constituent" CSV (for example ind_nifty500list.csv, with Company Name, Industry and Symbol columns). Pass it straight to --universe-file or --members.
  • Exchange-wide A/D (--ad-csv): NSE and BSE show daily advances, declines and unchanged counts, and 52-week high/low lists, on their market-data pages. nseindia.com blocks scripts, so copy the numbers by hand or find them with WebSearch in market-wrap reports, citing the source. Columns: Date,Advances,Declines[,Unchanged,New 52W Highs,New 52W Lows,NIFTY 50]. Any case or spacing works, and the index column feeds the divergence check. This mode gives A/D, McClellan, thrust and highs/lows but no DMA participation (that needs per-stock prices).

3. What it measures

MetricDefinition in breadth.py
% above 20/50/200 DMAStocks with close > N-day SMA ÷ stocks with ≥ N bars. Change over 5 and 20 sessions in points
Uptrend ratio% of stocks with close > 50 DMA > 200 DMA (stocks with ≥ 200 bars)
Advance / declineClose vs that stock's previous close; equal = unchanged. A/D line = running sum of A − D (read its slope, not its level)
DivergenceOver --div-window sessions: index up ≥ 1% while the A/D line falls = bearish; index down ≥ 1% while it rises = bullish
New 52w highs/lowsToday's high above every high of the prior 251 sessions (lows mirrored). Only stocks with 252 bars count
McClellanRANA = 1000 × (A − D)/(A + D). Oscillator = EMA19(RANA) − EMA39(RANA) (smoothing 0.10/0.05, SMA-seeded). Summation = running sum of the oscillator from the first value
Breadth thrust10-session EMA of A/(A + D) closes above 0.615 having been below 0.40 within the previous 10 sessions (Zweig's thresholds). "Armed" = below 0.40 recently, window still open
Sector participationA sector participates when ≥ 50% of its members are above their 50 DMA
Circuit suspectsZero-range bar (high = low) with a move ≥ 1.9%: probably locked at a price band

Ratio adjustment lets a 50-stock list and exchange-wide counts share one McClellan scale. The summation level depends on where the data starts, so read its direction and zero crossings.

4. Health score (0–100)

ComponentWeightScaling
Participation250.2 × %>20 DMA + 0.4 × %>50 DMA + 0.4 × %>200 DMA
Uptrend ratio1510% → 0, 60% → 100
Participation trend1020-session change in %>50 DMA: −25 pts → 0, +25 → 100
A/D line1520-session (A − D)/(A + D): −0.25 → 0, +0.25 → 100
McClellan10oscillator −100 → 0, +100 → 100
Highs vs lows1510-session new highs ÷ (highs + lows); none of either = 50
Sectors10% of sectors participating

Missing components (no members, short history, --ad-csv) are dropped and the rest re-weighted. "Coverage" shows how much weight was scored, and under 50% the read is A/D-only. Labels: 75+ Broad participation, 60–74 Healthy, 40–59 Mixed, 25–39 Narrow / weak, below 25 Very weak. The scalings are judgement calls, not fitted values, so compare a universe with its own history (history).

5. Reading breadth in India

  • Index vs broad market. The top six names (HDFC Bank, ICICI Bank, Reliance, Infosys, Bharti Airtel, L&T) are about 40% of NIFTY 50, so heavyweight-led rallies are common (2018: smallcaps fell hard while NIFTY made highs). Run one folder three ways: NIFTY 50, NIFTY 500, midcap/smallcap lists. NIFTY near highs with NIFTY 500 %>50 DMA under 40% and falling, or a bearish A/D divergence, is a narrowing market; the script flags an index above its 50 DMA with under 40% of stocks above theirs.
  • Survivorship bias. Today's constituent list omits stocks dropped after falling and includes ones added after rallying, so past breadth looks stronger than it was. Treat long history as rough.
  • Circuit-locked stocks. A stock frozen at its 5/10/20% band counts as an advance or decline but nobody could trade it. Clusters of lower circuits in SME, ASM/GSM or small names exaggerate declines, so check the circuit-suspect line before reading a washout.
  • F&O ban names (open interest above 95% of the market-wide limit) still trade in cash and stay in the counts. Their sharp moves are stock events, not breadth.
  • How many stocks. Each stock is 100/N points: 2 points in NIFTY 50, 0.2 in NIFTY 500. Use 100+ for stable percentages and 200–500 for McClellan and thrust, or use --ad-csv exchange counts. Ten stocks give a sketch, not a signal.

6. How other skills use this

  • market-regime sets the exposure ceiling; breadth adjusts within it. Confirmed uptrend with a score under 40 or a bearish divergence: act one notch lower (fewer, smaller new positions). In a Correction or Rally attempt, count a thrust as supporting evidence for a follow-through day. Score 60+ with %>50 DMA rising backs the uptrend.
  • market-pulse: the "Breadth" line quotes exchange A/D for the day, NIFTY 500 %>50/200 DMA, the score and label, and any divergence or thrust. Don't infer breadth from index points.
  • india-market-analyst: put the breadth label next to the regime in the context line. In a narrow market, prefer leaders in participating sectors and cut size in small caps.
  • breakout-planner: in a narrow tape (under 40% above the 50 DMA) demand stronger relative strength.
  • sector-rotation has per-sector member breadth (its breadth sub-command); this is the market view.

Caveats

  • Stale or suspended stocks (no bar on the last date) are excluded and listed. Use split-adjusted daily bars after 15:30 IST: a raw split looks like a crash, a partial day distorts A/D.
  • Thresholds (0.40/0.615 thrust, 19/39 McClellan, 52-week window) are US-born conventions applied to Indian data. Replay past turns with --as-of (Mar 2020, mid-2022, early 2025) before you rely on them.

Output

Breadth: [universe, N stocks / exchange A/D] to [date] | score s/100 [label] (coverage c%)
%>20/50/200 DMA a/b/c (20-session change) | uptrend u% | A/D adv/dec, 20s net, divergence [flag]
NH/NL today and 10s | McClellan osc, summation trend | thrust [state] | sectors k/m participating
Read: [one line] | Regime fit: [how it shifts the market-regime exposure ceiling]

Educational analysis, not investment advice. Data: [sources + timestamps].

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Market Breadth?

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", "marke...

Навіщо використовувати Market Breadth у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Market Breadth — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Market Breadth у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/Shubhamkumartrichy/claude-trading-skills-india/tree/main/skills/market-breadth. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Market Breadth?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Market Breadth?

Зі скількома забажаєте. У TypingMind ви можете використовувати Market Breadth із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Market Breadth?

Так. На GitHub цю навичку публікує Shubhamkumartrichy за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇