v0.3.45

RightNow-AI/openfangv0.3.45Mar 10, 2026by jaberjaber23

AI Summary

This release introduces the 'Trading Hand,' a new autonomous trading agent with a comprehensive 8-phase pipeline, alongside fixes for streaming tag leaks and orphaned cron jobs.

Key Highlights

  • New Trading Hand (8th Bundled Hand) with full autonomous trading capabilities.
  • Full 8-phase trading pipeline including state recovery, market scanning, and execution.
  • Streaming `pa` tag leak fixed with a new `StreamingThinkFilter`.
  • Cron jobs orphaned after agent deletion fixed via `remove_agent_jobs()`.
  • Trading Hand supports paper trading and live execution via Alpaca API.

New Features

  • Trading Hand with advanced risk management and Kelly criterion calculations.
  • Dashboard metrics for trading performance.
  • Structured Phase 7 reports with dashboard-ready tables.

Full Release Notes

## New: Trading Hand (8th Bundled Hand)

Full autonomous trading agent built from extensive market research on what traders actually need in 2026.

### Architecture
- **HAND.toml** (740 lines) — 12 configurable settings, 10 dashboard metrics, 470-line system prompt with 8-phase pipeline:
  1. State Recovery — restore position/context on restart
  2. Portfolio Setup — read config, validate risk parameters
  3. Market Intelligence Scan — gather data from free sources (Yahoo Finance, FRED, Fear & Greed Index)
  4. Multi-Factor Analysis — technical (RSI/MACD/Bollinger/VWAP/ATR), fundamental, sentiment, macro
  5. Adversarial Bull/Bear Debate — structured debate with entry zones, stop-loss, take-profit, R:R ratios
  6. Risk Management Gate — circuit breakers, position sizing caps, drawdown limits, correlation checks
  7. Trade Execution — three modes: analysis-only, paper trading, live via Alpaca API
  8. Analytics & Reporting — structured tables for dashboard metrics

- **SKILL.md** (937 lines) — Expert reference material:
  - RSI/MACD/Bollinger/VWAP/ATR formulas with interpretation guides
  - 22 candlestick pattern definitions
  - Position sizing + Kelly criterion + Value-at-Risk calculations
  - Full Alpaca API reference (discovered they have an official MCP server)
  - Free financial data sources catalog
  - Superforecasting calibration guide
  - Cognitive bias mitigations for trading decisions

### Settings
- `trading_mode` (analysis/paper/live), `risk_per_trade` (default 2%), `max_portfolio_pct` (10%), `watchlist`, `alpaca_api_key`, `preferred_timeframe`, `report_frequency`, `max_daily_trades`, `stop_loss_atr_multiplier`, `take_profit_atr_multiplier`, `circuit_breaker_drawdown`, `rebalance_interval`

### Live-Tested Behaviors
- Refuses to bypass risk management (100% portfolio / no stop-loss = rejected)
- Calculates position sizing correctly including cap violation detection
- Produces adversarial bull/bear debates with concrete price levels
- Generates structured Phase 7 reports with dashboard-ready tables
- Pause/resume/deactivate lifecycle works correctly

## Bug Fixes

- **#503** — Streaming `<think>` tag leak: Created `StreamingThinkFilter` that processes text deltas incrementally, buffering reasoning content so it never reaches the client during streaming. Handles partial tags split across chunks. 17 new tests.
- **#504** — Cron jobs orphaned after agent deletion: `kill_agent()` now calls `remove_agent_jobs()` on the cron scheduler and persists the change to disk. 3 new tests.

## Stats
- 2031 tests, 0 clippy warnings, 8 bundled hands, 184 models, 40 providers

**Full Changelog**: https://github.com/RightNow-AI/openfang/compare/v0.3.44...v0.3.45