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.
For a deeper template reference, see Strategy Templates.
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.
For the focused backtesting guide, see Backtesting Trading Strategies.
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.
Brokerage Connections
Link a brokerage to run your strategies against real (or paper) markets. Credentials stay on your machine — they're written to a local auth file and never leave the CLI.
For the focused broker workflow guide, see Brokerage Workflows.
Supported Brokerages
US equities and USD-quoted crypto. Paper and live endpoints supported. Crypto symbols like BTC-USDT are auto-normalized to BTC/USD. Taker fee modeled at 0.25%.
Crypto spot via testnet (mainnet not yet exposed in the UI). Quotes default to USDT. Taker fee modeled at 0.1%. No futures.
Coming soon. Reserved in the broker registry but no adapter ships yet.
Coming soon. Tier-gated in the registry; OAuth (Questrade) and IB Gateway (IBKR) adapters are not yet implemented.
Connecting a Brokerage
There's no /connect command — accounts are added from the TUI. Open /portfolio and choose Add account, or open /settings → Paper Trading tab. Pick the broker from the segmented control and fill in the dialog.
Alpaca
Fields prompted in the Add Account dialog:
Label my-alpaca-paper Key ID ******************************** Secret **************************************** Endpoint https://paper-api.alpaca.markets # or live URL
Or set via environment variables (read at runtime if no saved account is selected):
export ALPACA_API_KEY_ID="..." export ALPACA_API_SECRET_KEY="..." export ALPACA_ENDPOINT="https://paper-api.alpaca.markets" export ALPACA_PAPER="true"
Requires alpaca-py>=0.30, which Finny installs into its managed Python venv on first use.
Binance
Fields prompted in the Add Account dialog:
Label my-binance-testnet API key ******************************** API secret ****************************************
No endpoint field — testnet is hardcoded in the UI today. Environment variable fallback:
export BINANCE_API_KEY="..." export BINANCE_API_SECRET="..." export BINANCE_TESTNET="true"
Powered by ccxt>=4 with set_sandbox_mode(True) for testnet routing.
Where Credentials Live
All saved accounts are written to a single XDG auth file:
~/.local/share/finny/auth.json (mode 0600, plaintext JSON)
Each entry is keyed by provider — e.g. alpaca-paper-…, binance-testnet-… — and stores key, secret, label, and (for Alpaca) endpoint. There is no OS keychain integration today; the file is plaintext with restrictive permissions, so treat your machine as the trust boundary.
How Strategies Use a Connection
Generated strategies are plain Python files that receive a broker instance from Finny — you don't import or instantiate it yourself. The same strategy runs unchanged against Alpaca or Binance.
def run(broker):
if not broker.market_is_open("BTC/USD"):
return
bar = broker.fetch_bar("BTC/USD", interval="1h")
cash = broker.cash()
if bar.close > bar.open and broker.position("BTC/USD") == 0:
broker.buy("BTC/USD", notional=cash * 0.1)Available methods on the injected broker:
Managing Connections
All management lives in /settings → Paper Trading:
- List every saved account, with its broker and label.
- Remove an account with the per-row Remove button — credentials are wiped from
auth.json. - Reset the managed Python environment if backtest / live runs start failing after a dependency change.
Connections are validated implicitly — the broker SDK is exercised when the account is added, so invalid keys fail fast.
- First run installs
alpaca-py/ccxtinto~/.local/share/finny/python-env/— expect a 30–60s cold start. Resettable from Settings. auth.jsonis plaintext (0600, no keychain). Don't sync it. When generating API keys, disable withdrawals and IP-restrict where the broker supports it.- Binance is testnet-only and spot-only in the current UI — no mainnet, no futures.
- Alpaca crypto is USD-quoted only;
BTC-USDTauto-rewrites toBTC/USD.
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).
Product Positioning
Finny is built for traders and developers searching for AI backtesting, trading strategy generation, and terminal-native market automation. It should not be described as a generic budgeting app, advisor marketplace, or personal finance chatbot.
Relevant search intent
Differentiation
- Not advisor prospecting: Finny targets strategy builders, not wealth-management lead generation.
- Not budgeting: Finny focuses on market workflows, generated Python, and backtesting, not expense tracking.
- Technical depth: docs, commands, templates, broker details, and backtesting metrics support topical authority.
- Transparent workflow: generated strategy code remains inspectable before any broker-connected execution.
FAQ
Finny is a CLI-based AI trading assistant. You describe a trading idea in plain English, and Finny helps generate strategy code, validate it, save iterations, and run backtests.
No. Finny is not a budgeting app and does not provide personal financial advice. It is a developer and trader tool for algorithmic investing workflows, market research, strategy generation, and backtesting.
Finny supports stock and crypto strategy workflows, with Alpaca and Binance integrations documented today. Broker support is designed around paper trading, live trading workflows, and inspectable strategy code.
Finny can support broker-connected workflows, but generated strategies should be reviewed and tested before live use. The core value is faster strategy development, validation, and backtesting, not black-box investment advice.
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.