Backtesting·

Backtesting Trading Strategies: How to Test Without Fooling Yourself

Backtesting is essential. It's also dangerous. Here's how to test strategies without falling into the curve-fitting trap.

My first backtest showed 400% annual returns.

I was going to be rich. Obviously.

Then I ran it live. Lost 30% in the first month.

What happened? I fooled myself. And I'm going to teach you how not to make the same mistake.

What Backtesting Is

Backtesting is simple: test your strategy on historical data to see how it would have performed.

If it worked in the past, maybe it'll work in the future. Right?

Sort of. But there are traps everywhere.

The Curve-Fitting Trap

This is the #1 backtest killer.

Curve fitting means optimizing your strategy to fit historical data so perfectly that it can't work on new data.

Here's how it happens:

  1. You create a strategy. It shows 50% returns.
  2. "What if I add this filter?" Now it shows 80% returns.
  3. "What if I tweak this parameter?" Now it shows 120% returns.
  4. "What if I exclude these bad trades?" Now it shows 200% returns.

Each tweak makes the backtest look better. But you're not improving the strategy. You're fitting it to past data.

The more you optimize, the worse it performs on new data.

How to Backtest Properly

Rule 1: Out-of-Sample Testing

Never test on the same data you used to develop the strategy.

Split your data:

  • In-sample (70%): Use this to develop the strategy
  • Out-of-sample (30%): Use this to validate

If the strategy works on out-of-sample data, it might be real. If it only works on in-sample data, it's curve-fitted.

Rule 2: Walk-Forward Analysis

Even better than simple out-of-sample testing.

  1. Develop strategy on data from 2020-2021
  2. Test on 2022 (out-of-sample)
  3. Re-optimize on 2020-2022
  4. Test on 2023 (out-of-sample)
  5. Repeat

This simulates how you'd actually use the strategy: develop, test, adjust, repeat.

Rule 3: Keep It Simple

The more parameters, the more curve-fitting risk.

A strategy with 3 parameters is more robust than one with 15.

If you need 15 conditions for a strategy to work, it's probably not a real edge.

Rule 4: Realistic Assumptions

Your backtest should include:

  • Trading fees: Usually 0.1% per trade
  • Slippage: 0.05-0.1% for liquid markets, more for illiquid
  • Spread: The bid-ask spread
  • Execution delay: You won't get the exact price you see

A strategy showing 30% returns with perfect execution might show 10% with realistic assumptions. Or negative.

Rule 5: Enough Trades

Statistical significance requires sample size.

A strategy with 10 trades isn't validated. It could be luck.

I want at least 100 trades in my backtest. Preferably 200+.

What to Look For in Backtest Results

Win Rate

What percentage of trades are winners?

50-60% is good for most strategies. Higher is suspicious (might be curve-fitted).

Profit Factor

Total profits divided by total losses.

Above 1.5 is good. Above 2.0 is excellent. Above 3.0 is suspicious.

Maximum Drawdown

The largest peak-to-trough decline.

This tells you the worst-case scenario. Can you stomach a 30% drawdown? 50%?

Sharpe Ratio

Risk-adjusted returns. Higher is better.

Above 1.0 is acceptable. Above 2.0 is good. Above 3.0 is suspicious.

Consistency

Are returns consistent across different periods? Or did one lucky month drive all the profits?

I look at monthly returns. I want to see consistent positive months, not one huge month and many losers.

Red Flags in Backtests

Red Flag 1: Too Good to Be True

500% annual returns with 5% drawdown? Nope.

Real strategies have realistic returns and real drawdowns. If it looks too good, it's curve-fitted.

Red Flag 2: Huge Variance

One month +50%, next month -30%, then +40%, then -25%.

This is noise, not edge. Real edges are more consistent.

Red Flag 3: Sensitive to Parameters

Change one parameter slightly and results collapse?

That's a fragile strategy. It won't survive real markets.

Red Flag 4: Only Works in One Market Condition

Amazing in 2021 bull market. Terrible in 2022 bear market.

The strategy is regime-dependent. It'll fail when conditions change.

Red Flag 5: Too Few Trades

20 trades over 3 years? Not enough data.

You need statistical significance. That requires volume.

My Backtesting Process

Here's my actual workflow:

Step 1: Hypothesis First

Before any testing, I have a hypothesis.

"Price tends to bounce at support levels, especially on the second touch."

This is based on market logic, not data mining.

Step 2: Simple Rules

I translate the hypothesis into simple, specific rules.

  • Price within 1% of support
  • Second or third touch
  • Bullish confirmation candle

Maximum 3-5 conditions. No more.

Step 3: Initial Backtest

Test on in-sample data. Does it make sense? Is there an edge?

I'm not looking for amazing returns. I'm looking for a positive expectancy.

Step 4: Out-of-Sample Validation

Test on data the strategy has never seen.

If it still works, proceed. If not, back to the drawing board.

Step 5: Realistic Assumptions

Add fees, slippage, spread. Does it still work?

Many strategies die at this step. That's okay. Better to know now.

Step 6: Paper Trading

Run the strategy in real-time with fake money.

This catches issues backtesting misses: execution problems, data issues, edge cases.

Step 7: Small Live Test

Real money, tiny size. Verify everything works.

Only after this do I scale up.

Backtesting Tools

What do I use?

For simple strategies:

  • TradingView's strategy tester
  • Spreadsheets with historical data

For complex strategies:

  • Python with pandas and backtrader
  • Custom scripts

For execution:

The tool matters less than the process. A simple spreadsheet backtest done correctly beats a sophisticated platform used incorrectly.

The Backtesting Mindset

Here's the mindset shift that changed everything:

Backtesting is not about finding profitable strategies. It's about eliminating unprofitable ones.

Most strategies don't work. Backtesting helps you discover this before losing real money.

When a backtest fails, that's a success. You learned something without losing money.

When a backtest succeeds, be skeptical. It might be curve-fitted. Validate thoroughly.

From Backtest to Live

The journey from backtest to live trading:

  1. Backtest: Does the logic make sense historically?
  2. Out-of-sample: Does it work on unseen data?
  3. Paper trade: Does it work in real-time?
  4. Small live: Does it work with real money?
  5. Scale: Gradually increase size

Each step filters out bad strategies. By the time you're trading real size, you have confidence.

dashpull helps with steps 3-5. Set up your conditions. Paper trade them. Go live with small size. Scale up.

The Bottom Line

Backtesting is essential. But it's also dangerous.

Done wrong, it gives you false confidence in strategies that will fail.

Done right, it filters out bad strategies and validates good ones.

The keys:

  • Out-of-sample testing
  • Simple strategies
  • Realistic assumptions
  • Enough trades
  • Skepticism about good results

dashpull helps me take validated strategies live. Conditions defined. Execution automated. Confidence earned through proper testing.

Don't fool yourself. Test properly. Then trade.


Ready to take your tested strategy live? Try dashpull