PyInvesting

Research before risk

Test an investment rule before you trust it.

Build a portfolio rule, compare it with a benchmark, and inspect returns, drawdowns, holdings, turnover, and trades.

No brokerage connection required. Simulation, not investment advice.

A repeatable workflow

From question to inspectable evidence.

Keep the rule, comparison, and result connected so you can understand what changed and why.

  1. 01

    Frame the rule

    Choose instruments, signals, allocation, and an evaluation window.

  2. 02

    Set the comparison

    Select a relevant benchmark and make costs and rebalance assumptions explicit.

  3. 03

    Run the simulation

    Apply the same rule consistently across the available historical observations.

  4. 04

    Inspect the evidence

    Review return, drawdown, risk, turnover, holdings, and trades together.

Inside a result

See the return. Then inspect what produced it.

A result keeps the cumulative return beside its benchmark, risk, and trading activity so one attractive line never has to stand on its own.

Sample data shown for interface preview only.

Backtests Results
Complete

Illustrative backtest

Quality momentum

US equities · Monthly rebalance · Jan 2018–Dec 2025

Benchmark: S&P 500
Strategy return
+84.6% Illustrative period
S&P 500
+63.2% Same period
Maximum drawdown
−18.4% Peak to trough
Turnover
4.1× Annualized

Performance

Cumulative return

Strategy S&P 500
Illustrative cumulative return comparison An illustrative strategy rises from zero to 84.6 percent while an S&P 500 comparison rises to 63.2 percent, with negative calendar returns in 2020, 2022, and 2024. This sample does not represent live performance.

Risk path

Historical drawdown

−18.4%
Illustrative historical drawdown A sample drawdown chart with the deepest decline reaching negative 18.4 percent.

Depth and recovery stay visible instead of being reduced to a single statistic.

Year by year

Annual returns

5 / 8 positive
  1. +8.0%2018
  2. +20.0%2019
  3. −8.0%2020
  4. +24.0%2021
  5. −14.0%2022
  6. +27.0%2023
  7. −4.0%2024
  8. +19.1%2025

Period detail reveals whether performance was persistent or concentrated.

Illustrative interface preview. Returns are hypothetical and exclude taxes and investor-specific costs.

See published methods

Read beyond one number

A return is a result. The assumptions are the evidence trail.

PyInvesting keeps the portfolio rule beside the benchmark, holdings, turnover, and trade history. That context helps you question a result instead of treating it as a promise.

Review published strategy methods
Return
What changed over the selected period?
Drawdown
How deep were historical declines?
Turnover
How often did the simulated portfolio trade?
Holdings
Which instruments drove the result?

Choose a starting method

Build from a clear investment question.

Start with a guided research pattern, then adjust the rule and inspect the evidence yourself.

01 / Momentum

Relative strength

Test a rule that ranks instruments by their relative historical performance.

Open the builder

02 / Trend

Moving average

Explore how a repeatable price-trend rule behaves across historical periods.

Open the builder

03 / Fundamentals

Fundamental ranking

Construct a portfolio rule from company measures and explicit ranking criteria.

Open the builder

Start with a falsifiable rule

Make the next investment idea inspectable.