Skip to content

market

The market.* commands return market data snapshots, historical OHLCV rows, market status, regime signals, and sector heat summaries. Use this namespace before price-sensitive analysis that needs provider timestamp and source attribution.

All examples use --output json so results are stable to parse in terminals, scripts, and automation workflows.

Fetch normalized OHLCV records for one or more symbols.

finance market.ohlcv fetches normalized OHLCV records for one or more symbols. It returns ok, data, error, and warnings in JSON output. The result payload includes symbol, timeframe, rows, count, source.

Use this command when you need historical bars for a chart, backtest, event window, or price-reaction calculation.

Behavior details: Arguments use key=value syntax for script-friendly CLI calls.

Terminal window
finance market.ohlcv SYMBOL[,SYMBOL...] [timeframe=1d start_date=YYYY-MM-DD end_date=YYYY-MM-DD limit=200 provider=auto include_attempts=false] [--output json]
ArgumentRequiredDefaultAccepted valuesDescription
symbolsYesNoneStringTicker symbol or comma-separated ticker list, such as AAPL,MSFT,NVDA.
end_dateNoNoneYYYY-MM-DDLast bar date to request.
include_attemptsNofalsetrue, falseInclude provider-attempt diagnostics.
limitNo200IntegerMaximum number of records returned.
providerNoautoStringProvider selection. Use auto unless you need to force a supported provider.
start_dateNoNoneYYYY-MM-DDFirst bar date to request.
timeframeNo1dStringBar interval such as 1d, where supported by the provider.
Terminal window
finance market.ohlcv NVDA timeframe=1d limit=5 --output json

This output was generated with finance market.ohlcv NVDA timeframe=1d limit=5 --output json.

{
"ok": true,
"data": {
"symbol": "NVDA",
"timeframe": "1d",
"rows": [
{
"symbol": "NVDA",
"date": "2026-05-08 00:00:00-04:00",
"open": 213.02999877929688,
"high": 217.8000030517578,
"low": 212.88999938964844,
"close": 215.1999969482422,
"volume": 136421400,
"adjusted_close": 215.1999969482422,
"source": "yfinance"
},
{
"symbol": "NVDA",
"date": "2026-05-11 00:00:00-04:00",
"open": 214.0399932861328,
"high": 222.3000030517578,
"low": 213.88999938964844,
"close": 219.44000244140625,
"volume": 160685800,
"adjusted_close": 219.44000244140625,
"source": "yfinance"
},
{
"symbol": "NVDA",
"date": "2026-05-12 00:00:00-04:00",
"open": 218.5500030517578,
"high": 223.75,
"low": 214.9199981689453,
"close": 220.77999877929688,
"volume": 159176600,
"adjusted_close": 220.77999877929688,
"source": "yfinance"
},
{
"symbol": "NVDA",
"date": "2026-05-13 00:00:00-04:00",
"open": 224.92999267578125,
"high": 227.83999633789062,
"low": 221.57000732421875,
"close": 225.8300018310547,
"volume": 150405400,
"adjusted_close": 225.8300018310547,
"source": "yfinance"
},
{
"symbol": "NVDA",
"date": "2026-05-14 00:00:00-04:00",
"open": 229.72999572753906,
"high": 236.5399932861328,
"low": 229.30999755859375,
"close": 235.74000549316406,
"volume": 175521705,
"adjusted_close": 235.74000549316406,
"source": "yfinance"
}
],
"count": 5,
"source": "yfinance"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.countintegerNumber of records included in the adjacent result array.
data.rowsarrayStructured rows returned by the command.
data.rows[]objectStructured rows returned by the command.
data.sourcestringProvider or source identifier for the returned data.
data.symbolstringTicker symbol returned for the bar set.
data.timeframestringBar interval used for the request.
data.rows[].adjusted_closenumberSplit/dividend-adjusted close price.
data.rows[].closenumberOHLCV close price.
data.rows[].datestringBar timestamp returned by the provider.
data.rows[].highnumberOHLCV high price.
data.rows[].lownumberOHLCV low price.
data.rows[].opennumberOHLCV open price.
data.rows[].sourcestringProvider or source identifier for the returned data.
data.rows[].symbolstringTicker symbol for the bar row.
data.rows[].volumeintegerTrading volume.

Fetch quote via the best available provider.

finance market.quote fetches quote via the best available provider. It returns ok, data, error, and warnings in JSON output. The result payload includes symbol, company_name, sector, industry, website, ir_website, last_price, market_cap.

Use this command when you need a current quote plus compact company fundamentals such as market cap, enterprise value, revenue, cash, debt, and source information.

Behavior details: Uses Alpha Vantage when configured, with Yahoo fallback.

Terminal window
finance market.quote SYMBOL [--output json]
ArgumentRequiredDefaultAccepted valuesDescription
symbolYesNoneStringTicker symbol to query, such as AAPL or NVDA.
Terminal window
finance market.quote NVDA --output json

This output was generated with finance market.quote NVDA --output json.

{
"ok": true,
"data": {
"symbol": "NVDA",
"company_name": "NVIDIA Corporation",
"sector": "Technology",
"industry": "Semiconductors",
"website": "https://www.nvidia.com",
"ir_website": "http://phx.corporate-ir.net/phoenix.zhtml?c=116466&p=irol-IRHome",
"last_price": 235.74,
"market_cap": 5709746405376,
"enterprise_value": 5677459701760,
"shares_outstanding": 24220525225,
"total_revenue": 215938007040,
"cash": 62556000256,
"debt": 11411999744,
"net_debt": -51144000512,
"currency": "USD",
"source": "yfinance",
"fallback_reason": "Alpha Vantage API key is required. Set ALPHAVANTAGE_API_KEY."
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.cashintegerCash or cash equivalents.
data.company_namestringCompany name returned by the provider.
data.currencystringTrading or reporting currency.
data.debtintegerDebt returned by the provider.
data.enterprise_valueintegerEnterprise value.
data.fallback_reasonstringReason the command used a fallback provider.
data.industrystringCompany industry classification.
data.ir_websitestringInvestor-relations website URL.
data.last_pricenumberLatest provider price.
data.market_capintegerMarket capitalization.
data.net_debtintegerDebt minus cash.
data.sectorstringCompany or market sector.
data.shares_outstandingintegerShares outstanding.
data.sourcestringProvider or source identifier for the returned data.
data.symbolstringTicker symbol returned for the quote.
data.total_revenueintegerRevenue returned by the provider.
data.websitestringCompany website URL.

Show market regime context.

finance market.regime shows market regime context. It returns ok, data, error, and warnings in JSON output. The result payload includes market, timeframe, regime, confidence, signals, meta.

Use this command when you need a broad market risk-on/risk-off summary built from deterministic benchmark signals.

Terminal window
finance market.regime [MARKET=US] [TIMEFRAME=swing] [--output json]
ArgumentRequiredDefaultAccepted valuesDescription
marketNoUSStringMarket code for the benchmark set.
timeframeNoswingStringRegime horizon label used by the command.
Terminal window
finance market.regime US swing --output json

This output was generated with finance market.regime US swing --output json.

{
"ok": true,
"data": {
"market": "US",
"timeframe": "swing",
"regime": "risk_on",
"confidence": 0.9,
"signals": [
{
"name": "index_trend",
"symbol": "SPY",
"value": "above_200dma",
"direction": "bullish",
"last_close": 748.17,
"sma_50": 688.8826,
"sma_200": 675.5481,
"return_pct": 9.02
},
{
"name": "breadth",
"value": "constructive",
"direction": "bullish",
"positive_benchmark_count": 3,
"above_50dma_count": 3,
"total_benchmarks": 3
},
{
"name": "volatility",
"symbol": "^VIX",
"value": "contained",
"direction": "neutral",
"last_close": 17.26
}
],
"meta": {
"source": "historical_market_data",
"as_of": "2026-05-15T01:38:47.788597+00:00",
"notes": "Deterministic regime from configured benchmark ETFs/indexes; not an investment conclusion."
}
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.confidencenumberRegime confidence score.
data.marketstringMarket code used by the regime model.
data.metaobjectProvider metadata for the result.
data.regimestringRegime label produced by the command.
data.signalsarrayMarket-regime signal objects.
data.signals[]objectMarket-regime signal objects.
data.timeframestringRegime horizon label used by the command.
data.meta.as_ofstringTimestamp or date when the provider generated the summary.
data.meta.notesstringAdditional notes that affect interpretation.
data.meta.sourcestringProvider or source identifier for the returned data.
data.signals[].above_50dma_countintegerNumber of benchmarks trading above their 50-day moving average.
data.signals[].directionstringBullish, bearish, or neutral interpretation for the signal.
data.signals[].last_closenumberMost recent close in the returned price window.
data.signals[].namestringSignal name, such as trend, breadth, or volatility.
data.signals[].positive_benchmark_countintegerNumber of benchmarks with positive return in the lookback window.
data.signals[].return_pctnumberReturn percentage for the period.
data.signals[].sma_200number200-day simple moving average.
data.signals[].sma_50number50-day simple moving average.
data.signals[].symbolstringBenchmark symbol used by the signal when applicable.
data.signals[].total_benchmarksintegerNumber of benchmark instruments evaluated.
data.signals[].valuestringDiscrete signal value used to classify the regime.

Show sector heat rankings.

finance market.sector_heat shows sector heat rankings. It returns ok, data, error, and warnings in JSON output. The result payload includes market, group_by, lookback_days, leaders, laggards, meta.

Use this command when you need to rank sectors or market groups by recent lookback return.

Terminal window
finance market.sector_heat [MARKET=US] [LOOKBACK_DAYS=20] [GROUP_BY=sector] [--output json]
ArgumentRequiredDefaultAccepted valuesDescription
group_byNosectorStringGrouping dimension. The current command examples use sector.
lookback_daysNo20IntegerCalendar lookback window used for heat ranking.
marketNoUSStringMarket code for the configured sector ETF set.
Terminal window
finance market.sector_heat US 20 sector --output json

This output was generated with finance market.sector_heat US 20 sector --output json.

{
"ok": true,
"data": {
"market": "US",
"group_by": "sector",
"lookback_days": 20,
"leaders": [
{
"name": "Technology",
"symbol": "XLK",
"heat_score": 18.08,
"return_pct": 18.08,
"last_close": 179.5,
"source": "historical_market_data"
},
{
"name": "Consumer Staples",
"symbol": "XLP",
"heat_score": 4.36,
"return_pct": 4.36,
"last_close": 84.98,
"source": "historical_market_data"
},
{
"name": "Energy",
"symbol": "XLE",
"heat_score": 2.63,
"return_pct": 2.63,
"last_close": 58.07,
"source": "historical_market_data"
},
{
"name": "Industrials",
"symbol": "XLI",
"heat_score": 2.45,
"return_pct": 2.45,
"last_close": 174.51,
"source": "historical_market_data"
},
{
"name": "Consumer Discretionary",
"symbol": "XLY",
"heat_score": 0.88,
"return_pct": 0.88,
"last_close": 118.67,
"source": "historical_market_data"
}
],
"laggards": [
{
"name": "Utilities",
"symbol": "XLU",
"heat_score": -3.13,
"return_pct": -3.13,
"last_close": 44.9,
"source": "historical_market_data"
},
{
"name": "Communication Services",
"symbol": "XLC",
"heat_score": -1.45,
"return_pct": -1.45,
"last_close": 117.11,
"source": "historical_market_data"
},
{
"name": "Financials",
"symbol": "XLF",
"heat_score": -1.42,
"return_pct": -1.42,
"last_close": 51.29,
"source": "historical_market_data"
},
{
"name": "Materials",
"symbol": "XLB",
"heat_score": -0.15,
"return_pct": -0.15,
"last_close": 51.67,
"source": "historical_market_data"
},
{
"name": "Health Care",
"symbol": "XLV",
"heat_score": 0.01,
"return_pct": 0.01,
"last_close": 146.63,
"source": "historical_market_data"
}
],
"meta": {
"source": "historical_market_data",
"as_of": "2026-05-15T01:38:50.922109+00:00",
"notes": "Heat score is lookback return percentage for configured public sector ETFs."
}
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.group_bystringGrouping dimension used by the heat command.
data.laggardsarrayLowest-ranked sector, market, or heat records.
data.laggards[]objectLowest-ranked sector, market, or heat records.
data.leadersarrayTop-ranked sector, market, or heat records.
data.leaders[]objectTop-ranked sector, market, or heat records.
data.lookback_daysintegerLookback converted to calendar days.
data.marketstringMarket code used by the heat calculation.
data.metaobjectProvider metadata for the result.
data.laggards[].heat_scorenumberComposite sector heat score.
data.laggards[].last_closenumberMost recent close in the returned price window.
data.laggards[].namestringSector or group name for the laggard row.
data.laggards[].return_pctnumberReturn percentage for the period.
data.laggards[].sourcestringProvider or source identifier for the returned data.
data.laggards[].symbolstringETF or benchmark symbol for the laggard row.
data.leaders[].heat_scorenumberComposite sector heat score.
data.leaders[].last_closenumberMost recent close in the returned price window.
data.leaders[].namestringSector or group name for the leader row.
data.leaders[].return_pctnumberReturn percentage for the period.
data.leaders[].sourcestringProvider or source identifier for the returned data.
data.leaders[].symbolstringETF or benchmark symbol for the leader row.
data.meta.as_ofstringTimestamp or date when the provider generated the summary.
data.meta.notesstringAdditional notes that affect interpretation.
data.meta.sourcestringProvider or source identifier for the returned data.

Show Yahoo market open/close status and index summary.

finance market.status shows Yahoo market open/close status and index summary. It returns ok, data, error, and warnings in JSON output. The result payload includes market, market_state, status, summary, source.

Use to check current market open/close state and major-index summary.

Terminal window
finance market.status [MARKET=US] [--output json]
ArgumentRequiredDefaultAccepted valuesDescription
marketNoUSStringMarket code.
Terminal window
finance market.status US --output json

This output was generated with finance market.status US --output json.

{
"ok": true,
"data": {
"market": "US",
"market_state": "REGULAR",
"status": {
"id": "us",
"name": "U.S. markets",
"status": "closed",
"yfit_market_id": "us_market",
"close": "2026-05-14T20:00:00+00:00",
"message": "U.S. markets closed",
"open": "2026-05-14T13:30:00+00:00",
"yfit_market_status": "YFT_MARKET_CLOSED",
"timezone": {
"dst": "true",
"gmtoffset": "-14400",
"short": "EDT",
"$text": "America/New_York"
},
"tz": "EDT"
},
"summary": [
{
"id": "CME",
"symbol": "RTY=F",
"name": "Russell 2000 Futures",
"price": 2850.4,
"change": -19,
"change_pct": -0.6621594,
"market_state": "REGULAR",
"exchange": "CME"
},
{
"id": "CBT",
"symbol": "YM=F",
"name": "Dow Futures",
"price": 49991,
"change": -163,
"change_pct": -0.324999,
"market_state": "REGULAR",
"exchange": "CBOT"
},
{
"id": "CXI",
"symbol": "^VIX",
"name": "VIX",
"price": 17.26,
"change": -0.6100006,
"change_pct": -3.4135456,
"market_state": "POSTPOST",
"exchange": "Cboe Indices"
},
{
"id": "CMX",
"symbol": "GC=F",
"name": "Gold",
"price": 4617.5,
"change": -67.799805,
"change_pct": -1.447075,
"market_state": "REGULAR",
"exchange": "COMEX"
}
],
"source": "yfinance"
},
"error": null,
"warnings": []
}
FieldTypeDescription
okbooleanWhether the command completed successfully.
dataobject or nullCommand-specific result payload. It is null when ok is false.
errorstring or nullHuman-readable error message when ok is false; otherwise null.
warningsarrayNon-fatal warnings returned by the command.
data.marketstringMarket code or broad market object.
data.market_statestringOpen/closed market state.
data.sourcestringProvider or source identifier for the returned data.
data.statusobjectProvider, market, or run status.
data.summaryarrayShort human-readable summary.
data.summary[]objectShort human-readable summary.
data.status.closestringScheduled market close timestamp.
data.status.idstringSource identifier for this nested provider record.
data.status.messagestringProvider message or status text.
data.status.namestringHuman-readable market name.
data.status.openstringScheduled market open timestamp.
data.status.statusstringProvider, market, or run status.
data.status.timezoneobjectMarket timezone metadata.
data.status.tzstringTimezone abbreviation.
data.status.yfit_market_idstringYahoo Finance market identifier.
data.status.yfit_market_statusstringYahoo Finance market status code.
data.summary[].changenumberAbsolute price change.
data.summary[].change_pctnumberPrice change as a decimal percentage value.
data.summary[].exchangestringExchange code or market venue.
data.summary[].idstringSource identifier for this nested provider record.
data.summary[].market_statestringOpen/closed market state.
data.summary[].namestringDisplay name for the index, future, commodity, or volatility instrument.
data.summary[].pricenumberLatest provider price for the summary instrument.
data.summary[].symbolstringProvider symbol for the summary instrument.
data.status.timezone.$textstringText value inside the provider timezone object.
data.status.timezone.dststringDaylight-saving flag from the provider timezone object.
data.status.timezone.gmtoffsetstringGMT offset from the provider timezone object.
data.status.timezone.shortstringTimezone abbreviation, such as EDT.