price-history
Scannednpx machina-cli add skill staskh/trading_skills/price-history --openclawPrice History
Fetch historical OHLCV data from Yahoo Finance.
Instructions
Note: If
uvis not installed orpyproject.tomlis not found, replaceuv run pythonwithpythonin all commands below.
uv run python scripts/history.py SYMBOL [--period PERIOD] [--interval INTERVAL]
Arguments
SYMBOL- Ticker symbol--period- Time period: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default: 1mo)--interval- Data interval: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo (default: 1d)
Output
Returns JSON with:
symbol- Tickerperiod- Requested periodinterval- Data intervaldata- Array of {date, open, high, low, close, volume}
Summarize key price movements, highs/lows, and trends.
Dependencies
yfinance
Source
git clone https://github.com/staskh/trading_skills/blob/main/.claude/skills/price-history/SKILL.mdView on GitHub Overview
Fetch historical OHLCV data for a stock from Yahoo Finance. It returns a structured JSON payload including symbol, period, interval, and a data array of date, open, high, low, close, and volume to support charting and analysis.
How This Skill Works
It runs a Python script that queries Yahoo Finance for the specified SYMBOL, period, and interval. If uv is available, use the command uv run python scripts/history.py SYMBOL [--period PERIOD] [--interval INTERVAL]; otherwise run python scripts/history.py SYMBOL [--period PERIOD] [--interval INTERVAL]. The response is JSON with symbol, period, interval, and data: an array of {date, open, high, low, close, volume}.
When to Use It
- When a user asks for price history or past performance of a stock
- When you need data for charting, backtesting, or dashboards
- When you want a specific data granularity (intraday or daily) and period (max, 5y, ytd, etc.)
- When analyzing highs, lows and trends over a time range
- When preparing a report that includes OHLCV summaries and trend insights
Quick Start
- Step 1: Ensure uv is installed and pyproject.toml exists in your project
- Step 2: Run: uv run python scripts/history.py SYMBOL --period PERIOD --interval INTERVAL
- Step 3: Parse the returned JSON to feed your chart or analysis
Best Practices
- Verify SYMBOL is correct and the requested period/interval match your analysis needs
- Prefer longer periods with coarser intervals for trend analysis and shorter periods with finer intervals for intraday insights
- Expect gaps on holidays or missing data around stock splits; plan to handle in post-processing
- Validate the returned data structure and convert date fields to your local timezone if needed
- Cache repeated requests to reduce latency and Yahoo Finance calls
Example Use Cases
- Fetch 1mo of daily OHLCV for AAPL to plot a short-term chart
- Retrieve 5y of daily data for MSFT to observe long-term performance
- Get intraday 5m data for TSLA for today’s trading session
- Compare GOOG price movement across the last quarter (90d) to identify trends
- Export AAPL data for a dashboard visualization