К основному содержанию
скилл CX Codex

market-regime — скилл для Claude Code: режим рынка и установка

Скилл market-regime для Claude Code оценивает режим рынка по данным индекса или ETF. Запускается на вопросах о тренде NIFTY и размере позиции перед новыми сделками.

MIT ★ 69 обновлён 2026-11-13

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add Shubhamkumartrichy/claude-trading-skills-india
/plugin install india-trading-skills@india-trading-skills
Открыть на GitHub

Что делает market-regime

Скилл анализирует NIFTY, BANKNIFTY, SENSEX или другой индекс по CSV и определяет режим рынка. Он учитывает дни распределения, цикл коррекции и попытки роста, скользящие средние 50 и 200 дней, просадку от максимума за 52 недели и, если передан, India VIX. На выходе — оценка риска от 0 до 100, метка режима, верхний предел капитала в позициях и уровни, при которых метка изменится.

Для объёма можно передать отдельный CSV с данными ETF или фьючерсов; при запуске по символу скрипт получает объём ETF автоматически. Если объём недоступен, он переходит в режим только по цене и помечает результат как менее надёжный: без объёма день распродажи не считается днём распределения. Скрипт regime.py умеет работать с CSV офлайн.

Какие задачи решает

  • оценить, находится ли индекс в коррекции или восходящем тренде
  • подсчитать дни распределения за заданный период
  • проверить, подтвердил ли отскок новый восходящий тренд
  • задать предел капитала и число новых позиций по режиму рынка

Примеры запросов агенту

  • Определи режим NIFTY по файлу nifty.csv и объёму из niftybees.csv.
  • Проверь, есть ли дни распределения у BANKNIFTY.
  • Оцени режим SENSEX по символу и покажи уровни, которые изменят метку.

Как установить market-regime

1Через маркетплейс плагинов

/plugin marketplace add Shubhamkumartrichy/claude-trading-skills-india
/plugin install india-trading-skills@india-trading-skills

Команда ставит плагин india-trading-skills целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add Shubhamkumartrichy/claude-trading-skills-india --skill market-regime -a claude-code

3Вручную: положить файлы

~/.claude/skills/market-regime/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/market-regime/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о market-regime

Как установить market-regime в Claude Code?

Безопасная команда: /plugin marketplace add Shubhamkumartrichy/claude-trading-skills-india. Затем выполни /plugin install india-trading-skills@india-trading-skills.

Что делает market-regime?

Скилл оценивает рыночный режим по индексным данным и выдаёт оценку риска, метку режима и предел экспозиции. Он также показывает уровни, которые могут изменить метку.

Какие данные можно использовать в market-regime?

Можно передать CSV индекса и отдельный CSV объёма ETF или фьючерсов. Также скрипт умеет получать данные по символу; India VIX можно передать отдельно.

Исходный текст

SKILL.md · MIT
---
name: market-regime
description: |
  Reads the market regime of NIFTY, BANKNIFTY, SENSEX (or any index/ETF CSV) from the index's own
  tape: distribution-day clusters with 25-session/5%-rally expiry, the correction → rally attempt →
  follow-through cycle, 50/200 DMA and 52-week drawdown context, and optional India VIX. Outputs a
  0–100 risk score, a regime label, an exposure ceiling (% of capital, max new positions) and the
  levels that would change the label. Handles Yahoo's missing index volume via ETF/futures proxy or a
  clearly flagged price-only mode. regime.py works offline from CSV.

  Use when the user asks: "is the market in an uptrend", "should I be buying now", "how much should
  I be invested", "is NIFTY topping", "distribution days on NIFTY", "follow-through day", "is this
  bounce real", "market regime", "should I go to cash", or before any new swing/positional entries.
---

# Market Regime

Decide how much risk the market allows before picking stocks. Most swing breakouts fail when the
index is distributing or correcting, so the regime sets the exposure ceiling for every other skill.

## Commands

```bash
python3 scripts/regime.py status --csv nifty.csv --volume-csv niftybees.csv --vix 14.2
python3 scripts/regime.py status --symbol NIFTY --vix 14.2          # yfinance; ETF volume auto-fetched
python3 scripts/regime.py distribution --csv nifty.csv --volume-csv niftybees.csv --all --stalling
python3 scripts/regime.py ftd --csv banknifty.csv --volume-csv bankbees.csv --events 15
python3 scripts/regime.py trend --symbol SENSEX
python3 scripts/regime.py status --csv nifty.csv --as-of 2026-06-05 --json   # replay a past date
```
Inputs match `../technical-analysis/scripts/ta.py` (`--csv`, `--candles`, `--symbol`). Useful flags:
`--ftd-pct`, `--dd-pct` (0.2), `--dd-window` (25), `--correction-pct` (5), `--ignore DATE,DATE`,
`--expiry-day tue|thu`, `--price-only`, `--no-proxy`, `--json`. Run after 15:30 IST on daily bars.

## Volume: the India data problem

Yahoo's `^NSEI` and `^NSEBANK` usually carry zero or patchy volume. The script checks this (≥80% of
recent sessions must have non-constant volume) and then:
1. `--volume-csv` / `--volume-symbol`: volume from another series matched by date. Use NIFTYBEES or
   BANKBEES (ETF), or continuous NIFTY futures exported from your broker or TradingView. Futures
   volume jumps in the monthly rollover week (last Tuesday), so treat DDs there with suspicion.
2. With `--symbol NIFTY` or `BANKNIFTY` it fetches NIFTYBEES/BANKBEES volume automatically.
3. Otherwise it runs **price-only** and says so. In this mode a heavy-selling day is a fall of at
   least 0.75% closing in the lower half of its range, and a follow-through needs only the gain and an
   upper-half close. Report the result as lower-confidence. Never call it "distribution" without volume.

Sessions after an abnormally thin one (Muhurat trading, special Saturday sessions) are not judged,
because beating a thin session's volume proves nothing.

## Signals and how to read them in India

| Signal | Rule in regime.py | Indian reading |
|---|---|---|
| Distribution day | Close −0.2% or worse on higher volume than the prior session. Counts for 25 sessions incl. the day, or until a close 5% above it | 4–5 inside 25 sessions = institutions selling into strength. Carries more weight when NSE provisional data shows a multi-day FII cash-selling streak. Heavy DII/SIP buying often turns FII selling into flat or small-down days |
| Stalling day (`--stalling`, half weight) | Gain of 0–0.4% on higher volume near the 25-session high, closing in the lower half of the range | Churning at the top. Common before results-season disappointments |
| Correction | Close 5% below the cycle peak | Starts the bottoming watch |
| Rally attempt | First up close after the correction low. Fails if that low is undercut | Days 1–3 prove nothing. Short-covering into weekly expiry often creates them |
| Follow-through (FTD) | Day 4 or later of the attempt, gain ≥ threshold on higher volume | Confirms a new uptrend. It fails if price later closes below the rally low; many do |
| Trend/duration | Close vs 50/200 DMA, 50 DMA slope, drawdown from 52-week high, sessions since high/low | Depth: <3% near highs, 3–5% pullback, 5–10% correction, 10–20% deep, 20%+ bear |
| India VIX (`--vix`) | <13 calm, 13–17 normal, 17–22 elevated, 22–30 stressed, 30+ panic | VIX ≥ 22 caps exposure at 50% |

**FTD threshold default.** The script uses 1.5 × the 250-session standard deviation of daily returns,
clamped to 1.0–2.0%. NIFTY's daily σ is usually 0.7–0.9%, so this lands near **1.1–1.3%**, and
higher for BANKNIFTY. A fixed US-style 1.5–1.7% hurdle would almost never fire on NIFTY. Pass
`--ftd-pct` to fix it (for example 1.2 for NIFTY or 1.5 for BANKNIFTY).

**Event days.** Pass Budget day, RBI policy days, election-result days, MSCI/FTSE rebalance days
(huge closing-auction volume) and Muhurat sessions to `--ignore` if they distort volume. DDs that
land on the weekly-expiry weekday are tagged (`--expiry-day`: tue for NIFTY, the default; thu for
SENSEX). Weigh them lighter if your volume source is futures or the ETF. A market-wide
circuit-breaker day (±10/15/20% on NIFTY or SENSEX, see `indian-market-structure`) is tagged. It
means the regime has already broken, so don't wait for a DD count.

## Regime → exposure

| Label | When | Exposure ceiling | New positions |
|---|---|---|---|
| Confirmed uptrend | No correction, < 5 DDs, above 50 DMA, score < 50 | 100% (score < 25) / 80% | 5 / 4 |
| Confirmed uptrend (fresh FTD) | FTD in the last 10 sessions and score < 60 | 50% | 3 starter-size |
| Uptrend under pressure | ≥ 5 DDs in 25 sessions, ≥ 4 in 15, below 50 DMA, or score ≥ 50 | 60% / 40% if score ≥ 50 | 2 / 1 |
| Uptrend under pressure (fresh FTD) | FTD in the last 10 sessions but score ≥ 60 | 30% | 2 pilots |
| Rally attempt | Bouncing from the correction low, no FTD yet | 25% | 1 pilot, half size |
| Correction | ≥ 5% below the cycle peak, no rally attempt | 20% (10% if 10%+ deep) | 0 |

The risk score combines distribution (35 points), trend (30), drawdown (20) and VIX (15 if given),
scaled to 100, minus 10 during a live follow-through. It is a heuristic, not a probability.
"What would change the label" lists the exact closes to watch: DD expiry and clearing levels, the
50 DMA, the correction trigger, the FTD close needed, and the rally low.

## How other skills use the regime

- `india-market-analyst`: put the label, score and ceiling in the first line of any trade view.
  Don't recommend fresh breakouts in Correction.
- `position-sizing`: scale risk per trade with the regime. Confirmed: 1%. Under pressure: 0.5–0.75%.
  Rally attempt or fresh FTD: 0.25–0.5% pilots. Correction: no new risk. Total deployed capital stays
  below the ceiling.
- `trailing-stops` / `stop-loss-strategies`: under pressure, tighten trails to 1.5 × ATR and book
  partial profits. In Correction, honour every stop.
- `technical-analysis`: a stock setup with a weak regime needs strong relative strength vs NIFTY.
- `fno-options-analysis`: a correction with high VIX favours defined-risk spreads over naked selling.

## Caveats

- The index is not your portfolio. Midcaps and smallcaps can diverge for months. Run it on NIFTY
  MIDCAP 100 or SMALLCAP data too if that is where you trade.
- It uses daily closes only. Intraday reversals and gap risk (global cues, GIFT Nifty) are not seen.
- ETF volume includes market-maker and arbitrage flow. It is a participation proxy, not institutional
  flow. Cross-check with FII/DII figures via `market-pulse`.
- Thresholds are conventions, tuned for NIFTY's lower volatility. Check `--as-of` replays on past
  corrections (Mar 2020, Oct 2024–Mar 2025) before you trust the defaults.

## Output

```
Regime: [label] | risk score s/100 | data as of [date] IST close, volume: [source / price-only]
Exposure ceiling: x% | max new positions: n | stance: ..
DDs: d5 a | d15 b | d25 c (oldest drops out in k sessions; clears ≥ ..) | FTD state: ..
Trend: vs 50 DMA ..% | vs 200 DMA ..% | drawdown ..% (depth class), .. sessions since high
Watch: [levels that change the label]
```
_Educational analysis, not investment advice._

© Shubham Kumar · MIT · Shubhamkumartrichy/claude-trading-skills-india

Похожие скиллы

Каталог скиллов SKILL.md →
macro-regime-detector tradermonty Скилл macro-regime-detector для Claude Code и других кодовых ассистентов выявляет структурные сдвиги макрорежимов на горизонте 1–2 года через анализ кросс-ассетных соотношений. CX Codex +1 4 100установок crypto-regime-analyzer tradermonty Скилл crypto-regime-analyzer считает композитный балл 0–100 по шести компонентам крипторынка и выдаёт рекомендацию по позе. Без ключей API. CX Codex +1 3 100установок trader-regime ruvnet Скилл trader-regime просит у neural-trader текущий режим рынка и подбирает тип стратегии под него. Нужен перед бэктестом или выбором стратегии. CX Codex +1 733установок regime-detection agiprolabs Скилл regime-detection для Claude Code: по свечам определяет режим рынка — тренд или флэт — и оценивает ожидаемую волатильность. CX Codex +1 659установок sales-market-sizing Maya-Beth Finotti Скилл sales-market-sizing считает TAM, SAM и SOM для планирования продаж, территорий и квот. Подходит для B2B и B2C. CX Codex +1 34 500установок firecrawl-market-research firecrawl Скилл firecrawl-market-research собирает через Firecrawl свежие цифры о рынке и компаниях — размер, рост, финансы, отчётность — и складывает их в отчёт со ссылками на источники. CX Codex +1 32 800установок

Из того же набора36

Весь набор →
breakout-planner Скилл breakout-planner для Claude Code оценивает пробойные сетапы акций NSE/BSE и рассчитывает план сделки. Запускается на запросы о тренде Stage 2, базе, точке входа или сканировании списка акций. CX Codex +1 ★ 69звёзд репо stock-screener Скилл stock-screener для Claude Code отбирает и ранжирует индийские акции по данным CSV. Запускается по запросу проверить список компаний, найти акции с заданными финансовыми показателями или объяснить, почему компания не прошла фильтр. CX Codex +1 ★ 69звёзд репо results-season Скилл results-season для Claude Code анализирует реакцию акций NSE и BSE на квартальные отчёты. Он оценивает гэп, объём и движение цены после публикации. CX Codex +1 ★ 69звёзд репо portfolio-review Скилл portfolio-review для Claude Code анализирует портфель индийских акций и отмечает концентрацию, риски и варианты ребалансировки. Запускается по запросу проверить портфель или после загрузки брокерского файла. CX Codex +1 ★ 69звёзд репо momentum-scanner Скилл momentum-scanner для Claude Code ищет импульсные движения и сильные акции NSE/BSE. Запускается на запросы о пробоях, гэпах после новостей и рейтинге относительной силы. CX Codex +1 ★ 69звёзд репо trading-discipline Скилл trading-discipline для Claude Code проверяет торговый план до сделки и оценивает текущий риск по журналу. Он подключается на вопросы о входе в сделку, дневном лимите убытка или серии потерь. CX Codex +1 ★ 69звёзд репо event-calendar Скилл event-calendar для Claude Code собирает календарь событий, способных повлиять на индийский рынок. Запускается на запросы о сроках экспирации, заседании RBI, макроданных и риске события в торговом окне. CX Codex +1 ★ 69звёзд репо thesis-tracker Скилл thesis-tracker для Claude Code записывает торговые идеи по индийским акциям и F&O как проверяемые тезисы. Запускается по просьбе добавить идею, проверить открытые позиции или разобрать закрытую сделку. CX Codex +1 ★ 69звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой