6 Settings to Check in a Backtest Engine Before You Trust Its Results

A trading strategy can look profitable in a backtest and still lose money in real markets. Small settings inside the testing engine can make results appear better than they should. Traders exploring QuantFarming should understand these settings before deciding whether a strategy deserves their confidence.

1. Check How the Engine Handles Trading Fees

A trading strategy can look profitable in a backtest, but the amount you actually earn may be quite different. Every time you buy or sell, your broker or exchange may charge a fee, and those charges can take a noticeable bite out of your profits. If the backtest doesn't include them, you might think the strategy makes more money than it really would.

Before running your test, check how the software handles trading fees. Some platforms let you enter a set dollar amount for each transaction, while others work out the fee as a percentage of the trade's value. Make sure you choose the setting that matches what your broker or exchange actually charges.

Trading fees become especially important when your strategy involves buying and selling frequently. Paying a small amount per transaction might not seem like much, but imagine paying that fee hundreds of times. Run the backtest with fees included, then without them, to see how much those charges eat into your potential profits.

2. Review the Slippage Settings

When you place a trade, you won't always get the exact price you were expecting. Prices can change in the seconds before your order goes through, especially when the market is moving quickly, or there aren't many people buying and selling. This difference is called slippage, and ignoring it during backtesting can make your strategy look more profitable than it really is.

Take a look at your backtesting software to see whether you can account for slippage. Some programs let you enter a fixed amount for each trade, while others estimate it based on market activity. The best option depends on what you're trading, how large your orders are, and when you usually place them.

For example, buying shares in a large company with plenty of trading activity may be easier than buying shares in a smaller company where fewer trades take place. You might also get a worse price than expected when important economic news comes out, and prices start moving rapidly. Try running your backtest with different slippage estimates to see how much your results change.

3. Examine the Historical Data Being Used

Even a well planned trading strategy can give you the wrong impression if the backtest uses faulty market data. A missing price, an incorrect date, or a gap in the records could make the program identify trades that weren't possible at the time. That's why it's worth checking the source of your data and looking for any missing information before relying on the results.

Take a look at the years your backtest includes, too. If you're only using data from a period when stocks were doing well, the strategy might appear more reliable than it actually is. Include some years when prices fell sharply, or the market was unpredictable, to see how the strategy would have performed during tougher times.

Stock splits and dividends are worth checking, too, because they can affect the prices shown in historical records. For instance, when a company splits its stock, the price of each share changes even though the split itself doesn't reduce the value of an investor's holdings. Make sure your backtesting software handles these changes properly so it doesn't treat them as ordinary price drops or gains.

4. Confirm When Orders Are Actually Executed

When a trade goes through can have a big effect on your backtest results. Some programs assume you can buy or sell as soon as a trading signal appears, even if that price wasn't actually available at the time. This can make the strategy look more successful than it would be if you were trading with real money.

Let's say your strategy tells you to buy a stock once a candle closes at a certain price. You wouldn't have known the final closing price while that candle was still forming, so the backtest shouldn't pretend you could have entered the trade earlier. Check whether the software places the order at the next candle's opening price or another price you could realistically have traded at.

You should also examine how the engine handles stop orders and limit orders. A price touching your limit does not always mean an order would have been filled. Realistic execution rules help prevent the backtest from counting trades that might never have happened.

5. Look at Position Sizing and Available Capital

Position sizing determines how much money the strategy puts into each trade. Some backtesting engines use a fixed investment amount, while others allocate a percentage of available capital. These settings can affect both potential profits and loss size.

Check whether the program allows profits to increase the amount available for future trades. This process, known as compounding, can produce very different results from using the same position size throughout. Make sure the calculation reflects how you would actually manage your trading account.

The engine should also account for cash that is already committed to open positions. A strategy cannot keep buying assets indefinitely without sufficient funds or permitted borrowing. Review leverage, margin requirements, and position limits to avoid testing an unrealistic trading approach.

6. Check for Lookahead Bias and Unrealistic Assumptions

A backtest can sometimes make use of information that a trader wouldn't have had at the time. Traders call this lookahead bias, and it can make a strategy seem far more profitable than it actually is. Imagine a program using the final closing price of a stock to decide whether to buy it earlier that same day, before anyone knew what the closing price would be.

Check that your trading indicators only use information that would have been available when each order was placed. Pay extra attention if your strategy combines different chart timeframes or uses indicators that calculate their final values after a candle closes. Even a small mistake in the timing can make a strategy look profitable when it wouldn't have worked that way in the market.

Another thing to watch for is how the software handles orders. Just because you want to buy or sell at a certain price doesn't mean there will always be someone willing to trade with you at that price. Your backtest should account for situations where orders are delayed, only partly filled, or never filled at all.

Final Thoughts

A backtest is more useful when it accounts for the costs, delays, and other challenges traders face in real markets. Before trusting the results, traders using QuantFarming should check these six settings to make sure the numbers reflect realistic trading conditions. No amount of testing can guarantee profits, but getting these details right can help you avoid making decisions based on results that look better than they should.

Scroll to Top