Pine Node Editor
Home Tutorial Guides Pricing
Add to Chrome
Guide

Can I trust this backtest?

Telling a real edge from a lucky fit.

If almost every simple strategy you try ends up profitable after some tuning, be suspicious. The strategies generated by Pine Node Editor don't look into the future: signals use closed bars, entries fill on the next bar's open, commission and slippage are included, and higher-timeframe data always comes from the last completed bar. The usual causes of a too-good backtest are elsewhere.

Common reasons a backtest looks better than reality

Tuning on the same data you judge

Adjusting parameters until the result turns green finds settings that fit this stretch of history. They often stop working on new data. This is the most common trap.

The market went one way

Long-only strategies look great while the market rises. Compare with Buy & Hold in the Strategy Tester: if simply holding did better, the strategy didn't add much.

Too few trades

Twenty profitable trades can be luck. Look at the trade count before the profit.

What happens inside a bar

The backtester doesn't know the real price path inside a bar. When take-profit and stop-loss fall in the same bar it assumes an order, and tight trailing stops tend to look better than they will live. TradingView's Bar Magnifier (paid plans) uses lower-timeframe data to reduce this.

Quick checks (free plan friendly)

  1. Hold some data back. In the Strategy Settings node, enable Limit backtest dates, tune on the first part of the history only, then test the unchanged settings on the rest. This works on any TradingView plan: the dates are part of the strategy's code. (The date range picker in TradingView's own Strategy Tester is Deep Backtesting, a paid-plan feature.)
  2. Try other symbols and timeframes with the same settings.
  3. Try a falling market. Pick a pair that dropped over the period. A trend filter should mostly stay out instead of losing heavily.
  4. Need more history? Without Deep Backtesting, the backtest runs on the bars loaded on the chart, and the plan limits how many bars that is, not how many years. The same logic on a daily chart (with a weekly higher-timeframe filter) therefore covers several years, including bear markets, where a 15-minute chart covers only weeks.
  5. Make costs harsher. Raise slippage to a few ticks and avoid very tight trailing stops. A result that collapses was living on the backtester's assumptions.
  6. Forward-test. Let the strategy run on live data — on paper or with a minimal size — before trusting it with real money.

Compare with buy & hold, fairly

A strategy that is in a long most of the time will show a big profit in any rising market: that's the market, not the strategy. Two places in TradingView's Strategy Tester show what simply buying and holding would have done:

  • the Buy and hold line on the performance chart (the eye icon next to it switches it on);
  • the Buy & hold return row in the metrics table, next to Net profit and Max drawdown.

Make the sizes match first. Buy & hold puts the whole capital in once, while a strategy from the editor enters with 10% of equity by default, so its profit is naturally about ten times smaller even when it trades well. For a fair comparison set Position size to 100 (% of equity) in the Strategy Settings node, or scale the result in your head.

Then read it plainly: clearly above buy & hold with a similar or smaller drawdown is worth a closer look; about the same or below means the strategy mostly rode the market; below in profit but with a much smaller drawdown can still be useful, as a way to take less risk. A condition that is always true (the editor marks it in amber) turns a strategy into exactly this kind of always-in-the-market baseline.

Check that a higher-timeframe filter isn't peeking

Connect a Plot node to the Higher Timeframe node's output and look at a lower timeframe. A 4H value on a 15m chart should stay flat for 16 bars and change only when a new 4H bar opens. That's how you can see it uses completed bars only.

Past results don't guarantee future performance. Pine Node Editor generates code from the logic you define; it doesn't give trading advice.

More guides: all guides · step-by-step tutorial · what's new

© Pine Node Editor. All rights reserved.
Guides Changelog Privacy Policy Terms of Service Contact