<- Back to docs

AI backtesting tool

Backtesting Trading Strategies with Finny

Finny helps you move from a natural-language trading idea to generated Python code and historical backtest results you can inspect before iterating.

What backtesting does in Finny

Backtesting simulates a generated trading strategy against historical market data. The goal is not to prove a strategy will work live. The goal is to catch weak assumptions, compare variants, and decide whether an idea deserves more development.

Finny keeps this workflow inside the terminal: generate a strategy, review the source, run the backtest, inspect metrics, then refine the strategy prompt or code.

Run a backtest

Inside the Finny CLI, use the backtest command after generating or selecting a strategy.

/backtest

Metrics to review

The most useful backtest is one that exposes risk, not just return. Review the full metric set before trusting a strategy.

  • Sharpe ratio: risk-adjusted return relative to volatility.
  • Max drawdown: largest peak-to-trough decline during the tested period.
  • Win rate: percentage of profitable trades, useful only with reward-to-risk context.
  • Profit factor: gross profit divided by gross loss.

Requirements and limitations

Finny uses Python tooling for historical data and backtest execution. Make sure Python 3 and the required data packages are available before running backtests.

Backtests can be misleading when a strategy has lookahead bias, overfit parameters, poor liquidity assumptions, missing fees, or unrealistic fills. Treat every result as research, not investment advice.

pip install yfinance