What is Backtesting?
Backtesting is a process of testing and evaluating a trading strategy on historical data, allowing traders to assess the performance of the strategy in the past. This article will discuss the definition of backtesting, its importance, and how to conduct backtesting correctly.
The Importance of Backtesting
- Benchmarking the System: Provides value to the trading system to determine its probability and profitability.
- Risk-Free Practice: Backtesting allows for risk-free financial practice, helping to improve trading skills.
- Confidence Building: Evaluates and enhances confidence in the trading system by examining performance statistics such as win:loss ratio, drawdown, and edge.
Benefits of Backtesting
- Benchmarking the System: Evaluates the probability and profitability levels of the trading system.
- Risk-Free Practice: Improves trading skills without financial risk.
- Confidence Building: Strengthens confidence in the trading system through statistical performance analysis.
Measuring Performance: Edge
The Edge ratio is calculated using the formula:
Edge = (PW × AW) - (PL × AL)
Where:
PW = Percentage Win, AW = Average Win
PL = Percentage Lose, AL = Average Loss
Types of Backtesting
1. Manual Backtesting:
- Pros: Simple, does not require additional tools.
- Cons: Time-consuming, requires high discipline.
2. Automated Backtesting (Expert Advisor/EA):
- Pros: Fast, emotion-free, can generate income without presence.
- Cons: Difficult programming, expensive if purchased.
3. Semi-Automated Backtesting (ForexTester):
- Pros: Real-market experience, practice for eyes and hand muscles.
- Cons: Requires specific tools, time-consuming, not suitable for all trading systems.
Steps for Backtesting
- Prepare Excel File: Record important parameters for Edge calculation.
- Perform Backtest: Record every trading position and its key parameters.
- Analyze Results: Use the Edge formula to evaluate the performance of the trading system.
Example of Simple Backtest
Trading System:
- Timeframe: 5 minutes
- Indicator: Candlestick
- Signal: Pinbar
- Risk: Reward: 1:2
- Pair: Major
- Stop Loss: 1 pip + pinbar tail
Backtest Results:
- Edge: 3.32
- Win Rate Ratio: 60:40
- Maximum Loss: 4 consecutive losses
- Maximum Win: 6 consecutive wins