How it works

From plain English
to proof.

Four steps happen between typing your strategy and reading your results. Here is exactly what each one does — no magic, no black box.

01 Describe 02 Generate 03 Execute 04 Analyze
STEP 01

Describe your strategy like a human.

Type your rules the way you'd explain them out loud. No syntax, no formulas, no documentation to study. The more specific you are — indicator names, periods, thresholds — the more faithfully the AI will translate it.

Pick the market and ticker — stocks, ETFs, crypto, or forex.
Set capital, dates, commission, slippage, stop-loss, and position size — or keep the sensible defaults.
Vague works too — "test a golden cross on Tesla" — the AI fills standard parameters.
YOUR PROMPT

"Buy AAPL when the 20-day moving average crosses above the 50-day. Sell when RSI goes above 70. Test from 2020 to 2024 with $100,000."

AAPL · $100K · 2020–2024 Run ↵
strategy.py — GENERATED
# Generated by AlphaBack
from backtesting import Backtest, Strategy
from backtesting.lib import crossover

class SmaRsiStrategy(Strategy):
    def init(self):
        self.sma20 = self.I(SMA, self.data.Close, 20)
        self.sma50 = self.I(SMA, self.data.Close, 50)
        self.rsi   = self.I(RSI, self.data.Close, 14)

    def next(self):
        if crossover(self.sma20, self.sma50):
            self.buy()
        elif self.rsi[-1] > 70:
            self.position.close()
STEP 02

AI writes the Python — and shows you every line.

A large language model translates your description into a strategy class for backtesting.py, the same open-source engine quants use for prototyping. The code is displayed alongside your results, always.

That transparency is a design decision, not a feature: if you can't read the rules that actually ran, you can't trust the numbers they produced. Copy the code with one click and run it on your own machine — it's standard Python.

STEP 03

The engine replays history, bar by bar.

Your code runs in an isolated Python environment on our servers. It downloads fresh daily price data from Yahoo Finance, then walks through it one bar at a time — exactly as if the strategy were trading live through those years.

At each bar the engine evaluates your rules using only the data available at that moment — no peeking at the future. Orders fill on the next bar, and commissions and slippage are charged on every trade.

EXECUTION LOG
Fetched 1,258 daily bars for AAPL yfinance
Computed SMA(20), SMA(50), RSI(14) indicators
Simulated 2020-01-02 → 2024-12-31 bar-by-bar
Filled 23 trades, commission applied 0.1% / trade
Computed 20+ performance statistics report
RESULTS · SMA 20/50 · AAPL
Total Return
+31.4%
Sharpe Ratio
1.22
Max Drawdown
-13.8%
Win Rate
61%
STEP 04

Read the numbers that actually matter.

In seconds you get the full report: an equity curve of your portfolio value over time, a drawdown chart of every losing stretch, headline metrics, and a trade-by-trade log of every entry and exit.

Then iterate. Change one threshold, re-run, compare. Side-by-side comparison mode overlays equity curves so you can see not just which version made more, but which made it with less pain.

Built on tools you can verify.

AI code generation
LLM → Python
A large language model translates your plain-English rules into a strategy class. Fast enough that generation takes about a second — and the output is always shown to you.
Market data
yfinance
Historical OHLCV data from Yahoo Finance — up to 20 years of stocks, ETFs, indices, forex, and crypto, split- and dividend-adjusted, fetched fresh on every run.
Simulation engine
backtesting.py
A respected open-source backtesting framework. Bar-by-bar event simulation, realistic order fills, commission and slippage modelling, and 20+ output statistics.
Secure execution
isolated sandbox
Generated code runs in an isolated Python environment on our servers — never in your browser, never with access to your account. You only receive results.

Every metric, explained in one breath.

Total Return
How much the strategy grew (or shrank) your starting capital over the whole test, after costs. +31.4% means $100,000 became $131,400.
Equity Curve
Your portfolio value plotted through time. The shape matters as much as the endpoint — a smooth climb beats a violent zigzag that lands in the same place.
Sharpe Ratio
Return per unit of volatility — the classic "was it skill or a rollercoaster?" number. Above 1.0 is solid; above 2.0 is rare and worth double-checking for overfitting.
Max Drawdown
The worst peak-to-trough fall the strategy ever took. This is the number that decides whether you could actually have held on — a 40% drawdown ends most traders.
Win Rate
The percentage of trades that closed profitable. High win rate isn't automatically good — a strategy can win 80% of the time and still lose money if the losses are big.
Trade Log
Every entry and exit with dates, prices, and per-trade return. The ground truth behind every summary stat — and where you spot the one lucky trade carrying the result.
Drawdown Chart
How far below its previous peak the portfolio was at every moment. Long flat stretches at the bottom show the painful months a backtest summary hides.
Stress Tests
The strategy re-run through specific historical storms — 2008, the 2020 crash, the 2022 bear — to see if the edge survives when everything falls at once.

The honest comparison.

AlphaBack DIY Python TradingView Spreadsheets
Time to first backtest ~1 minute Days–weeks Hours Days
Coding required None Python + pandas Pine Script Formulas
Bar-by-bar engine (no look-ahead) Yes If you build it right Yes Easy to get wrong
Commissions & slippage modelled By default If you remember Manual setup Rarely
You can inspect the exact code Always shown It's yours Pine only
Code is portable (runs anywhere) Standard Python Yes Locked to platform
Stocks + crypto + forex in one place Yes Yes Yes Manual imports
Cost to start Free Free + your weeks Paid for full tests Free

Being fair: if you're a working quant, writing your own Python gives you infinite flexibility — and AlphaBack hands you that exact starting code for free. If you live in TradingView charts all day, Pine Script is great at chart-first workflows. AlphaBack's job is the fastest honest path from "I have an idea" to "here's what history says about it."

What a backtest can't tell you.

Past ≠ future
A backtest proves what your rules would have done, not what they will do. Markets change regimes; edges decay as more people find them. Treat great results as evidence, never as a guarantee.
Overfitting
Tweak parameters long enough and any strategy looks brilliant — on the past. That's memorizing history, not finding an edge. Keep rules simple and test them on periods and tickers you didn't tune on.
Execution reality
Live trading has gaps, partial fills, halted tickers, and your own emotions at 3am. We model commissions and slippage, but no simulation captures everything. Size positions like the backtest might be optimistic.

We put this on the page because a backtester that oversells certainty is worse than no backtester at all. Used honestly, backtesting is still the single best filter between you and a bad idea. More questions? Read the full FAQ →

Now try it on your own idea.

You just read the whole pipeline. It's faster to run it than it was to read it.

Run my first backtest →

Free during beta · No card required