fwdtrader
In development. Free and open source when it's released.

See if that backtest holds up.

fwdtrader will run any trading strategy on an Interactive Brokers paper account every market day, and show you how it compares with the backtest.

Get updates by email You'll join the Hacking the Markets mailing list.
A backtest compared with what happens next An illustration. A blue backtest line rises smoothly until the backtest ends. A dashed line continues upward to show what the backtest implied. A red pencil line starts from the same point and falls away, marked with wider spreads, stops filling past their price, and commissions. Backtest ends Forward test starts The backtest What it implied wider spreads stops slipped commissions too

An illustration of the idea, not real results.

Why this exists

fwdtrader grew out of testing a published opening-range breakout strategy. The backtest looked strong before costs. Then we ran it on a paper account and measured every step.

  • 438 paper trades over 37 sessions
  • −0.22R per trade before commissions, and −0.29R after
  • About 2.7 of roughly 14 daily picks matched the research list

R is the amount risked on a trade. These results come from one strategy over a short period, using simulated paper fills. They aren't a verdict on the published research or a prediction of future results.

What each paper trade cost
Entry slippage0.10R
Stops filling past their price0.085R
Commissions0.07R
Total, roundedAbout 0.25R

How it will work

Automated paper trading is mostly an infrastructure problem. fwdtrader is meant to handle that part, so you can spend your time testing ideas.

  1. Deploy a paper trading server

    Point it at a new Ubuntu server. It sets up IB Gateway in Docker, with paper mode locked on and its ports kept private.

  2. Add a strategy

    Take one from a paper, a blog post, a video or your own research, and write it as plain Python scripts.

  3. Record your expectations

    Write down what the backtest claims before the first trade, so you can't move the goalposts later.

  4. Let it run

    It runs every market day, placing paper orders with protective stops and saving every decision, including the trades it skipped.

  5. Compare it with the backtest

    See how results, stock selection, fills and costs differ, and whether a gap looks real or like normal variation.

Plain Python, no framework

A strategy will be a folder of scripts, one for each stage of the trading day. Each stage reads and writes ordinary files, so you can run one step, open its output, and see exactly what happened.

To test a new idea, copy an example and rewrite the stages that differ.

strategies/
  stocks_in_play/
    scan_market.py
    rank_stocks_in_play.py
    submit_paper_orders.py
    watch_breakouts.py
    close_positions.py
    run_session.py
shared/
  gateway.py   # connect and reconnect
  orders.py    # place and track paper orders
  records.py   # save decisions and fills

Built to work with AI assistants

Paste in a strategy from a paper or blog post, and your coding assistant will be able to turn it into pipeline scripts, investigate a failed session, and review the results with you. Project guides and Claude Skills will show it how the project works.

What it won't do

Find you a profitable strategy

Most ideas don't survive contact with the market. Finding that out cheaply is the point.

Give signals or recommendations

It tests the ideas you bring. It doesn't tell you what to trade.

Perfectly simulate real trading

IBKR simulates paper fills, so real results can differ. A good paper result is evidence, not proof.

Trade with real money

It's being built around paper trading, with paper mode locked on by default.

Follow the build

fwdtrader isn't available yet. The system behind it is being built and tested in public, in a video series on Hacking the Markets.

Get updates by email