FTAIS-BT

GPU backtesting research

A backtester asks how a trading rule would have behaved on historical prices. I built FTAIS-BT to evaluate batches of prepared strategies on the GPU, test small changes to exit settings, and follow the same rules across time.

Code & recorded research
Try the interactive walkthrough

What happens
if you nudge it?

Start with a small trading idea. Change when it buys or exits, then see what holds up. The four views below make the mechanics visible through a simplified, playable model.

Synthetic examples, with links to the actual code and recorded measurements.

One idea. Three versions of the rules.

Change one assumption.

Pick a market. Set when you’d take a profit or cut a loss. The experiment also moves both exits 5% closer and 5% farther away. Do the results stay together?

A small change can reveal a fragile result.

In this illustration, a $2 target and $1 stop also become $1.90 / $0.95 and $2.10 / $1.05. FTAIS’s direct evaluator makes the same joint ±5% change to its supplied target/stop parameters. It keeps the original profit, the largest drawdowns, and the lowest fitness across those runs.

A separate rolling-window evaluator compares a fixed rule on earlier and later slices, with unused bars between them. The rule is evaluated again; it is not retrained. The interactive illustration uses synthetic prices and a simplified exit model.

Choose a market 01 / PRICES

A climb, a reversal, and a change of direction.

When to buy 02 / SIGNAL

The signal uses closing prices. A trade waits for the next opening price.

Dollars above the entry price.

Dollars below the entry price.

Your experiment, recalculated64 synthetic price bars · one unit · before costs
Same prices, three exit settingsThe upper chart shows synthetic prices and trades. The lower chart compares cumulative closed-trade profit under original and 5% tighter or wider exits. PRICE & TRADES$110$90 CLOSED-TRADE PROFIT / LOSS+$10−$10 Bar 1Bar 64
Prepared signalBuyExitChoose a result to inspect its trades ↓
Original exits: $0.000 closed tradesClosed-trade drawdown $0.00

Three results: $0.00 to $0.00

A small change to an exit can change which price is reached first.

Original settings · rolling windows

Would it hold up later?

Keep the entry rule and your original exits. Compare 24 earlier bars with 12 later bars, leaving two bars unused between them. Then move the window forward.

Rolling evaluation on earlier and later pricesA fixed rule is evaluated over an earlier slice, then a later slice separated by two unused bars.64 bars of history164
EarlierUnused gapLater
Earlier result$0.00Bars 1–24
Later result$0.00Bars 27–38

The rule and exits stay fixed. Two bars are left unused between the slices.

What this borrows from the actual code

Three checks per idea. The direct CUDA evaluator runs original and jointly ±5% target/stop parameters. Its output keeps original profit and trades, the largest drawdowns, and the lowest fitness. This illustration lets you inspect each result separately. Read the scenario calls and aggregation ↗

Fixed rules, moving windows. The separate CUDA walk-forward path evaluates prepared signals with the same supplied parameters in both slices. It skips the later evaluation if the earlier slice has no trades; it does not fit or retrain a strategy. Read the public API ↗

A teaching model on synthetic prices: long positions, one unit, fixed-dollar exits, no fees. Drawdown uses closed trades. The full engine also models risk, sessions and execution costs; its fitness is not reproduced here.

Change a setting to explore.

Traditional event-driven tools

First, replay
what happened.

An event-driven backtester follows market updates, applies a rule, places simulated orders, and tracks the account.

Here’s a tiny example: after two rising days, buy at the next day’s opening price. Sell if the price rises $5 above the entry.

A detailed replay helps you examine how trades happen.

Daily closing pricesIllustrative prices
Replay eight days of illustrative closing pricesClosing prices are 101, 103, 104, 103, 106, 107, 110 and 108 dollars. A signal after day 3 enters at day 4's open of 104; the 109 target is reached on day 7.
Closing price$104
RuleBuy signal
OrderNext open
PositionNot holding

Two rising days create a signal. The trade waits for tomorrow’s opening price.

FTAIS-BT’s GPU approach

Give more ideas
the same history.

Prepare the buy/sell signals first. Then give the GPU a batch of independent strategies to evaluate together.

Each row is one idea. Each idea still moves through time in order; the parallel work happens across ideas.

Larger batches can spread the cost of getting work onto the GPU.

Ideas in the batch8 of 32 ideas shown
Shared price historyTime moves forward
Prepared signalBeing evaluatedIllustrative replay

From the recorded study

A batch of 32 ideas

44 ms

Measured time for 100,000 price steps per idea.

3,200,000 input price steps per scenario

Elapsed time as the batch grows Lower is less time
Recorded CUDA timing: 1 idea 44 milliseconds; 32 ideas 44; 128 ideas 54; 512 ideas 154; 1,024 ideas 287.300 ms15001321285121,024

In this run, 32 ideas took about as long as one. One synthetic workload on an RTX 4060 Laptop GPU. Each idea checks three target/stop settings; timings include moving data to and from the GPU. Medians of 30 timed runs after five warmups. View the measurements

The part speed can’t answer

Agree on
what counts.

Imagine buying at $100, with a $101 profit target and a $99 stop to limit a loss. That day touches both prices.

Daily data tells us the high and low. It doesn’t tell us which came first.

Open $100High $101Low $99Close $100
Same daily data. Two possible paths.
Two possible paths through the same daily pricesIn this hypothetical path, price reaches the 99 dollar stop before the 101 dollar target. Both possible paths have identical daily open, high, low and close.
Target $101Entry $100Stop $99
−$1
Stop reached first

Illustrative outcome for one unit, before costs.

This possible path reaches the stop before the target. The daily prices alone cannot confirm this order.

FTAIS-BT’s rule: stop first.

When both levels are touched, the evaluator uses the stop. Defining this rule makes the result repeatable—even when the data leaves the order unknown.

8 / 8

Focused test cases matched
between CPU and GPU.

Read the rules & checks
Day 3 of 8

Press replay, or move through the history yourself.

A fair comparison means knowing what each tool does.

Event-driven tools can simulate richer orders, accounts, and trading venues. Array-based tools such as VectorBT also support batches. FTAIS-BT’s GPU path evaluates prepared signals and returns compact summaries; these jobs and outputs differ, so the research keeps their timings separate.

The chart shows FTAIS-BT’s own July 2026 batch-scaling study. The separate August daily-workflow study of five other engines uses different tasks and is not combined with it. The eight matched cases establish focused correctness, not complete feature equivalence.

Methods, results & limitations

Keep exploring

More things I’ve been building.

Back to selected work