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.
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.
Ask market-related questions, get analysis on tickers, explore trading concepts, and investigate technical indicators. Finny acts as your financial research assistant.
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.
List all algorithms saved in your current workspace. Shows strategy names, creation dates, and file paths.
View the raw source code of your most recently generated or selected algorithm, printed directly in the terminal.
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.
Get an AI-powered code review of your current algorithm. Finny analyzes the strategy for potential issues, edge cases, and optimization opportunities.
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.
Trades based on the rate of price change. Enters positions when momentum indicators (RSI, ROC) confirm a sustained directional move.
Capitalizes on price returning to its historical average. Uses Bollinger Bands and z-score to identify overbought/oversold conditions.
Detects when price breaks through key support or resistance levels with volume confirmation. Targets the beginning of new trends.
Systematic time-based buying strategy that accumulates a position at regular intervals regardless of price, reducing the impact of volatility.
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).
High-frequency, short-duration trades targeting small price movements. Uses tight stop-losses and rapid entry/exit signals.
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
Risk-adjusted return. Measures excess return per unit of volatility. Higher is better; above 1.0 is generally considered good.
Largest peak-to-trough decline during the backtest period. Lower is better — indicates how much you could lose at worst.
Percentage of trades that were profitable. Context-dependent — a 40% win rate can be profitable with high reward-to-risk ratios.
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.
Strategies are saved to the cloud whenever you build or modify them. No manual upload needed.
Every iteration of your strategy is versioned. Roll back to any previous version at any time.
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
Claude 4.5 Sonnet, Claude 4 Opus, and other Claude models.
GPT-4o, GPT-4, and other OpenAI models.
Gemini Pro, Gemini Ultra, and other Google AI models.
Connect to locally-hosted models via compatible API endpoints (e.g., Ollama, LM Studio).
Troubleshooting
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
Ensure Finny is installed globally: npm i -g finny. Check that your npm global bin directory is in your PATH.
Run /init inside the Finny CLI to configure your API key and provider.
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.