Panduan Backtesting
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 Backtesting | With Backtesting |
|---|---|
| Hope strategy works | Know strategy works |
| Discover flaws with real money | Discover flaws for free |
| No confidence | Build confidence |
| Random expectation | Data-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:
| Column | Data |
|---|---|
| Date | When trade occurred |
| Setup | Which setup triggered |
| Entry | Entry price |
| SL | Stop loss price |
| TP | Take profit price |
| Result | Win/Loss |
| P&L | Profit or loss in ticks |
| Notes | Observations |
Step 4: Scroll and Find Setups
Process:
- Go to starting date
- Scroll forward candle by candle
- When setup appears, record it
- Note if SL or TP hit
- 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:
| Date | Entry | SL | TP | Result | Ticks |
|---|---|---|---|---|---|
| Oct 3 | 4,220 | 4,205 | 4,250 | Win | +30 |
| Oct 5 | 4,245 | 4,230 | 4,275 | Loss | -15 |
| Oct 8 | 4,260 | 4,245 | 4,290 | Win | +30 |
| Oct 12 | 4,235 | 4,220 | 4,265 | Win | +30 |
| Oct 15 | 4,280 | 4,265 | 4,310 | Loss | -15 |
| Oct 18 | 4,250 | 4,235 | 4,280 | Win | +30 |
| Oct 22 | 4,290 | 4,275 | 4,320 | Loss | -15 |
| Oct 25 | 4,275 | 4,260 | 4,305 | Win | +30 |
| Oct 28 | 4,310 | 4,295 | 4,340 | Win | +30 |
| Oct 30 | 4,285 | 4,270 | 4,315 | Loss | -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
| Metric | What It Tells You |
|---|---|
| Win rate | How often you win |
| Average win | Typical winning trade |
| Average loss | Typical losing trade |
| RRR | Risk:Reward achieved |
| Profit factor | Gross win ÷ Gross loss |
| Max drawdown | Worst period |
| Max consecutive losses | For mental preparation |
Good Benchmarks
| Metric | Minimum | Good | Excellent |
|---|---|---|---|
| Win rate | 50% | 55-60% | 65%+ |
| RRR | 1:1.5 | 1:2 | 1:3+ |
| Profit factor | 1.2 | 1.5-2.0 | 2.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:
- Backtest (3-6 months data) ✓
- Forward test (1-2 months paper trading)
- Small size live (50% normal size)
- 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
| Concept | Remember |
|---|---|
| What | Test strategy on historical data |
| Why | Validate before risking money |
| How | Manual scrolling + spreadsheet |
| Minimum | 50+ trades, 3+ months |
| After | Forward test before live |
| Beware | Hindsight bias, curve fitting |
Your Action Items
- Write your strategy rules clearly
- Set up backtest spreadsheet
- Test minimum 3 months data
- Calculate statistics
- 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
Pendidikan & analisis sahaja, bukan nasihat pelaburan. Dagangan niaga hadapan melibatkan risiko.