Skip to content

Jaiminp007/finny

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11,123 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                                    ███████╗██╗███╗   ██╗███╗   ██╗██╗   ██╗
                                    ██╔════╝██║████╗  ██║████╗  ██║╚██╗ ██╔╝
                                    █████╗  ██║██╔██╗ ██║██╔██╗ ██║ ╚████╔╝
                                    ██╔══╝  ██║██║╚██╗██║██║╚██╗██║  ╚██╔╝
                                    ██║     ██║██║ ╚████║██║ ╚████║   ██║
                                    ╚═╝     ╚═╝╚═╝  ╚═══╝╚═╝  ╚═══╝   ╚═╝

                                      Claude Code for Financial Markets

npm

Screenshot 2026-04-14 at 4 55 14 PM

Build, backtest, and iterate on trading algorithms using natural language. Built on the OpenCode AI agent harness.


Quick Start

npm i -g finny
finny

Try it: "Build me a momentum-based ETH trading strategy with RSI signals"


Agent Modes

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.

How It Works

  1. Describe what you want in plain English
  2. The agent generates a Python Strategy class (7 built-in templates available)
  3. Code is auto-validated — syntax, safety, and trading best practices
  4. Algorithm saved to cloud storage (Convex) with version tracking
  5. Run backtests against historical data
  6. Iterate — modify, re-validate, compare versions

Strategy Templates

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

Commands

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

Backtesting

  • 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

Validation

Every generated strategy is checked for:

  • Python syntax errors
  • Strategy class structure — requires __init__ and on_tick methods
  • Forbidden importsos, subprocess, socket, requests, etc.
  • Dangerous callsexec, eval, compile, __import__
  • Trading pitfalls — lookahead bias, unbounded lists, division by zero

Configuration

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

Tech Stack

TypeScript / Bun / Turbo monorepo. Solid.js TUI. Convex DB. Python backtesting engine.

Fork of OpenCode by Anomaly.


Acknowledgments

Built on OpenCode by Anomaly.

About

Claude Code for Financial Markets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 61.1%
  • MDX 34.8%
  • CSS 2.7%
  • Python 0.6%
  • Rust 0.4%
  • Astro 0.2%
  • Other 0.2%