tradefloorStart free

The trading multiverse for agents

tradefloor: a simulated stock market for testing trading strategies and AI agents

Fork one market into many futures and see what each change does. Runs are deterministic and repeat exactly. A 313-variable model, checked against real markets on 40 pre-registered measurements. Built for agents, bots and trading algorithms, whose orders move the prices they trade at.

One simulated market, one trading yearaheadbehindthe change landsa branch starts herelive day

Your first market in Python

The script runs thirty trading days of five generated companies and scores buy-and-hold and momentum on two copies of one market. Then it rebuilds the market from its inputs and checks that it matches the first run. The whole script takes about a second.

import tradefloor as tf

# five generated companies in one simulated market
universe = tf.Universe.random(5, seed=7)
engine = tf.Engine(seed=776644, universe=universe)
engine.run_days(30)  # thirty trading days

# two strategies, each on its own copy of that market.
# Their orders fill against the book and move the price.
cards = tf.evaluate({"hold": tf.baselines.BuyAndHold(),
                     "momentum": tf.baselines.Momentum()},
                    seed=776644, universe=universe, days=30)
for name, card in cards.items():
    print(f"{name:9} pnl {card.pnl:>9,.0f}",
          f"impact {card.impact_bps:+.2f} bp")

# the same inputs rebuild the same market, bit for bit
again = tf.Engine(seed=776644, universe=universe)
again.run_days(30)
print(again.state_hash() == engine.state_hash())

Output on tradefloor 0.10.2

hold      pnl       574 impact +0.09 bp
momentum  pnl  -103,664 impact +1.12 bp
True
index, 100 = day 0 close
10910091VIXday 0day 30
AAA104.8AAB105.1AAC92.1AAD98.4AAE98.5VIX18.60
day 30 of 30expansion

Continue in the quickstart

The trouble with backtests

A backtest tells you how a strategy would have done on prices that already happened. It can't tell you what happens when your orders are big enough to move the price, or how the strategy does in a thousand other years. If an AI agent is making the trades, its model may already have seen that history in training.

Backtesttradefloor
Your ordersFill at the recorded price, as if you weren't thereHit an order book and move the price
Markets to test onOne, the one that happenedAs many as you want, one per seed
What if rates had risen?You can't rerun historyFork the market and find out
CrashesA handful, and you know how they endedA rate shock or a recession on any market, whenever you want
LuckOne run, and a good result might be luckRun two strategies on the same seeds and count who wins
AI agentsThe model may have seen the data in trainingEvery market is new
PricesRealSimulated, and checked against real markets

Common workflows

See it working

Open source and hosted

Compare plans