orderflow-analysis

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Orderflow Analysis Skill

订单流分析Skill

Detects institutional trading patterns from Level 2 market data and trade executions.
从Level 2市场数据和交易执行记录中检测机构交易模式。

Capabilities

功能特性

This skill enables the agent to:
  1. Analyze L2 orderbook depth for bid/ask walls
  2. Detect absorption patterns (hidden liquidity)
  3. Detect exhaustion at support/resistance
  4. Identify imbalance sweeps
  5. Generate trade signals with confidence levels
该Skill使Agent能够:
  1. 分析L2订单簿深度,识别买卖盘挂单墙
  2. 检测吸收模式(隐藏流动性)
  3. 检测支撑/阻力位的耗尽信号
  4. 识别失衡扫单
  5. 生成带置信度的交易信号

Prerequisites

前置条件

  • Active L2 data connection (Alpaca Pro or Polygon)
  • Trading symbols configured in watchlist
  • 活跃的L2数据连接(Alpaca Pro或Polygon)
  • 观察列表中已配置交易标的

Procedural Steps

操作步骤

1. Connect to L2 Data Stream

1. 连接L2数据流

Use the trading-orderflow MCP server to establish WebSocket connection.
Call: connect_l2_stream(symbol: str, provider: "alpaca" | "polygon")
使用trading-orderflow MCP服务器建立WebSocket连接。
调用:connect_l2_stream(symbol: str, provider: "alpaca" | "polygon")

2. Monitor Orderbook State

2. 监控订单簿状态

Track bid/ask walls and imbalance ratios.
Call: get_orderbook_state(symbol: str) -> returns current book snapshot
追踪买卖盘挂单墙和失衡比率。
调用:get_orderbook_state(symbol: str) -> 返回当前订单簿快照

3. Run Detection Algorithms

3. 运行检测算法

When sufficient data is collected:
Call: analyze_footprint(symbol: str, window_seconds: int) 
Returns: List[FootprintSignal] with pattern type, direction, confidence
收集到足够数据后:
调用:analyze_footprint(symbol: str, window_seconds: int) 
返回:包含模式类型、方向、置信度的List[FootprintSignal]

4. Interpret Signals

4. 解读信号

Signal TypeDescriptionSuggested Action
ABSORPTIONHeavy volume absorbed without price movementFade the volume direction
EXHAUSTIONDeclining volume at S/RPrepare for reversal
IMBALANCE3:1+ buy/sell ratioFollow imbalance direction
SWEEPMultiple levels cleared rapidlyMomentum follow
信号类型描述建议操作
ABSORPTION大量成交量被吸收但价格未发生变动反向操作当前成交量方向
EXHAUSTION支撑/阻力位成交量递减准备应对趋势反转
IMBALANCE买卖比率达到3:1及以上跟随失衡方向操作
SWEEP多个价位被快速突破跟随动量操作

5. Forward to Confirmation Mesh

5. 提交至确认网格

All signals must pass through confirmation mesh before execution:
Call: validate_signal(signal: FootprintSignal, quantity: float) -> ConfirmationResult
所有信号在执行前必须通过确认网格验证:
调用:validate_signal(signal: FootprintSignal, quantity: float) -> ConfirmationResult

Safety Guardrails

安全防护规则

  • Never execute trades based on LOW confidence signals
  • Require L2 liquidity verification before market orders
  • All executions must go through confirmation_mesh validation
  • Circuit breakers halt trading after consecutive failures
  • 绝不要基于低置信度信号执行交易
  • 市价单执行前需验证L2流动性
  • 所有交易执行必须经过confirmation_mesh验证
  • 连续失败后触发断路器停止交易

Example Workflow

示例工作流

python
undefined
python
undefined

Agent detects high-confidence absorption

Agent检测到高置信度吸收信号

signal = await analyze_footprint("AAPL", window_seconds=60)
if signal.signal_type == "ABSORPTION" and signal.confidence == "HIGH": # Validate before execution result = await validate_signal(signal, quantity=100)
if result.approved:
    # Proceed to execute-trade skill
    await execute_confirmed_trade(result)
undefined
signal = await analyze_footprint("AAPL", window_seconds=60)
if signal.signal_type == "ABSORPTION" and signal.confidence == "HIGH": # 执行前验证 result = await validate_signal(signal, quantity=100)
if result.approved:
    # 调用execute-trade Skill执行交易
    await execute_confirmed_trade(result)
undefined