Ready to go further
Next: test without fooling yourself
The backtesting guide covers realistic costs, untouched data and what a test cannot show.
What is included
- What it is, in plain words
- The formula or mechanism, with exact arithmetic
- How it hits grid, martingale and DCA bots
- A check you can run before you switch a bot on
Who it is for
- People who run or plan to run a trading bot
- Anyone reading a backtest or a bot sales page
- Readers who want the numbers, not the pitch
- Not advice, and not a signal service
Key facts
- Freqtrade is a free, open source crypto trading bot written in Python, where you describe a strategy in code and the bot runs it. Read its own current documentation for what it supports.
- Bots of this kind usually offer a staged route: test on past data, run on live prices without real orders, then trade a small real size. The stages exist because each one catches a different kind of mistake.
- Trying many settings finds luck. If each setting with no edge has a made-up 5 percent chance of looking good, trying 20 gives 64.2 percent that at least one does (calculated by us on 31 Oct 2026, exact).
- Fees can erase a small edge: a made-up 100 trade run that averages +0.075 percent a trade before fees averages -0.125 percent after a 0.2 percent round trip.
- This page explains how something works and does not recommend it. We have not tested it for this page. Check the current terms.
What Freqtrade is
Freqtrade is open source software for running a crypto trading bot. The code is public and written in Python, and you describe your own strategy as code: when to buy, when to sell, and how to size and stop. It connects to exchanges through their interfaces, keeps records of trades and can test a strategy on past data. Related pages cover the ideas it relies on: Python trading bot and open source crypto trading bot.
We have not installed or run it for this page, and we did not read its current documentation. Which exchanges it supports, which commands it has and how it is configured are things to read there. Nothing here describes a particular version.
The staged route
Most bots of this type offer the same three steps, usually under names such as backtesting, dry run (also called paper trading) and live. Check the documentation for the names it uses.
- Test on past data. The bot replays old prices and applies the strategy. It finds coding mistakes and shows how the rule behaved on that history. It does not show the future. See backtesting.
- Run without real orders. The bot reads live prices and records the orders it would have placed. It checks the plumbing on new data. It cannot show real fills. See paper trading.
- Trade a very small real size. Real fills, real fees and real delays appear. Compare each one with what the earlier stages expected.
Where strategies go wrong
- Costs left out. Fees and the spread are subtracted from every trade, and a small average edge can vanish.
- Peeking. A rule that uses data it could not have had at that moment looks perfect on the past. See look-ahead bias.
- Too many tries. Settings tuned on the same history until the result looks good are fitted to that history. See overfitting.
- A short test. A few dozen trades in one market mood show little.
Worked example: how many tries find luck
Many bots can search for good settings, trying many combinations on the same past data. Here is the arithmetic of why that is dangerous. Suppose every setting you try has no real edge, and each has a made-up 5 percent chance of looking good on the history by luck. The chance that none of N tries looks good is 0.95 to the power N, so the chance that at least one does is one minus that.
| Settings tried | Chance none looks good | Chance at least one looks good |
|---|---|---|
| 1 | 95.0% | 5.0% |
| 10 | 59.9% | 40.1% |
| 20 | 35.8% | 64.2% |
| 50 | 7.7% | 92.3% |
Calculated by us on 31 Oct 2026, exact for the made-up 5 percent. After 50 tries, a good looking result is close to certain even when nothing real is there, so a good looking result from a search shows little. The real chance for a setting is not known. The method is what matters: the more you try, the less a good result means. The remedy is to keep data the search never saw, and to test the single chosen setting on it once. See walk-forward testing.
Worked example: fees against a small edge
A made-up run of 100 trades: 45 wins of 2 percent and 55 losses of 1.5 percent. Before fees that is (45 times 2 minus 55 times 1.5) divided by 100, which is +0.075 percent a trade. A made-up fee of 0.1 percent each side costs 0.2 percent a round trip, so the result after fees is -0.125 percent a trade. The same rule that looked slightly positive loses once the fee is counted.
How to check a Freqtrade style setup
- Confirm that fees and spread are set in the test to the amounts of your own account.
- Count how many settings you tried, and keep a final stretch of data that no search touched.
- Run the dry stage for weeks on live prices and compare its trades with what the test said it would do.
- Give the bot a key with no withdrawal permission, keep the key out of the code and out of any shared place, and start with a very small size.
- Read the strategy file you run. A strategy copied from someone else is code you did not write.
How a bot like this fails when live
- Regime change. A rule that suited the past market stops suiting the present one.
- Silent errors. A bot that is not watched can stop trading, keep a stale position or repeat an order.
- Updates. New versions of the software or changes at the exchange can break a setup that used to work. Keep the version you tested and test again before changing it.
- Leverage and shorts. If the bot trades borrowed exposure, the forced close can come before any stop. See liquidation price calculator.
What this page does not tell you
It does not say that Freqtrade or any strategy makes money, how well it works or which exchanges it supports. The 5 percent chance, the trade results and the fee are made up to show arithmetic. It is education, not advice.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is Freqtrade?
It is a free, open source crypto trading bot written in Python, where you write a strategy as code. Read its current documentation for what it supports.
Is a dry run the same as live trading?
No. A dry run uses live prices without real orders, so it cannot show real fills, fees or delays. It is a step between a backtest and a small live size.
Why not just tune the settings until the backtest looks good?
Each extra try raises the chance that luck alone gives a good looking result. Keep untouched data and test the chosen setting on it once.
Do fees matter in a backtest?
Yes. A small average edge can turn negative after fees, so use the fee and spread of your own account.
Can I run someone else's strategy?
You can, and it is code you did not write. Read it, test it in stages and give the bot a key with no withdrawal permission.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It explains how an open source bot is tested, using made-up numbers. It does not recommend any software, strategy or venue.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss