market-ingest

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Market Ingest

市场数据摄入

Fetch market data for a symbol, normalize to OHLCV vectors, and store with HNSW indexing for fast pattern search.
获取标的资产的市场数据,将其归一化为OHLCV向量,并通过HNSW索引存储以实现快速模式搜索。

When to use

使用场景

When you need to ingest raw market data (price and volume) for a symbol and prepare it for pattern detection and similarity search. This is the first step before running pattern detection or comparison.
当你需要摄入标的资产的原始市场数据(价格和成交量),并为模式检测和相似度搜索做准备时使用。这是运行模式检测或对比前的第一步。

Steps

步骤

  1. Fetch data -- retrieve OHLCV data for the symbol from the configured data source (REST API, CSV file, or manual input)
  2. Normalize -- convert raw prices to relative values:
    • Open:
      (open - prev_close) / prev_close
    • High:
      (high - open) / open
    • Low:
      (low - open) / open
    • Close:
      (close - open) / open
    • Volume: Z-score against rolling mean/std
  3. Vectorize -- encode each candle as a 64-dimension padded vector (5 normalized OHLCV values + padding)
  4. Store -- call
    mcp__claude-flow__agentdb_hierarchical-store
    to persist normalized OHLCV data in the
    market-data
    namespace with symbol and date as keys
  5. Index -- call
    mcp__claude-flow__ruvllm_hnsw_add
    to add vectors to the HNSW index for nearest-neighbor search
  6. Report -- summarize: candles ingested, date range, price range, average volume
  1. 获取数据——从配置的数据源(REST API、CSV文件或手动输入)检索标的资产的OHLCV数据
  2. 归一化——将原始价格转换为相对值:
    • 开盘价:
      (open - prev_close) / prev_close
    • 最高价:
      (high - open) / open
    • 最低价:
      (low - open) / open
    • 收盘价:
      (close - open) / open
    • 成交量:基于滚动均值/标准差计算Z-score
  3. 向量化——将每根K线编码为64维填充向量(5个归一化OHLCV值 + 填充值)
  4. 存储——调用
    mcp__claude-flow__agentdb_hierarchical-store
    ,将归一化后的OHLCV数据以标的资产和日期为键,持久化存储在
    market-data
    命名空间中
  5. 索引——调用
    mcp__claude-flow__ruvllm_hnsw_add
    ,将向量添加到HNSW索引中以支持最近邻搜索
  6. 报告——汇总信息:摄入的K线数量、日期范围、价格范围、平均成交量

CLI alternative

CLI替代方案

bash
npx @claude-flow/cli@latest memory store --namespace market-data --key "symbol-SYMBOL-DATE" --value "OHLCV_JSON"
bash
npx @claude-flow/cli@latest memory store --namespace market-data --key "symbol-SYMBOL-DATE" --value "OHLCV_JSON"