Market Tracker Skill
This skill helps you fetch latest quotes and historical series for:
- - Stocks / ETFs / Indices (e.g., AAPL, MSFT, ^GSPC, VOO)
- FX pairs (e.g., USD/ZAR, EURUSD, GBP-JPY)
- Crypto tickers supported by the chosen provider (best-effort)
It is optimized for:
- - fast “what’s the price now?” queries
- lightweight tracking with a local watchlist
- caching to avoid rate-limits
When to use
Use this skill when the user asks:
- - “What’s the latest price of ?”
- “Track and and show me daily changes.”
- “Give me a 30-day series for .”
- “Convert USD to ZAR (or track USD/ZAR).”
- “Maintain a watchlist and summarize performance.”
Provider strategy (important)
- - Stocks/ETFs/indices default: Yahoo Finance via
yfinance (no key, broad coverage), but it is unofficial and can rate-limit. - FX default: ExchangeRate-API Open Access endpoint (no key, daily update).
- If the user needs high-frequency or many symbols, recommend adding a paid provider later.
See providers.md for details and symbol formats.
Quick start (how you run it)
These scripts are intended to be run from a terminal. The agent should:
1) ensure dependencies installed
2) run the scripts
3) summarize results cleanly
Install:
- -
python -m venv .venv && source .venv/bin/activate (or Windows equivalent) - INLINECODE3
Commands
1) Latest quote (stock/ETF/index)
Examples:
- - INLINECODE4
- INLINECODE5
- INLINECODE6
2) Latest FX rate
Examples:
- - INLINECODE7
- INLINECODE8
- INLINECODE9
3) Historical series (CSV to stdout)
Examples:
- - INLINECODE10
- INLINECODE11
4) Watchlist summary (local file)
- - Add tickers: INLINECODE12
- Remove: INLINECODE13
- Show summary: INLINECODE14
Output expectations (what you should return to the user)
- - For quotes: price, change %, timestamp/source, and any caveats (like “FX updates daily”).
- For series: confirm date range, number of points, and show a small preview (first/last few rows).
- If rate-limited: explain what happened and retry with backoff OR advise to reduce frequency.
Safety / correctness
- - Never claim “real-time” unless the provider is truly real-time. FX open access updates daily.
- Always cache responses and throttle repeated calls.
- If Yahoo blocks requests, propose a paid provider or increase cache TTL.
技能名称: 金融
详细描述:
市场追踪技能
该技能可帮助您获取以下内容的最新报价和历史序列:
- - 股票/ETF/指数(例如:AAPL、MSFT、^GSPC、VOO)
- 外汇货币对(例如:USD/ZAR、EURUSD、GBP-JPY)
- 所选提供商支持的加密货币代码(尽力而为)
该技能针对以下场景进行了优化:
- - 快速的“当前价格是多少?”查询
- 使用本地观察列表进行轻量级追踪
- 通过缓存避免速率限制
使用时机
当用户提出以下问题时,请使用此技能:
- - “的最新价格是多少?”
- “追踪和,并显示每日变化。”
- “给我的30天序列数据。”
- “将美元兑换成南非兰特(或追踪USD/ZAR)。”
- “维护一个观察列表并总结表现。”
提供商策略(重要)
- - 股票/ETF/指数默认:通过yfinance使用雅虎财经(无需密钥,覆盖广泛),但非官方且可能触发速率限制。
- 外汇默认:ExchangeRate-API开放访问端点(无需密钥,每日更新)。
- 如果用户需要高频数据或大量代码,建议后续添加付费提供商。
详情和代码格式请参见providers.md。
快速入门(如何运行)
这些脚本旨在从终端运行。代理应:
1) 确保依赖项已安装
2) 运行脚本
3) 清晰总结结果
安装:
- - python -m venv .venv && source .venv/bin/activate(或Windows等效命令)
- pip install -r requirements.txt
命令
1) 最新报价(股票/ETF/指数)
示例:
- - python scripts/marketquote.py AAPL
- python scripts/marketquote.py ^GSPC
- python scripts/market_quote.py VOO
2) 最新外汇汇率
示例:
- - python scripts/marketquote.py USD/ZAR
- python scripts/marketquote.py EURUSD
- python scripts/market_quote.py GBP-JPY
3) 历史序列(CSV输出至标准输出)
示例:
- - python scripts/marketseries.py AAPL --days 30
- python scripts/marketseries.py USD/ZAR --days 30
4) 观察列表摘要(本地文件)
- - 添加代码:python scripts/marketwatchlist.py add AAPL MSFT USD/ZAR
- 移除:python scripts/marketwatchlist.py remove MSFT
- 显示摘要:python scripts/market_watchlist.py summary
输出预期(应返回给用户的内容)
- - 对于报价:价格、变化百分比、时间戳/来源,以及任何注意事项(如“外汇每日更新”)。
- 对于序列:确认日期范围、数据点数量,并显示小预览(前/后几行)。
- 如果触发速率限制:解释发生了什么,并使用退避策略重试,或建议降低频率。
安全/正确性
- - 除非提供商是真正的实时数据,否则切勿声称“实时”。外汇开放访问每日更新。
- 始终缓存响应并限制重复调用。
- 如果雅虎阻止请求,建议使用付费提供商或增加缓存生存时间。