Documentation

Everything you need to build, backtest, and deploy trading algorithms with Finny.

Getting Started

Prerequisites

Finny requires Node.js 18+ installed on your system. Python 3 and yfinance are needed for backtesting with real market data.

Installation

Install Finny globally via npm:

npm i -g finny

First Run

Launch the interactive CLI:

finny

On first run, Finny will guide you through setting up your API key and preferred AI provider. You can also run /init inside the CLI to reinitialize your configuration at any time.

Agent Modes

Finny operates in three distinct modes. Press Tab to cycle between them.

Build Mode

Generate and iterate on full trading strategies. Finny writes complete Python algorithms based on your natural language descriptions, saves them to your workspace, and can refine them across multiple turns.

Research Mode

Ask market-related questions, get analysis on tickers, explore trading concepts, and investigate technical indicators. Finny acts as your financial research assistant.

Chat Mode

General-purpose conversation. Discuss ideas, ask for explanations, or brainstorm strategies before committing to a build.

Commands Reference

Type these slash commands directly into the Finny CLI.

/algos

List all algorithms saved in your current workspace. Shows strategy names, creation dates, and file paths.

/code

View the raw source code of your most recently generated or selected algorithm, printed directly in the terminal.

/backtest

Run a backtest on your current strategy using historical market data pulled via yfinance. Returns performance metrics including Sharpe Ratio, Max Drawdown, Win Rate, and Profit Factor.

/review

Get an AI-powered code review of your current algorithm. Finny analyzes the strategy for potential issues, edge cases, and optimization opportunities.

/init

Reinitialize your Finny configuration. Re-run the setup wizard to change your API key, provider, or workspace settings.

Strategy Templates

Start from a proven foundation. Templates provide complete, backtestable strategies you can customize.

Momentum

Trades based on the rate of price change. Enters positions when momentum indicators (RSI, ROC) confirm a sustained directional move.

Mean Reversion

Capitalizes on price returning to its historical average. Uses Bollinger Bands and z-score to identify overbought/oversold conditions.

Breakout

Detects when price breaks through key support or resistance levels with volume confirmation. Targets the beginning of new trends.

DCA (Dollar Cost Averaging)

Systematic time-based buying strategy that accumulates a position at regular intervals regardless of price, reducing the impact of volatility.

Golden Cross

Classic moving average crossover strategy. Enters long when the 50-day MA crosses above the 200-day MA, and exits on the inverse (death cross).

Scalping

High-frequency, short-duration trades targeting small price movements. Uses tight stop-losses and rapid entry/exit signals.

Custom

Start with a blank canvas. Define your own entry/exit logic, indicators, and risk parameters from scratch with AI assistance.

Backtesting

Run /backtest to simulate your strategy against historical market data. Finny uses yfinance to fetch real OHLCV data for any supported ticker.

Performance Metrics

Sharpe Ratio

Risk-adjusted return. Measures excess return per unit of volatility. Higher is better; above 1.0 is generally considered good.

Max Drawdown

Largest peak-to-trough decline during the backtest period. Lower is better — indicates how much you could lose at worst.

Win Rate

Percentage of trades that were profitable. Context-dependent — a 40% win rate can be profitable with high reward-to-risk ratios.

Profit Factor

Ratio of gross profit to gross loss. Above 1.0 means the strategy is net profitable. Above 2.0 is considered strong.

Data Source

Historical data is pulled from Yahoo Finance via the yfinance Python library. Ensure Python 3 and yfinance are installed for backtesting to work.

Cloud Storage

Finny integrates with Convex for cloud-based strategy storage. Your algorithms are automatically saved and versioned so you can access them across devices.

Automatic Sync

Strategies are saved to the cloud whenever you build or modify them. No manual upload needed.

Version Tracking

Every iteration of your strategy is versioned. Roll back to any previous version at any time.

Cross-Device Access

Log in from any machine and pick up right where you left off with your full strategy library intact.

API Keys (BYOK)

Finny supports Bring Your Own Key. Connect your preferred AI provider during setup or via /init.

Supported Providers

Anthropic (Claude)

Claude 4.5 Sonnet, Claude 4 Opus, and other Claude models.

OpenAI

GPT-4o, GPT-4, and other OpenAI models.

Google (Gemini)

Gemini Pro, Gemini Ultra, and other Google AI models.

Local Models

Connect to locally-hosted models via compatible API endpoints (e.g., Ollama, LM Studio).

Troubleshooting

Python + yfinance Required for Backtesting

If Finny is not working — especially backtesting — make sure you have Python 3 and yfinance installed on your system:

pip install yfinance

Finny shells out to Python for data fetching and backtest execution. Without these dependencies, commands like /backtest will fail.

Common Issues

"Command not found: finny"

Ensure Finny is installed globally: npm i -g finny. Check that your npm global bin directory is in your PATH.

"API key not set"

Run /init inside the Finny CLI to configure your API key and provider.

Backtest returns no data

Verify the ticker symbol is valid and that yfinance can fetch data for it. Some delisted or very new tickers may not have historical data available.