Crypto backtesting

Crypto backtesting: test a strategy before you trade it

Crypto backtesting means running a trading strategy over past market data to see how it would have done after the costs of trading. Keel is a free crypto backtester for Hyperliquid perpetuals: you build a strategy for one coin or a whole portfolio, and Keel tests it on real price and funding history with fees, slippage and funding charged on every trade. Try it right here on strategies from Keel's public library.

By Keel Research Team
Updated October 23, 2026
Try it on the library

Supertrend Strategy (Crypto Perps) goes long a coin when its Supertrend line turns up and short when it turns down, on daily bars, with each position sized by the coin's volatility. It traded 20 coins.

Change a setting

precomputed · updates instantly

Each button shows the saved backtest for that setting, including the ones that lost money.

ATR lookback
ATR band multiplier
Sharpe
0.99
Return
105.0%
Worst DD
−31.6%
Trades
679

At $1,000, these settings' worst historical dip was about $316. You land in the editor with this exact setup. Free account, your own keys.

Compare all 12 settings
ATR lookbackATR band multiplierSharpeReturnWorst DDTrades
1020.6346.2%−31.0%820
1030.5940.9%−33.9%702
1040.6244.9%−42.7%656
1420.6750.1%−30.4%806
1430.9698.1%−31.4%674
1440.8783.8%−43.5%642
2020.8273.2%−28.3%803
203default0.99105.0%−31.6%679
2040.8375.3%−42.5%653
3020.7052.8%−29.9%788
3030.7463.1%−38.7%680
3040.5739.4%−47.9%674

These are real Keel backtests of strategies from the public library, run on Hyperliquid from Aug 2024 to Sep 2026 with fees, slippage and funding charged, and saved for every combination of the settings shown. Picking a setting shows its saved result. Nothing runs on this page. Data as of Sep 29, 2026.

The basics

What backtesting is, and what it can tell you

A backtest takes a set of trading rules and replays them over history, bar by bar. At each bar the rules look at what was known then, decide what to hold, and the backtest books the trades, the costs and the profit or loss. At the end you get an equity curve, the drawdowns along the way, and a list of every trade.

Its job is to kill bad ideas cheaply. If a strategy loses money on the past, after costs, it rarely starts working with real money. A good backtest doesn't prove a strategy will work. It shows you how the rules behaved in markets that actually happened, so you can decide whether the idea is worth more time.

In crypto, a backtest needs a little more care than in stocks. The market trades all day, every day. Most active trading happens in perpetual futures, which charge or pay funding every hour on Hyperliquid. Coins list and delist all the time, and history for most of them is short. The steps below cover what to get right.

The method

How to backtest a crypto strategy

Seven steps, in the order you would do them. Each one closes a way a backtest can fool you.

These are the crypto steps: funding, perps and a market that never closes. For the method in any market, read how to backtest a trading strategy.

  1. 01

    Write the rules down exactly

    A backtest can only test rules that leave no room for judgment. Which coins, what makes you buy or short, when you get out, how big each position is, and how often you check. If you would decide any of that by feel on the day, the backtest is testing something you won't do.

    In Keel the rules are blocks on a canvas, picked from 251 building blocks: data, indicators, filters, ranking and sizing. You can describe the idea in words and let the AI build it, then read every setting before you test.

  2. 02

    Use enough of the right data

    For spot trading you need price bars. For perpetual futures you also need the funding history, because funding is real money in or out of every open position. Cover more than one kind of market: a rally, a sell-off and a long stretch of chop. A strategy tested only on a bull run tells you very little.

    Keel has Hyperliquid's price and funding history built in, so there is no data to download or clean. You pick the coins and the dates.

  3. 03

    Charge every cost

    Each trade pays an exchange fee and loses a little to slippage, the gap between the price you saw and the price you got. On perps, every open position also pays or receives funding. A strategy that trades often can look great before costs and lose money after them.

    Keel charges the fee and slippage you set on every trade and applies the real funding to every position. Raise the slippage and run it again to see whether the edge survives.

  4. 04

    Only use what was known at the time

    Look-ahead bias is the most common way a backtest lies. It creeps in when a rule uses a bar's close to trade at that same bar's open, or reads a value that was only known later, such as the day's high when deciding at the open. The result is a backtest that knew the future.

    Keel checks its blocks for this: each one is run on full history and on history cut off early, and the earlier answers must match. If a block's output changes when the future is removed, it was reading the future.

  5. 05

    Test the portfolio, not one chart

    If you will trade ten coins, test ten coins together, with the sizing and rebalancing you will really use. Crypto coins move together, so ten longs are often one bet on the market. A portfolio test shows the drawdown you would actually sit through and the cost of keeping the book balanced.

    Keel tests a strategy across the coins you pick, with position sizing, long and short books and rebalancing rules as part of the strategy.

  6. 06

    Keep some history back

    Tune the settings on one part of history, then run the result once on dates it has never seen. If it falls apart, it was fitted to noise. Walk-forward testing repeats this through time. Prefer settings that work across a range of values over one sharp peak.

    Every Keel backtest takes a start and end date, and every run is saved, so a held-out test is a second run on later dates.

  7. 07

    Paper trade before real money

    Live markets add things no backtest has: real fills, outages, and the market changing after you finish testing. Running the strategy against the live market without real money is the last cheap check.

    Keel's paper trading runs the same strategy on live Hyperliquid prices. When you're ready, the same strategy runs live from your own account.

The data

Crypto backtesting data

What a crypto backtest needs, what Keel tests on, and where else traders get their data.

What a crypto backtest needs

  • Price bars at the size you trade

    Open, high, low, close and volume (OHLCV) for every bar, at the bar size the strategy trades on. A rule that reacts within the day needs intraday bars; daily bars hide the moves it would have traded.

  • Funding for perpetuals

    Perps pay or charge funding on a schedule, and on Hyperliquid it settles every hour. Without it, a long trend strategy in a hot market looks better than it was, and a carry strategy looks like it does nothing.

  • Fees and slippage

    Every fill pays the venue's fee and loses something to the spread and to moving the price. Both belong inside the test, charged on every trade, not in a note under the result.

  • Coins that stopped trading

    If the history holds only the coins that still trade today, the test never buys the ones that collapsed and delisted. That is survivorship bias. A fair test picks from the coins that were tradable on each date.

  • Timestamps you can trust

    Each value needs the time it became known. A bar's close is known when the bar ends, a funding rate when it settles. Using either before then is look-ahead, and it makes a backtest look far better than live trading.

What Keel backtests on

  • Hyperliquid perpetuals

    Keel tests Hyperliquid's native crypto perps. It builds its price bars from every trade on the venue and applies the hourly funding Hyperliquid actually charged or paid.

  • Bar sizes

    Strategies run on 5-minute to daily bars, one size per strategy. Every size from 15 minutes up covers the whole history; 5-minute bars begin in March 2025.

  • History

    The majors reach back to mid-2024, and every other coin starts on the day it listed. The library backtests on this page run from Aug 2024 to Sep 2026.

  • Costs

    By default every fill pays a 4.5 bps fee and 4.5 bps of slippage, and you can raise either before a run.

  • Coins

    A strategy trades a fixed list of coins or the most traded perps by volume. The widest library strategy, Funding Carry (Cross-Sectional, Hyperliquid), traded 99 coins.

Per-coin coverage, with the date each series starts, is on the Hyperliquid data page.

Where else traders get crypto data

  • Exchange APIs and data portals

    Most exchanges publish candles and funding through their API, and some offer bulk downloads of past data. It costs nothing, but history depth and formats differ by venue, and API candle limits mean a long history has to be pulled in pieces.

  • Free CSV download sites

    Community sites post daily and hourly candles as spreadsheet files. They are fine for a first look. Check how each one handles gaps, timezones, symbol changes and coins that delisted.

  • Institutional data vendors

    Paid feeds with tick data, order books and symbols matched across many venues, built for funds and priced for them.

Whichever source you use, the cleaning is yours: gaps, renamed symbols, listings and delistings, and funding that settles on each venue's own schedule.

An example from the library

Leave out funding and you test a different strategy

One strategy from the Keel library, with and without the cost most crypto backtests skip.

Funding Carry (Cross-Sectional, Hyperliquid) ranks 99 Hyperliquid perps by their funding rate every day. It shorts the coins where longs pay the most to hold and buys the coins where shorts are paying, with the long and short sides the same size. Price moves on the two sides mostly cancel out. What is left is the funding.

Sharpe, price moves only
0.33
what a backtest without funding would show
Sharpe, with funding
1.39
the same trades, with every funding payment applied

A backtest that skipped funding would have thrown this strategy away. The same mistake runs the other way on a leveraged long trend strategy in a hot market, where longs pay funding for weeks and a price-only test flatters it. On perps, funding belongs in every backtest.

Configuration

Globalsconfig
target_timeframe1d
UniverseassetsTop by Volume · HL Perps · 100 assets99 resolved
Executionorders
rebalanceBufferedbuffer_threshold0.15buffer_moderelative+2
Pipeline8 steps
PriceDataLoaderData Loader
FundingDataLoaderData Loader
NegateTransformSignal Transform
EWMATransformSignal Transform
window10
CrossSectionalZScoreSignal Transform
ForecastScalerForecast Mapper
avg_abs_target10
ForecastCapperForecast Mapper
limit20
ForecastWeightNormalizerPosition Sizer
target_leverage1

The strategy as the Keel editor shows it. Price and funding data come in at the top, the funding signal is smoothed and ranked across every coin, and the last blocks size a balanced long and short book. Switch to Code to read it as text.

Single coin or portfolio

Crypto portfolio backtesting: test the book you hold

Both are useful. They answer different questions, and the portfolio is usually the one you trade.

One coin

  • Good for timing rules: a moving-average cross on BTC, an RSI dip-buy on ETH.
  • Few trades. A daily strategy on one coin might trade a few dozen times in two years, which is too few to tell skill from luck.
  • Tells you nothing about how it sits next to your other positions.

A portfolio

  • Good for ranking rules: buy the strongest coins and short the weakest, or collect funding across many coins at once.
  • Many more trades, spread across coins, so one lucky coin can't carry the result.
  • Shows the real risk: how correlated the positions are, how deep the combined drawdown goes, and what rebalancing costs.

The library shows the trade-off. MA Crossover (Golden Cross) Strategy trades 8 large coins and made 54 trades from Aug 2024 to Sep 2026. Its result may be fine, but that is too few trades to lean on, and its page says so. A strategy that ranks a wide list of coins makes hundreds of trades over the same dates.

Overfitting

The best backtest is usually the luckiest one

Try enough settings and one of them will look great on the past, by chance. Every extra filter, threshold and lookback you tune gives the backtest more room to fit noise. The tell is a result that only works at one exact value and falls apart next to it.

The Keel library tests each strategy across a grid of settings and shows the whole grid. Funding Carry (Cross-Sectional, Hyperliquid) was run 18 ways, and its Sharpe ranged from 1.18 to 1.62. The headline number is the default setting, not the top of that range. A spread that stays positive across the grid is worth more than any single run.

Two habits help. Keep the number of settings small, and judge the strategy on dates you didn't tune on: an out-of-sample test once, or a walk-forward test that repeats it through time. For the longer version, read overfitting in crypto backtests.

Reading the result

Five things to check before you trust a backtest

The return is the last number to look at.

The worst drawdown, and how long it lasted

Ask whether you would have kept running the strategy through it. Most people stop at the bottom.

The number of trades

A few dozen trades can't separate an edge from luck. Hundreds start to.

Where the return came from

Price moves or funding? One coin or many? Keel's report splits return into price and funding, and shows profit and loss by coin.

What costs took

Compare the fees paid with the profit. If costs eat most of it, a small rise in slippage wipes the strategy out.

Exposure over time

How much of the account was in the market, long and short. A balanced book and an all-in long book with the same return carry very different risk.

If you trade on Hyperliquid, read how Hyperliquid backtesting works in Keel for its markets, data and funding. For how the engine keeps a backtest and a live run on the same strategy, see how Keel works.

FAQ

Crypto backtesting questions

What is backtesting in crypto trading?

Backtesting is running a set of trading rules over past prices to see how they would have performed. In crypto that means using data from every hour of every day, charging exchange fees and slippage, and, for perpetual futures, adding the funding each position paid or received. The output is an equity curve, the drawdowns and the list of trades.

Can I backtest crypto strategies for free?

Yes. Keel's free plan includes 50 backtests a week with full reports, on the same data and engine as the paid plans, and lets you paper trade one strategy. Paid plans start at $29 a month and raise the limits. The library backtests at the top of this page are free to explore without an account. The pricing page has the details.

How much historical data do I need for a crypto backtest?

Enough to include different kinds of market, at least one strong rally and one deep sell-off, and enough trades to mean something. As a rough guide, aim for a hundred trades or more. A daily strategy on a few coins may need years to get there, while a strategy that ranks many coins gets there much faster. Newer coins have short histories, so a long test will often cover fewer coins in its early months.

Why do backtests look better than live trading?

Three usual reasons: costs were left out or set too low, the rules saw data they couldn't have had at the time, or the settings were tuned until the past looked good. Live trading also adds real fills and markets that change. Charge full costs, test on dates you didn't tune on, and paper trade before real money.

Should I backtest a single coin or a portfolio?

Test what you will trade. If you plan to run a rule on one coin, test that coin, but expect few trades and wide error bars. If you will hold several coins, test them together with your real sizing, because crypto coins tend to fall together and the combined drawdown is what you will live through.

Where can I get crypto backtesting data?

Exchanges publish price candles through their APIs, and perpetual futures venues publish funding history. Free download sites and paid data vendors fill in the rest. Collecting it yourself means handling gaps, listings and delistings, and funding that settles every hour. Keel has Hyperliquid's price and funding history built in, so you go straight to testing.

Can I backtest a crypto strategy without coding?

Yes. In Keel you build the strategy from blocks on a canvas, or describe it in plain words and let the AI build it for you. You can open every block and change its settings, and there is a code view if you prefer text.

How realistic is a Keel backtest?

It charges fees and slippage on every trade and applies Hyperliquid's real funding to every open position, and the strategy you test is the same one that runs live. It is still a simulation: fills are modelled, and the past doesn't predict the future. Hyperliquid's crypto perps are supported today. Stock and index perps are HIP-3 markets, and Keel doesn't support them yet. Support is coming soon.