Backtesting pitfalls

Five silent traps in a TradingView backtest

Five ways a TradingView strategy backtest can look better or different from what really happened, none of which shows an error, and what we do about each one.

10 October 2026 · 4 min read · All articles

A backtest that runs without an error message feels trustworthy. It shouldn't, not on that basis alone. Every trap below has caught us, or would have, and none of them shows a warning. Each one changes the trade list quietly, and the summary numbers follow.

1. The margin default that skips trades

In Pine Script version 6, a strategy's margin settings default to 100%. TradingView's own migration guide puts it plainly: "The strategy does not open entries that require more money than is available." No error, no log line. The entry simply doesn't happen.

Futures make this easy to trip over. One NQ futures contract controls far more than a typical test account's starting capital, so with the default settings many entries are skipped without a word.

It happened to us. One of our gold backtests showed 61 trades in 15 years. The margin default had silently skipped about 97% of its entries, and the few that remained were the odd days where the numbers happened to fit.

What we do: both strategies we offer set margin_long and margin_short to 0, and the first thing we check on any export is the trade count against what the rules should produce.

2. Slippage that never touches limit orders

TradingView lets you add slippage, a few ticks of worse price on each fill. It is easy to assume that covers everything. In our tests the setting moved market and stop fills, but never limit fills, which fits TradingView's rule that a limit order never fills at a worse price than its own.

That matters for any strategy that enters or takes profit with limit orders. Its backtest carries no slippage on those fills at all, however many ticks you set.

What we do: our entries and targets are limit orders, and each strategy page says so: limit fills in the backtest carry no slippage, stop-outs do.

3. A touch is not a fill

By default, a backtest fills a limit order the moment price touches its level. In a real market, touching your price doesn't mean you were filled: there may be a queue of orders ahead of yours, and price can turn away before it reaches you.

So a strategy that buys exactly at the low of a pullback looks better in the backtest than it can in practice. Pine Script has a setting that requires price to trade through the level by a few ticks before a limit counts as filled. It is worth running a test with it switched on, to see how much of the result depended on touches.

What we do: our pages describe the results as simulated fills, never as real ones. The forward record shows TradingView's simulated fills too, so it shares this assumption; the page says its fills are simulated. Real fills can be worse.

4. Inside one bar, TradingView has to guess

A backtest on 1-minute bars only knows each bar's open, high, low and close. If one bar touches both your stop and your target, which happened first? The backtest can't know, so it assumes. TradingView's documentation describes the rule: if the open is closer to the high, it assumes price went open, high, low, close; if it is closer to the low, open, low, high, close.

That guess decides whether some trades count as winners or losers. It matters less on a 1-minute chart, but a strategy with tight stops and targets can be scored on assumptions rather than prices. TradingView's Bar Magnifier fills orders using a lower timeframe's bars and narrows the guess.

What we do: both strategies run on 1-minute bars, which keeps each guess to a single minute of price. In October 2026 we re-ran both backtests with Bar Magnifier on and compared them trade by trade with the default runs over the dates both cover (mid-October 2023 to late September 2026). ICT22 Model: all 200 trades in that window identical. Midas Model: 361 of 362 identical; in the other, the target filled one tick away. The results on their strategy pages still come from the default runs. The other strategies on our Tested page were run with Bar Magnifier on.

5. Settings chosen on the same data you test on

Try 60 versions of a strategy and keep the best one, and the best one will look good partly by luck. The backtest that chose it can't tell you how much. This is the most common trap of all, because it doesn't feel like a mistake: it feels like optimisation.

The only real defence is data the settings never saw. Results after the settings were frozen, or trades taken forward in real time, tell you something the original backtest can't.

What we do: ICT22 Model's page shades the trades after its settings were fixed on 3 August 2026. Both strategies have been forward-tracked since 1 October 2026, with every trade on the forward record as it closes. And the bar every strategy has to pass was set in October 2026, after we had seen the results of the strategies we offer: the Tested page says so.

The short version

Before trusting a backtest, check five things: the trade count, how limit fills were priced, whether a touch counted as a fill, what happened inside single bars, and which data the settings were chosen on. None of them is visible in the headline numbers.

The tests every strategy has to pass before we offer it, and how many failed, are in The five tests a strategy has to pass, and why most fail. Every trade both strategies have taken since 1 October 2026 is on the forward record.