Skip to content

Releases: Anarkitty1/semantic-frame

v0.4.0

12 Dec 18:19

Choose a tag to compare

Trading Module for AI Agents 🤖📈

This release adds a complete trading intelligence toolkit for agent-based trading systems.

New Trading Functions

All available at top-level: from semantic_frame import describe_drawdown, ...

Function Description
describe_drawdown Equity curve drawdown analysis with severity classification
describe_trading_performance Win rate, Sharpe, profit factor, risk profile
describe_rankings Compare multiple agents/strategies
describe_anomalies Enhanced anomaly detection with severity levels
describe_windows Multi-timeframe trend alignment
describe_regime Market regime detection (bull/bear/sideways)
describe_allocation Portfolio allocation suggestions (educational)

Quick Start

from semantic_frame import describe_drawdown, describe_trading_performance

# Analyze equity curve
equity = [10000, 10500, 10200, 9800, 9500, 10000, 10800]
result = describe_drawdown(equity, context="BTC strategy")
print(result.narrative)
# "The BTC strategy has moderate drawdown risk (max 9.5% over 3 periods)..."

# Analyze trade performance  
trades = [100, -50, 75, -25, 150, -30, 80]
result = describe_trading_performance(trades, context="My Agent")
print(result.narrative)
# "My Agent shows good performance with 57% win rate and 2.86x profit factor..."

MCP Integration

All trading tools available via MCP for Claude Desktop and Claude Code:

  • mcp__semantic-frame__describe_drawdown
  • mcp__semantic-frame__describe_trading_performance
  • mcp__semantic-frame__describe_rankings
  • mcp__semantic-frame__describe_anomalies
  • mcp__semantic-frame__describe_windows
  • mcp__semantic-frame__describe_regime
  • mcp__semantic-frame__describe_allocation

Test Coverage

  • 1,347 tests passing
  • 94% coverage
  • 214 trading module tests

See CHANGELOG.md for full details.