원클릭으로
collect
// Collect market data, technical indicators, news, KOL views, and option data for financial analysis.
// Collect market data, technical indicators, news, KOL views, and option data for financial analysis.
Analyze overall market sentiment, sector trends, and identify hot topics and stocks.
Analyze individual stocks, providing technical, fundamental, and sentiment analysis along with trading recommendations.
Analyze the results of executed trades to evaluate performance and extract lessons.
Verify if a trading plan complies with user-defined risk limits such as position size and stop-loss levels.
Create a detailed trading plan based on stock analysis, portfolio status, and user preferences.
Execute a trading plan with safety checks, confirmation verification, and rollback capabilities.
| name | collect |
| description | Collect market data, technical indicators, news, KOL views, and option data for financial analysis. |
提供市场数据收集工具,包括获取股票价格、技术指标、新闻、KOL 观点和期权数据。
此 skill 通过直接调用项目根目录下的 npm script 来执行底层的数据采集和分析工具。需要预先执行 npm run build 进行编译。
重要:执行任何 npm script 前,必须先通过 cd 命令切换到项目的绝对路径下(例如:cd ~/projects/ai/financial-agent),然后再执行相应的 npm run 命令。
【非常重要的时间约束】:所有示例命令中的 --date(如 2026-02-19 等)都仅仅是 举例!你在实际调用时,必须使用执行当天的现实真实日期(格式 YYYY-MM-DD)。如果未要求特定过去某一天的数据,请不要使用硬编码的假日期!
# 进入项目绝对根目录
cd ~/projects/ai/financial-agent
# 采集 KOL 数据
npm run collect -- --platform twitter
# 获取股票数据
npm run data -- --symbols AAPL,TSLA
# 获取期权数据
npm run options -- --symbol NVDA --direction call
# 获取新闻数据
npm run news -- --symbols AAPL
以下是 npm script 支持的所有命令行参数(在执行时如果通过 npm 运行,需要加上 -- 将参数传递给底层脚本):
--date <YYYY-MM-DD>: 指定数据采集或查询的日期 (默认为今天)。用于所有命令 (collect, data, options, news)。--platform <platform>: 指定要采集的平台 (仅用于 collect 命令)。支持的值: twitter, weibo, youtube。如果不指定,默认采集所有平台。--symbols <SYMBOL1,SYMBOL2>: 指定股票代码列表,用逗号分隔 (用于 data, news 命令)。--symbol <SYMBOL>: 指定单只股票代码 (用于 options 命令)。--expiry <YYYY-MM-DD>: 期权到期日 (用于 options 命令)。--direction <call|put>: 期权方向,看涨或看跌 (用于 options 命令)。读取位于项目绝对路径下的数据文件。具体固定为读取 ~/projects/ai/financial-agent/data/info/daily/<date>/<filename>.json。
因为 script 脚本将采集的数据保存在这个位置,Agent 可以通过这个 Action 并指定日期和文件名提取采集到的原始 JSON 数据供进一步分析。
interface ReadDailyDataInput {
date: string; // 目标日期,格式为 YYYY-MM-DD
filename: string; // 文件名,不需要 .json 后缀(例如 "posts" 或 "stockdata")
}
// 返回解析后的 JSON 对象。结构取决于具体请求的文件。
// 如果文件不存在,则返回 null。
type ReadDailyDataOutput = Record<string, any> | any[] | null;
INVALID_TICKER: 股票代码格式无效API_ERROR: 从 API 获取数据失败RATE_LIMIT_EXCEEDED: API 速率限制超出INVALID_INDICATOR: 指标类型不支持INVALID_TIMEFRAME: 时间周期不支持NO_ARTICLES_FOUND: 未找到符合条件的文章INVALID_PLATFORM: 平台不支持NO_VIEWS_FOUND: 未找到符合条件的观点NO_OPTIONS_FOUND: 未找到符合条件的期权