What is backtesting?
By Oalgo · Last reviewed
Backtesting means running your rules on past prices, as if you had followed them at the time. You see where each trade would have opened and closed, and how the whole set of rules behaved over the period you chose.
How does a backtest work?
#- Pick a market, a timeframe and a date range.
- Write your rules: when to enter, when to exit, and how much to use each time.
- The test steps through the prices one candle at a time and applies your rules, using only the data that existed at that moment.
- At the end you get a backtest report and a chart of every simulated trade.
What does a backtest report show?
#| Number | What it tells you |
|---|---|
| Trades | How many times your rules entered and exited. |
| Win rate | The share of trades that ended above their starting value, after fees. |
| Drawdown | The largest fall from a high point before a new high was reached. |
| Fees | What the trades would have cost, so the numbers stay realistic. |
What a backtest cannot tell you
#- The past does not repeat exactly. Rules that behaved well before can behave badly later.
- Rules tuned too closely to one period, called overfitting, often fail on the next one. Test on more than one date range.
- Real fills can differ from the test, especially when prices move fast.
That is why the next step is a forward test: the same rules on new prices, as they arrive.
In Oalgo you can test your idea without writing code: tell Oalgo AI your idea in your own words, check the rules it builds, then run the backtest. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.
Read next
- What is forward testing?Forward testing runs your rules on new prices as they arrive, with simulated funds only. Learn how it differs from a backtest and when to use it.
- How to backtest a trading strategy without codingBacktest a trading strategy without coding: tell Oalgo AI your idea, check the rules it builds, then test them on past and new prices. A step-by-step guide.