Backtests
Replay a strategy on recent market days, read what it shows, and know its limits.
A backtest replays a strategy on recent days of the market. It uses the same engine as the bot, and the same fills as paper trading. So its decisions are the ones the bot would have made on those days.
A backtest shows how a strategy would have traded in the past. Past days do not say what comes next. A good backtest does not mean that a strategy will make money.
Who can run one
You can run a backtest when you hold an activated Spinner, at any tier. If the Spinner is not activated, the Backtest section says: "Backtests are for activated Spinners: activate this one to test a strategy on the last 30 days of the market." Read activation.
Run a backtest
Choose the period
Under the editor, in Backtest, choose Over: The last day, The last 7 days, The last 14 days or The last 30 days.
Start it
Select Run the backtest. A dialog opens. The result grows as the days replay.
Stop or run again
Select Stop to stop the run. When it is done, select Run again or Close. Closing the dialog also stops a run.
The backtest uses the strategy as it is in the editor now, saved or not. It runs in your browser. Your browser keeps the days it downloads, so a second run of the same days is faster.
The data and the period
Spin keeps the last 30 days of market history. A backtest reads what its strategy needs:
- A launch or trade strategy reads every launch and trade on its launchpads (Pons, Torch, or both).
- A strategy with a chosen token reads that token's price history. Spin keeps price history only for the tokens on its token list.
The backtest uses the latest days that all the data it needs covers. The days are in UTC. If there is no data for the strategy, the backtest says why, for example "not enough data: no stored days cover this strategy yet".
How it fills
The backtest fills buys and sells as paper trading does:
- A Pons curve fills by the curve's own math, with its fee and tax.
- A pool fills at its price less its fee, with no price impact.
- The bot's own trades never move the market.
- The 0.5% bot fee is taken from each trade, each way.
What it shows
| Item | What it is |
|---|---|
| Result | The return in percent, with the result in ETH. It counts sales, less buys, plus what is still held. |
| Trades | The number of trades, and how many closed. |
| Winners | The share of closed trades that made money. |
| Worst drawdown | The largest fall of the running result from its high, in ETH. |
Under these, you see:
- A chart of the running result over time.
- The ETH spent, the ETH back from sales, and the value still held. A position still open at the end is valued at its last price, less the cost of selling.
- "Not bought": the most common reasons the strategy did not buy, with how often. For example "confirm failed" or "max_open reached".
- When the run ends: one trade over its token's price, and a table of the trades, newest first (up to 50). Select Chart on a trade to show it over its token's price. Each trade shows its token, when it opened (UTC), the ETH in, its result, and the exit that closed it.
What cannot be backtested
The editor says so when a strategy cannot be backtested, and why:
- A strategy with an AI step. Its answers on past days cannot be known.
- A strategy that launches a token. How a token that was never launched would have traded is unknowable.
- A webhook strategy. What your service would have sent on past days cannot be known.
- A chosen token that is not on Spin's token list. Spin has no price history for it.
The limits of a backtest
- It covers 30 days at most.
- A pool has no price impact, and the bot's own trades do not move the price. A real trade can get a worse price, mostly in a thin market.
- A backtest of a few trades says little. Look at the number of trades, the share of winners, and the worst drawdown together.
- Run the strategy on paper before you turn on live trading. Read live trading.