Panduan Backtesting

Percuma 7 min bacaanPelajaran 45 / 67

Pengenalan

Backtesting adalah proses menguji trading strategy anda menggunakan data historical. Sebelum risk real money, test dulu!

"Would you drive a car without testing it first? Then why trade a strategy without testing?"


Apa Itu Backtesting?

Definisi

Backtesting = Applying your trading rules to historical data to see how they would have performed.

Why Backtest?

Without BacktestingWith Backtesting
Hope strategy worksKnow strategy works
Discover flaws with real moneyDiscover flaws for free
No confidenceBuild confidence
Random expectationData-driven expectation

Types of Backtesting

1. Manual Backtesting

Process:

  • Scroll back in charts
  • Find setups manually
  • Record hypothetical trades
  • Calculate statistics

Pros:

  • Free
  • Learn price action deeply
  • Build intuition

Cons:

  • Time-consuming
  • Prone to bias
  • Can miss setups

2. Automated Backtesting

Process:

  • Code your strategy
  • Run on historical data
  • Get instant results

Pros:

  • Fast
  • Objective
  • Large sample sizes

Cons:

  • Need coding skill
  • Requires quality data
  • May over-optimize

For Most FCPO Traders: Manual

Start with manual backtesting:

  • No coding needed
  • Learn market behavior
  • Affordable (free)
  • Good enough for most strategies

Manual Backtesting Process

Step 1: Define Your Strategy

Write down clear rules:

Strategy: RBS Entry
Timeframe: 1H
Entry: Long when price retests broken resistance
Confirmation: Bullish candle at level
SL: Below the level (15-20 ticks)
TP: Next resistance or 30 ticks

Step 2: Choose Timeframe for Test

Recommended:

  • Minimum 3 months of data
  • Better: 6-12 months
  • Must include different market conditions (trending, ranging)

Step 3: Set Up Your Recording

Create spreadsheet with:

ColumnData
DateWhen trade occurred
SetupWhich setup triggered
EntryEntry price
SLStop loss price
TPTake profit price
ResultWin/Loss
P&LProfit or loss in ticks
NotesObservations

Step 4: Scroll and Find Setups

Process:

  1. Go to starting date
  2. Scroll forward candle by candle
  3. When setup appears, record it
  4. Note if SL or TP hit
  5. Continue to end

IMPORTANT: Don't peek ahead! Only trade what you would have seen in real-time.

Step 5: Calculate Statistics

After completing all trades:

Total trades: ___
Winners: ___
Losers: ___
Win rate: ____%
Total ticks: ___
Average win: ___ ticks
Average loss: ___ ticks
Largest win: ___ ticks
Largest loss: ___ ticks
Max consecutive losses: ___
Profit factor: Total wins / Total losses

Backtesting Example

Strategy: 20 EMA Bounce

Rules:

  • Timeframe: 1H
  • Entry: Bounce off 20 EMA in uptrend
  • Confirmation: Bullish candle at EMA
  • SL: Below EMA (15 ticks)
  • TP: 30 ticks

Backtest Period: October 2025

Sample trades:

DateEntrySLTPResultTicks
Oct 34,2204,2054,250Win+30
Oct 54,2454,2304,275Loss-15
Oct 84,2604,2454,290Win+30
Oct 124,2354,2204,265Win+30
Oct 154,2804,2654,310Loss-15
Oct 184,2504,2354,280Win+30
Oct 224,2904,2754,320Loss-15
Oct 254,2754,2604,305Win+30
Oct 284,3104,2954,340Win+30
Oct 304,2854,2704,315Loss-15

Results Analysis

Total trades: 10
Winners: 6
Losers: 4
Win rate: 60%

Total wins: 6 × 30 = +180 ticks
Total losses: 4 × 15 = -60 ticks
Net profit: +120 ticks

Average win: 30 ticks
Average loss: 15 ticks
RRR: 2:1

Profit factor: 180/60 = 3.0
Max consecutive losses: 2

CONCLUSION: Strategy is profitable in backtest ✓

Backtest Metrics to Track

Essential Metrics

MetricWhat It Tells You
Win rateHow often you win
Average winTypical winning trade
Average lossTypical losing trade
RRRRisk:Reward achieved
Profit factorGross win ÷ Gross loss
Max drawdownWorst period
Max consecutive lossesFor mental preparation

Good Benchmarks

MetricMinimumGoodExcellent
Win rate50%55-60%65%+
RRR1:1.51:21:3+
Profit factor1.21.5-2.02.5+

Red Flags

Don't trade strategy if:

  • Win rate below 40%
  • Profit factor below 1.0
  • Max consecutive losses > 7
  • Drawdown > 20% of capital

Common Backtesting Mistakes

Mistake 1: Hindsight Bias

Problem: "I would have known to skip that trade"

Reality: You wouldn't have known in real-time

Solution: Trade EVERY setup that meets criteria, don't cherry-pick

Mistake 2: Too Few Trades

Problem: "I tested 10 trades, looks good!"

Reality: 10 trades is not statistically significant

Solution: Minimum 50 trades, ideally 100+

Mistake 3: Curve Fitting

Problem: Adjusting rules to fit historical data perfectly

Reality: Over-optimized strategy fails in live trading

Solution: Keep rules simple, test on unseen data after

Mistake 4: Ignoring Costs

Problem: Backtest shows profit, but doesn't include commission

Reality: Commission eats into profit

Solution: Deduct RM 20 per trade from results

Mistake 5: Only Testing Good Markets

Problem: Only backtest trending periods

Reality: Market also ranges and chops

Solution: Include all market conditions in test period


Backtest to Live Trading

After Successful Backtest

Don't jump to live immediately!

Process:

  1. Backtest (3-6 months data) ✓
  2. Forward test (1-2 months paper trading)
  3. Small size live (50% normal size)
  4. Normal size live

Forward Testing

What is it: Paper trading the strategy in real-time

Why: Confirms backtest results hold in current market

Duration: Minimum 1 month, 20+ trades

Transition Checklist

Before going live:

  • Backtest shows profit over 50+ trades?
  • Forward test confirms results?
  • Commission included in calculations?
  • Comfortable with max drawdown?
  • Understand max consecutive losses?
  • Trading plan written based on results?

Backtest Recording Template

Trade Log

Date: ___________
Setup: ___________
Entry: ___________
SL: ___________
TP: ___________
Result: Win / Loss
P&L: ___________ ticks
Notes: ___________

Summary Statistics

PERIOD: _____ to _____

Total Trades: _____
Winners: _____
Losers: _____
Win Rate: _____%

Total Winning Ticks: _____
Total Losing Ticks: _____
Net Ticks: _____

Average Win: _____ ticks
Average Loss: _____ ticks
Actual RRR: _____

Profit Factor: _____
Max Consecutive Wins: _____
Max Consecutive Losses: _____
Max Drawdown: _____ ticks

PASS / FAIL: _____

Soalan Lazim (FAQ)

Q: "Berapa lama nak backtest?"

A: Minimum 3 months of data, 50+ trades. Better to have 6-12 months covering different market conditions.

Q: "Platform mana untuk backtest?"

A: TradingView (free) is excellent. You can scroll back historical FCPO data and manually mark trades.

Q: "Backtest profitable tapi live trading loss. Kenapa?"

A: Common reasons:

  • Hindsight bias in backtest
  • Emotions in live trading
  • Execution differences
  • Market conditions changed

Solution: More rigorous forward testing

Q: "Perlu coding untuk backtest?"

A: No. Manual backtesting is enough for most discretionary strategies. Only need coding for fully automated strategies.


Kesimpulan

Key Takeaways

ConceptRemember
WhatTest strategy on historical data
WhyValidate before risking money
HowManual scrolling + spreadsheet
Minimum50+ trades, 3+ months
AfterForward test before live
BewareHindsight bias, curve fitting

Your Action Items

  1. Write your strategy rules clearly
  2. Set up backtest spreadsheet
  3. Test minimum 3 months data
  4. Calculate statistics
  5. Forward test before live trading

"Every losing trader wishes they backtested. Every winning trader is glad they did. Which will you be?"

Pelajaran berkaitan — 6 · Pengurusan Risiko

Kembali ke senarai pelajaran
Sedia praktik? Buka akaun FCPO dengan remisier CGS & dapatkan bimbingan + dashboard analisis. Buka Akaun →

Pendidikan & analisis sahaja, bukan nasihat pelaburan. Dagangan niaga hadapan melibatkan risiko.

Amaran Risiko: Dagangan niaga hadapan (futures) melibatkan risiko kerugian yang tinggi dan tidak sesuai untuk semua pelabur. Kerugian boleh melebihi deposit margin asal anda. Prestasi lampau bukan jaminan prestasi masa hadapan. Kandungan di laman ini adalah untuk tujuan pendidikan dan maklumat sahaja, dan bukan nasihat pelaburan. Pastikan anda memahami sepenuhnya risiko yang terlibat sebelum berdagang, dan dapatkan nasihat profesional jika perlu.