███████╗██╗███╗ ██╗███╗ ██╗██╗ ██╗
██╔════╝██║████╗ ██║████╗ ██║╚██╗ ██╔╝
█████╗ ██║██╔██╗ ██║██╔██╗ ██║ ╚████╔╝
██╔══╝ ██║██║╚██╗██║██║╚██╗██║ ╚██╔╝
██║ ██║██║ ╚████║██║ ╚████║ ██║
╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═══╝ ╚═╝
Claude Code for Financial Markets
Build, backtest, and iterate on trading algorithms using natural language. Built on the OpenCode AI agent harness.
npm i -g finny
finnyTry it: "Build me a momentum-based ETH trading strategy with RSI signals"
Press Tab to switch between modes.
| Mode | Description |
|---|---|
| Build | Generates algorithms immediately. No questions asked. |
| Research | Asks clarifying questions, fetches market data, runs analysis, then transitions to Build. |
| Chat | Conversational assistant for strategy questions, portfolio review, market data. |
- Describe what you want in plain English
- The agent generates a Python
Strategyclass (7 built-in templates available) - Code is auto-validated — syntax, safety, and trading best practices
- Algorithm saved to cloud storage (Convex) with version tracking
- Run backtests against historical data
- Iterate — modify, re-validate, compare versions
| Template | Description |
|---|---|
| Momentum | RSI momentum — buys oversold, sells overbought |
| Mean Reversion | Bollinger Bands — buys at lower band, sells at upper |
| Breakout | Donchian channel — buys new highs, sells new lows |
| DCA | Dollar-cost averaging — systematic buying with profit-target exit |
| Golden Cross | SMA 50/200 crossover — buys golden cross, sells death cross |
| Scalping | EMA scalping with tight stops — quick entries and exits |
| Custom | Minimal skeleton — implement your own logic |
| Command | Description |
|---|---|
/algos |
List saved algorithms |
/code |
View algorithm source code |
/backtest |
Run historical backtest |
/review |
Review strategy changes (commit, branch, or PR) |
/init |
Initialize project rules for strategy generation |
- Historical data via yfinance
- Configurable duration, interval, and starting capital
- Metrics: Total Return, Sharpe Ratio, Max Drawdown, Win Rate, Profit Factor
- Interactive TUI for parameter selection and results display
Every generated strategy is checked for:
- Python syntax errors
- Strategy class structure — requires
__init__andon_tickmethods - Forbidden imports —
os,subprocess,socket,requests, etc. - Dangerous calls —
exec,eval,compile,__import__ - Trading pitfalls — lookahead bias, unbounded lists, division by zero
BYOK — bring your own AI API keys. Works with Anthropic, OpenAI, Google, or local models.
Supported assets include crypto (BTC, ETH, SOL) and stocks (AAPL, NVDA, PLTR).
Config is stored in XDG-compliant directories:
~/.config/finny/ # configuration
~/.local/share/finny/ # data
TypeScript / Bun / Turbo monorepo. Solid.js TUI. Convex DB. Python backtesting engine.
Fork of OpenCode by Anomaly.