PyInvesting

Choose a backtest

Each method tests a different kind of investment rule. Start from the question you want answered, then open the builder for that method.

Match the method to your question

Choose the decision rule before comparing historical results. Each method makes different assumptions, and historical results do not establish future profitability.

  • Momentum ranking

    Relative strength

    Which eligible instruments rank strongest?

    Rank investments by recent performance and hold the strongest.

    What to check Ranking and trend eligibility are different decisions.

  • Trend threshold

    Moving average

    When does a price-trend rule hold an instrument?

    Use a price trend threshold to decide when investments are held.

    What to check Average type, period, entry and exit assumptions.

  • Company measures

    Fundamentals

    Which companies rank well on accounting measures?

    Rank companies using financial and valuation measures at each rebalance.

    What to check Information dates and historical universe coverage.

  • Price levels and risk

    Breakout trading

    How do price-level entries and exits behave?

    Test entries after prices cross defined levels, with explicit exit and risk rules.

    What to check Entry and exit windows, sizing, risk rules and overfitting.

  • Changing risk weights

    Dynamic risk allocation

    How should weights change when instrument risk changes?

    Adjust portfolio weights using the recent risk of your selected investments.

    What to check Daily reporting-currency volatility, position caps, cash and trading frequency.

  • Deviation and recovery

    Mean reversion

    When does an unusually weak price recover?

    Test buying unusually weak prices and exiting on recovery.

    What to check Bollinger or Wilder RSI thresholds, frozen entry quantities, cash slots and recovery exits.

  • Fixed target weights

    Strategic allocation

    How would fixed portfolio weights behave?

    Rebalance a chosen group of investments to fixed target weights.

    What to check Target weights, rebalancing, currency and benchmark.