Skip to content

fretelli/KeelTrader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

157 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

KeelTrader

An AI-powered performance coach for trading psychology

Keel: Like a ship's keel that provides stability in turbulent waters, KeelTrader helps you maintain psychological balance in volatile markets.


English | 简体中文

CI License: Apache-2.0 GitHub Stars Last Commit GitHub Issues Top Language PRs Welcome

KeelTrader is an AI-powered performance coach for trading psychology (Web: Next.js, API: FastAPI). It's built around chat, knowledge base (RAG), and a "roundtable" multi-coach discussion mode.

Disclaimer: for educational/research purposes only. This project is not investment advice.

Inspiration: Who is Wendy Rhodes?

In the TV series Billions, Wendy Rhodes is the in-house performance coach at hedge fund Axe Capital. Her role isn't investment analysis—it's psychological performance optimization:

What She Does Real Scenarios
Emotional First Aid When a trader melts down mid-session, she intervenes immediately to restore composure
Behavioral Pattern Recognition Identifies that a trader's losing streak stems from divorce affecting judgment
Cognitive Reframing Helps overconfident star traders recognize their blind spots
Psychological Resilience Training Teaches traders to bounce back quickly after massive losses
Performance Enhancement Improves team-wide trading stability through psychological coaching

The Real-World Problem:

  • Only elite hedge funds can afford full-time performance coaches (salaries $300K+)
  • Retail traders and small institutions have zero access to this service
  • 80% of trading losses stem from psychological factors, not technical analysis

KeelTrader's Vision:

Democratize Wendy Rhodes' capabilities through AI, giving every trader their own performance coach.

Behavioral Finance 3.0 Positioning

KeelTrader represents the evolution of behavioral finance from theory to practice:

Generation Focus Limitation
1.0 Academic Research Kahneman & Tversky's cognitive biases Theory stays in textbooks, traders can't apply it
2.0 Robo-Advisors Automated portfolio allocation One-size-fits-all, ignores individual psychology
3.0 AI Performance Coach Real-time psychological intervention Personalized, actionable, adaptive

What Makes KeelTrader Different

Traditional Approach (Behavioral Finance 1.0 & 2.0):

  • Read about loss aversion → Still panic sell during crashes
  • Know about confirmation bias → Still cherry-pick bullish news
  • Understand overconfidence → Still overtrade after wins

KeelTrader's Approach (Behavioral Finance 3.0):

  • Conversational Intervention: AI coaches discuss your trades and help you reflect on emotional patterns in your journal
  • Personalized Coaching: Build a library of coaches tailored to different aspects of your trading psychology
  • Actionable Guidance: Not just "you have loss aversion" but "here's how to handle this specific trade decision right now"
  • Knowledge Base (RAG): Import your own trading books, notes, and strategies for contextual advice
  • (Planned) Real-time pattern detection and proactive alerts

The Gap We Fill

Academic Knowledge → [MISSING LINK] → Trading Performance
     (BF 1.0)                              (Your P&L)
                    ↓
              KeelTrader
            (BF 3.0 Bridge)

Most traders know the theory but fail in execution. KeelTrader bridges this gap by providing:

  1. Reflective coaching: Review your trades with AI coaches to identify emotional patterns
  2. Journal analysis: Track your trading decisions and discuss them with specialized coaches
  3. Accountability partner: Multi-coach roundtable discussions help you examine decisions from different perspectives
  4. (Planned) Moment-of-truth alerts and proactive pattern recognition

Screenshots

Overview

Roundtable

Architecture

What you can do

  • Chat + projects: organize conversations per project, keep history, stream responses (SSE)
  • Roundtable discussion: multiple AI coaches discuss one question with configurable session/message settings
  • Knowledge base (RAG): import docs, semantic search (pgvector), inject context by timing
  • Attachments: upload images/docs/audio (extract/transcribe where supported)
  • Journaling + reports: trading journal, analytics, scheduled reports (Celery)
  • Journal import (CSV/XLSX): upload a file and map columns in the UI (works with different broker/export formats)
  • Notifications: in-app notifications and alert delivery hooks for pattern alerts, risk warnings, and daily summaries
  • Trading intervention system: pre-trade checklists, real-time trade blocking based on risk limits, and proactive alerts
  • Behavior pattern tracking: detect and review revenge trading, FOMO, overtrading, and other behavioral patterns
  • Exchange integration: connect to crypto exchanges (OKX, Bybit, Coinbase, Kraken) and brokers (IBKR) with trading mode awareness (spot / perpetual futures / stocks / options per connection)
  • Agent Matrix (optional profile): multi-agent trading system — Orchestrator, Technical Analyst, Executor, Psychology Coach, Guardian — with 8-layer safety barrier, ghost trading, and Telegram bot interface
  • Self-hosted by default: Docker Compose; optional cloud/SaaS mode via env flags

Quick start (self-host)

cd keeltrader
Copy-Item .env.example .env   # PowerShell (or: cp .env.example .env)
docker compose up -d --build
  • Web: http://localhost:3000
  • API health: http://localhost:8000/api/health
  • API docs: http://localhost:8000/docs

Full guide: keeltrader/docs/SELF_HOSTING.md

Authentication

The default Docker Compose setup builds the web with login enabled (NEXT_PUBLIC_AUTH_REQUIRED=1). Set KEELTRADER_AUTO_INIT_TEST_USERS=1 to create test accounts on first startup.

To disable login and use guest mode, set KEELTRADER_AUTH_REQUIRED=0 in .env and rebuild the web image with NEXT_PUBLIC_AUTH_REQUIRED=0.

Roadmap (community)

  • Add more “1-click demo” options (cloud deploy templates)
  • Improve preset library and import/export
  • More evaluators/benchmarks for coaching quality

Docs

  • Start here: keeltrader/docs/INDEX.md
  • Architecture: keeltrader/docs/ARCHITECTURE.md
  • Deployment: keeltrader/docs/DEPLOYMENT.md
  • Self-hosting: keeltrader/docs/SELF_HOSTING.md
  • Deployment modes: keeltrader/docs/DEPLOYMENT_MODES.md
  • Custom API setup: keeltrader/docs/CUSTOM_API_SETUP.md
  • Internationalization: keeltrader/docs/I18N_GUIDE.md
  • Version Management: docs/VERSION_MANAGEMENT.md ⭐ NEW
  • Changelog: CHANGELOG.md

Contributing & security

  • Branch strategy: We use Git Flow. Create feature branches from develop and submit PRs to develop (not main). See CONTRIBUTING.md for details.
  • Contributing: CONTRIBUTING.md
  • Code of Conduct: CODE_OF_CONDUCT.md
  • Security policy: SECURITY.md

Deployment modes (open core)

KeelTrader supports two modes:

  • Self-hosted (default): open-source community edition
  • Cloud/SaaS: multi-tenancy, billing, enterprise SSO, analytics (activated only when DEPLOYMENT_MODE=cloud)

See keeltrader/docs/DEPLOYMENT_MODES.md for details.


简体中文

KeelTrader 是一套面向交易心理与行为表现的 AI 教练系统(Web: Next.js,API: FastAPI)。核心能力围绕:对话、知识库(RAG)、以及"圆桌讨论"(多教练协作)。

免责声明:仅用于教育/研究目的,本项目 不构成 投资建议。

截图 / 演示

概览

圆桌讨论

架构

你可以用它做什么

  • 对话 + 项目:按项目组织会话,历史记录,SSE 流式输出
  • 圆桌讨论:多位 AI 教练围绕同一问题讨论;支持会话级/消息级设置
  • 知识库(RAG):文档导入、pgvector 语义检索,按时机注入上下文
  • 附件:图片/文档/音频上传(按能力抽取/转写)
  • 交易日志 + 报告:交易日志、统计、定时报表(Celery)
  • 交易日志导入(CSV/XLSX):支持上传文件并在页面中手动映射列(适配不同券商/平台格式)
  • 通知能力:站内通知与告警分发钩子,覆盖模式提醒、风险警告和每日总结
  • 交易干预系统:交易前检查清单、基于风险限制的实时交易阻止和主动警报
  • 行为模式跟踪:识别并复盘报复性交易、FOMO、过度交易等行为模式
  • 交易所集成:连接加密交易所(OKX、Bybit、Coinbase、Kraken)和券商(IBKR),支持按连接配置交易模式(现货 / 永续合约 / 股票 / 期权)
  • Agent Matrix(可选 profile):多 Agent 交易系统 — 协调器、技术分析师、执行器、心理教练、风控守卫 — 含 8 层安全屏障、模拟交易、Telegram 机器人
  • 默认可自托管:Docker Compose 一键启动;也支持通过环境变量启用云端模式

快速开始(自托管)

cd keeltrader
Copy-Item .env.example .env   # PowerShell(或:cp .env.example .env)
docker compose up -d --build
  • Web:http://localhost:3000
  • API 健康检查:http://localhost:8000/api/health
  • API 文档:http://localhost:8000/docs

完整说明:keeltrader/docs/SELF_HOSTING.md

认证

默认需要登录(KEELTRADER_AUTH_REQUIRED=1)。设置 KEELTRADER_AUTO_INIT_TEST_USERS=1 可在首次启动时创建测试账号。

如需免登录访客模式,将 .envKEELTRADER_AUTH_REQUIRED=0,并以 NEXT_PUBLIC_AUTH_REQUIRED=0 重新构建 web 镜像。

Roadmap(社区版)

  • 增加更多“一键 Demo”部署模板
  • 预设教练库的导入/导出与共享
  • 教练效果的评测与对比工具

文档

  • 从这里开始:keeltrader/docs/INDEX.md
  • 架构:keeltrader/docs/ARCHITECTURE.md
  • 部署:keeltrader/docs/DEPLOYMENT.md
  • 自托管:keeltrader/docs/SELF_HOSTING.md
  • 部署模式:keeltrader/docs/DEPLOYMENT_MODES.md
  • 自定义 API:keeltrader/docs/CUSTOM_API_SETUP.md
  • 国际化:keeltrader/docs/I18N_GUIDE.md
  • 版本管理docs/VERSION_MANAGEMENT.md
  • 更新日志CHANGELOG.md

贡献与安全

  • 贡献指南:CONTRIBUTING.md
  • 行为准则:CODE_OF_CONDUCT.md
  • 安全策略:SECURITY.md

部署模式(Open Core)

KeelTrader 支持两种模式:

  • Self-Hosted(默认):开源社区版
  • Cloud/SaaS:多租户、计费、企业 SSO、分析(仅在 DEPLOYMENT_MODE=cloud 时启用)

详见:keeltrader/docs/DEPLOYMENT_MODES.md

Star History

Star History Chart

About

AI Trading Psychology Coach inspired by "Billions" - Multi-agent behavioral finance coaching system

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors