market-data
Skill3 starsChanged 47 days agoMITView on GitHub
Set up market data for TradeBlocks analysis. Guides through fetching daily and intraday bars, VIX context, and option quotes from a provider, or importing minute bars from CSV or DuckDB. Use when market data is missing, regime analysis shows no matches, or replay returns empty paths.
- Reads credentials
10 other projects use a version of this.
Adopted by
Most recently taken up by
- from68/claude-portfolio-management-skillstheir own version, first seen Nov 1, 2026
- TermiX-official/cryptoclawtheir own version, first seen Oct 8, 2026
- IngAs8/ClaudeSkilltheir own version, first seen Sep 28, 2026
- tradeblocks-org/tradeblocks-skillsword for word, first seen Sep 28, 2026
- qunyou-agent/finance-skillstheir own version, first seen Jul 6, 2026
- TimurTsedik/ru-market-analysttheir own version, first seen Jun 22, 2026
Other versions10 projects use a version of this.
Word for word · 1
- tradeblocks-org/tradeblocks-skills★ 3100% same
Edited · 0
None found.
Wrote their own version · 9
- TermiX-official/cryptoclaw★ 100same name
- rebyteai-template/rebyte-skills★ 17same name
- gravity-technologies/grvt-skills★ 4same name
- qunyou-agent/finance-skills★ 4same name
- kohoj/skills★ 1same name
- TimurTsedik/ru-market-analyst★ 1same name
- from68/claude-portfolio-management-skills★ 0same name
- IngAs8/ClaudeSkill★ 0same name
- Yahmez3/Claude-Skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- compareSkill
- dc-analysisSkill
- health-checkSkill
- is-this-optimum-realSkill
- oo-captureSkill
- optimizeSkill
- portfolioSkill
- profileSkill
- riskSkill
- wfaSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 5 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Ask the user what they're trying to do, then check what data exists:
- Very specific: line 23
Use run_sql with query to inspect coverage (and describe_database if the schema is unfamiliar):
- Very specific: line 92
Call fetch_bars for each trade's underlying (the ticker its option root resolves to, e.g.
- Very specific: line 93
Run replay_trade for one of the prepared trades, or batch_exit_analysis with the same block_id, filters and limit you used in step 1, so it …
- Very specific: line 116
Use dry_run: true first to inspect the mapping.
- Distinctive: line 141
Run the fetches or imports based on what's missing.
- Very specific: line 156
Run replay_trade, or batch_exit_analysis with those same filters and limit, against the cached quotes and bars
- Very specific: line 160
After fetching or importing, verify the data is available using run_sql:
- Very specific: line 183
If Term_Structure_State is all NULL, check coverage for VIX, VIX9D, and VIX3M, fetch any missing bars, then call compute_vix_context for …
- Very specific: line 203
Don't assume a single VIX import computes complete context — ingest all three VIX-family tickers before compute_vix_context
- Distinctive: line 204
Don't assume all date ranges have data — Massive index bars start 2023-02-14
- Distinctive: line 205
Don't skip per-ticker enrichment — without it RSI and other per-ticker fields won't be populated, and context computation needs enriched …
- Distinctive: line 206
Don't fetch the same data twice without checking — repeated calls waste provider usage
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Market Data Setup
Guide the user through importing market data so other skills (DC analysis, health checks, replay) have the data they need.
When This Skill Triggers
enrich_tradesreturns warnings about missing market dataanalyze_regime_performancereturns "No trades matched to market data"replay_tradereturns 0 minute bars / $0 P&Lbatch_exit_analysisreturns mostlynoTriggerwith $0 P&L- User says "import market data", "set up market data", "I need VIX data", etc.
Step 1: Diagnose What's Missing
Ask the user what they're trying to do, then check what data exists:
Use run_sql with query to inspect coverage (and describe_database if the schema is unfamiliar):
-- Daily bars derived from spot data
SELECT ticker, COUNT(*) AS days, MIN(date) AS earliest, MAX(date) AS latest
FROM market.spot_daily GROUP BY ticker ORDER BY ticker-- Underlying intraday bars
SELECT ticker, COUNT(*) AS bars, MIN(date) AS earliest, MAX(date) AS latest
FROM market.spot GROUP BY ticker ORDER BY ticker-- Minute option quotes used by replay
SELECT underlying, COUNT(DISTINCT ticker) AS contracts,
MIN(date) AS earliest, MAX(date) AS latest
FROM market.option_quote_minutes GROUP BY underlying-- Cross-ticker regime and term structure
SELECT COUNT(*) AS days, MIN(date) AS earliest, MAX(date) AS latest
FROM market.enriched_contextPresent what's available and what's missing for their goal.
Step 2: Determine the Right Data Source
For Regime Analysis (VIX regimes, term structure, enriched trades)
Minimum needed: Daily bars for the underlying and for VIX, VIX9D, VIX3M. Fetch all three VIX tickers before computing cross-ticker context.
| What to fetch | Tool | Example arguments |
| Underlying daily (SPX or QQQ) | fetch_bars | tickers: ["SPX"], from: "2023-02-14", to: "2024-12-31", timespan: "1d" |
| VIX-family daily bars | fetch_bars | tickers: ["VIX", "VIX9D", "VIX3M"], from: "2023-02-14", to: "2024-12-31", timespan: "1d" |
| Cross-ticker context | compute_vix_context | from: "2023-02-14", to: "2024-12-31" |
Order matters: fetch_bars writes spot bars and auto-enriches each ticker. Once all three VIX-family tickers are ingested and enriched, call compute_vix_context for the same date range. Never compute context on a partially loaded VIX family.
Useful flags on fetch_bars:
dry_run: true— preview without writingskip_enrichment: true— defer per-ticker enrichment; if used, callenrich_market_datafor each ticker beforecompute_vix_context
Provider coverage: Massive index bars start 2023-02-14; choose dates the active provider actually covers. to takes a YYYY-MM-DD date, not "today".
Date range: Match the trade data range. Check with:
SELECT MIN(date_opened) as earliest, MAX(date_opened) as latest
FROM trades.trade_data WHERE block_id = '<block>'For Trade Replay (minute-level P&L paths, greeks, exit trigger simulation)
Needed: Minute option quotes for each OCC leg and minute underlying spot bars for the same trade dates. replay_trade reads the local cache only; it does not auto-fetch missing data.
- Decide which trades you will analyze.
batch_exit_analysistakes the newestlimittrades (default 50, max 200) after its optionalstrategy,date_range,min_plandmax_plfilters, so read the legs and dates of exactly that set withrun_sql, using the same filters and limit:
SELECT legs, date_opened, date_closed FROM trades.trade_data
WHERE block_id = '<block>'
-- AND strategy ILIKE '%<strategy>%' AND date_opened >= '<from>' AND date_opened <= '<to>'
-- AND pl >= <min_pl> AND pl <= <max_pl>
ORDER BY date_opened DESC LIMIT 50- Obtain the OCC tickers from every returned trade's legs, then call
fetch_quotesfor them from each trade'sdate_openedthrough itsdate_closed(a trade held overnight needs every session it was open), e.g.tickers: ["SPXW260320P06410000"],from: "2026-03-20",to: "2026-03-20". Use the actual trade dates and provider coverage; for supported ThetaData bulk fetching,underlyings: ["SPX"]can replacetickers. - Call
fetch_barsfor each trade's underlying (the ticker its option root resolves to, e.g.SPXforSPXWlegs orQQQforQQQlegs;resolve_rootexplains a root you are unsure of) with the same open-through-closefromandto, andtimespan: "1m"for underlying spot bars. - Run
replay_tradefor one of the prepared trades, orbatch_exit_analysiswith the sameblock_id, filters andlimityou used in step 1, so it replays only trades whose data is cached. Trades it reports as skipped are missing cached data.
Note: Provider option coverage varies. Missing quotes or underlying bars can yield degenerate replay; inspect coverage before trusting a $0 result.
For TradingView CSV Import
import_market_csv imports minute bars into spot; daily bars and indicators are derived from the intraday data. For a TradingView minute-bar CSV whose time column is a Unix timestamp, map that column to date: the parser extracts the time automatically. Do not present a daily-only CSV as minute bars.
{
"file_path": "~/Downloads/SPX_1m.csv",
"ticker": "SPX",
"column_mapping": {
"time": "date",
"open": "open",
"high": "high",
"low": "low",
"close": "close"
},
"dry_run": true
}Use dry_run: true first to inspect the mapping; then repeat without it to write. VIX-family CSV imports also update cross-ticker context, but import all three before verifying derived context.
For External DuckDB Import
import_from_database imports minute bars from a read-only attached DuckDB file, with ext_import_source as the table alias. Map query columns to spot bar fields:
{
"db_path": "~/data/market.duckdb",
"query": "SELECT date, time, open, high, low, close FROM ext_import_source.spx_minutes",
"ticker": "SPX",
"column_mapping": {
"date": "date",
"time": "time",
"open": "open",
"high": "high",
"low": "low",
"close": "close"
},
"dry_run": true
}Step 3: Fetch or Import
Run the fetches or imports based on what's missing. Common recipes:
Recipe: Full SPX Setup (regime + enrichment)
fetch_bars:tickers: ["SPX"],from: "2023-02-14",to: "2024-12-31",timespan: "1d"fetch_bars:tickers: ["VIX", "VIX9D", "VIX3M"], same dates andtimespan: "1d"- Once all three VIX tickers are enriched,
compute_vix_context: samefromandto
Recipe: Full QQQ Setup
fetch_bars:tickers: ["QQQ"], the chosenfromandto,timespan: "1d"- Fetch the VIX family and compute context as above (shared across underlyings)
Recipe: Replay Data for a Block
- Select the trades to analyze with the same filters and
limitthatbatch_exit_analysiswill use (see For Trade Replay, step 1) fetch_quotesfor every selected trade's OCC tickers fromdate_openedthroughdate_closedfetch_barsfor the underlying withtimespan: "1m"over the same open-through-close dates- Run
replay_trade, orbatch_exit_analysiswith those same filters andlimit, against the cached quotes and bars
Step 4: Verify
After fetching or importing, verify the data is available using run_sql:
-- Check daily coverage
SELECT ticker, COUNT(*) AS days, MIN(date) AS earliest, MAX(date) AS latest
FROM market.spot_daily GROUP BY ticker ORDER BY ticker-- Check regime data populated
SELECT Vol_Regime, COUNT(*) AS days
FROM market.enriched_context
GROUP BY Vol_Regime ORDER BY Vol_Regime-- Check term structure populated
SELECT Term_Structure_State, COUNT(*) AS days
FROM market.enriched_context
WHERE Term_Structure_State IS NOT NULL
GROUP BY Term_Structure_StateIf Term_Structure_State is all NULL, check coverage for VIX, VIX9D, and VIX3M, fetch any missing bars, then call compute_vix_context for the complete range.
Common Issues
| Symptom | Cause | Fix |
enrich_trades shows null VIX3M fields | VIX3M spot bars missing | fetch_bars for VIX3M, then compute_vix_context after all three VIX tickers are enriched |
Term_Structure_State all NULL | VIX-family bars or context missing | Fetch all three VIX tickers, then compute_vix_context |
analyze_regime_performance returns 0 matched | No underlying daily bars | fetch_bars for the underlying with timespan: "1d" |
replay_trade returns 0 bars | Cached option quotes or underlying minute bars missing | fetch_quotes for OCC tickers and fetch_bars for the underlying with timespan: "1m" |
| Enrichment fields missing (RSI, ATR) | Per-ticker enrichment skipped | Run enrich_market_data with ticker for each affected ticker |
| Provider fetch returns 0 rows | Date range outside provider coverage | Check the provider's available date range |
| CSV import fails on column mapping | Wrong column names | Use dry_run: true first to preview |
Cleanup
purge_market_table accepts only table: "daily" | "date_context" | "intraday"; it deletes all rows in that table and its sync metadata, not one ticker or date range. Inspect coverage and confirm the scope with the user before using it to repair corrupted data.
What NOT to Do
- Don't assume a single VIX import computes complete context — ingest all three VIX-family tickers before
compute_vix_context - Don't assume all date ranges have data — Massive index bars start 2023-02-14
- Don't skip per-ticker enrichment — without it RSI and other per-ticker fields won't be populated, and context computation needs enriched VIX data
- Don't fetch the same data twice without checking — repeated calls waste provider usage
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

