backtest-expert
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
Detect IBD-style Distribution Days for QQQ/SPY (close down at least 0.2% on higher volume), track 25-session expiration and 5% invalidation, count d5/d15/d25 clusters, classify market risk (NORMAL/CAUTION/HIGH/SEVERE), and emit TQQQ/QQQ exposure recommendations. Use after market
$ npx -y skills add BaggaT236/AI-Trading-Skills --skill ibd-distribution-day-monitor --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ibd-distribution-day-monitorContext preview
The summary Claude sees to decide when to auto-load this skill.
Detect IBD-style Distribution Days for QQQ/SPY (close down at least 0.2% on higher volume), track 25-session expiration and 5% invalidation, count d5/d15/d25 clusters, classify market risk (NORMAL/CAUTION/HIGH/SEVERE), and emit TQQQ/QQQ exposure recommendations. Use after market
name: ibd-distribution-day-monitor description: Detect IBD-style Distribution Days for QQQ/SPY (close down at least 0.2% on higher volume), track 25-session expiration and 5% invalidation, count d5/d15/d25 clusters, classify market risk (NORMAL/CAUTION/HIGH/SEVERE), and emit TQQQ/QQQ exposure recommendations. Use after market close, before TQQQ exposure changes, or as input to FTD/market-state frameworks. Does not execute trades.
Detect IBD-style Distribution Days for major market ETFs (QQQ as Nasdaq proxy, SPY as S&P 500 proxy) and produce a daily market deterioration signal plus a TQQQ/QQQ exposure recommendation. Designed for post-market review.
Invoke this skill:
Do NOT use this skill to:
A Distribution Day is detected when: 1. Today's close is at least 0.2% below yesterday's close. 2. Today's volume is greater than yesterday's volume.
A Distribution Day is removed from the active count when either:
Today's DD is never invalidated immediately because there are no post-DD sessions to evaluate the 5% gain against.
| Risk | Trigger | |------|---------| | NORMAL | `d25 <= 2` | | CAUTION | `d25 >= 3` | | HIGH | `d25 >= 5` OR `d15 >= 3` OR `d5 >= 2` | | SEVERE | `d25 >= 6` OR `d15 >= 4` OR (`market_below_21ema_or_50ma` AND `d25 >= 5`) |
When both QQQ and SPY are loaded, QQQ-weighted overall logic applies (TQQQ-aware): a single SEVERE escalates to SEVERE; QQQ HIGH escalates to overall HIGH; QQQ NORMAL + SPY HIGH still escalates to HIGH (broad-market spillover).
| Risk | Action | Target Exposure | Trailing Stop | |------|--------|-----------------|---------------| | NORMAL | HOLD_OR_FOLLOW_BASE_STRATEGY | 100% | base | | CAUTION | AVOID_NEW_ADDS | 75% | min(base, 7%) | | HIGH | REDUCE_EXPOSURE | 50% | min(base, 5%) | | SEVERE | CLOSE_TQQQ_OR_HEDGE | 25% | min(base, 3%) |
QQQ uses a less aggressive policy (HIGH=75%, SEVERE=50%) since it lacks 3x leverage.
1. Load OHLCV for the configured symbols via FMP (`get_historical_prices`). 2. Validate data quality; record skipped sessions in audit. 3. Rebase via `prepare_effective_history` so `effective_history[0]` is the evaluation session. 4. Detect raw Distribution Days; enrich with `high_since`, invalidation event, and status. 5. Count `d5` / `d15` / `d25` active records. 6. Compute 21EMA and 50SMA filters; flag `market_below_21ema_or_50ma` (None if data insufficient). 7. Classify each index, then combine using QQQ-weighted policy. 8. Generate portfolio action for the configured instrument. 9. Write JSON + Markdown reports to `--output-dir` with API keys redacted.
Saved to `reports/` (or `--output-dir`):
JSON is UTF-8 with `ensure_ascii=False` (Japanese explanations preserved). Sensitive keys (`api_key`, `fmp_api_key`, `token`, etc.) are redacted automatically.
python3 skills/ibd-distribution-day-monitor/scripts/ibd_monitor.py \ --symbols QQQ,SPY \ --lookback-days 80 \ --instrument TQQQ \ --current-exposure 100 \ --base-trailing-stop 10 \ --output-dir reports/
FMP API key required. Free tier (250 calls/day) is sufficient for daily QQQ + SPY runs.
Build disciplined, repeatable trading workflows with a modern TypeScript platform.
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
This skill should be used when analyzing market breadth charts, specifically the S&P 500 Breadth Index (200-Day MA based) and the…
Generate Minervini-style breakout trade plans from VCP screener output with worst-case risk calculation, portfolio heat…
Screen US stocks using William O'Neil's CANSLIM growth stock methodology. Use when user requests CANSLIM stock screening, growth…
Validate data quality in market analysis documents and blog articles before publication. Use when checking for price scale…
Use this skill to find high-quality dividend growth stocks (12%+ annual dividend growth, 1.5%+ yield) that are experiencing…