stock/demo_web/test.ts
ZhangPeng 9aecdd036c Initial commit: OpenClaw Trading - AI多智能体量化交易系统
- 添加项目核心代码和配置
- 添加前端界面 (Next.js)
- 添加单元测试
- 更新 .gitignore 排除缓存和依赖
2026-02-27 03:47:40 +08:00

13 lines
390 B
TypeScript

import YahooFinance from 'yahoo-finance2';
const yahooFinance = new YahooFinance({ suppressNotices: ['ripHistorical'] });
async function test() {
try {
const res = await yahooFinance.chart('AAPL', { period1: '2024-01-01', period2: '2024-01-05', interval: '1d' });
console.log(JSON.stringify(res.quotes[0], null, 2));
} catch (e) {
console.error("Error:", e);
}
}
test();