ការធ្វើ Backtest យុទ្ធសាស្ត្រ
ស្វាគមន៍មកកាន់មេរៀន «ការធ្វើ Backtest យុទ្ធសាស្ត្រ»! នៅក្នុងមេរៀននេះ យើងនឹងសិក្សាអំពីវិធីធ្វើ Backtest ដែលជាដំណាក់កាលសំខាន់បំផុតមួយក្នុងការពិនិត្យយុទ្ធសាស្ត្រជួញដូរមុននឹងប្រេីប្រាស់ប្រាក់ពិត។ Backtest គឺជាការដាក់យុទ្ធសាស្ត្ររបស់អ្នកទៅលើទិន្នន័យប្រវត្តិ ដើម្បីមើលថាតើវាបានដំណើរការយ៉ាងណាក្នុងអតីតកាល។ នេះជាការការពារទ្រព្យរបស់អ្នក និងការបង្កើតទំនុកចិត្តមុនពេលចូលទីផ្សារជាក់ស្ដែង។
Welcome to the 'Backtesting a Strategy' lesson! In this lesson, we will learn about backtesting — one of the most critical steps in validating a trading strategy before risking real money. Backtesting is the process of applying your trading rules to historical data to see how they would have performed in the past. It protects your capital and builds confidence before entering live markets.
Backtesting គឺជាដំណើរការដាក់យុទ្ធសាស្ត្រជួញដូរទៅលើទិន្នន័យប្រវត្តិ (Historical Data) ដើម្បីវាស់ស្ទង់ថាតើវាបានដំណើរការយ៉ាងណាក្នុងអតីតកាល。 វាដូចជា Flight Simulator សម្រាប់អ្នកជួញដូរ — អ្នកអាចធ្វើកំហុស កែលម្អវិធីជួញដូរ និងបង្កើតទំនុកចិត្ត ដោយមិនចាំបាច់ដាក់ប្រាក់ពិត។ ការធ្វើ Backtest ដែលមានគុណភាពល្អ មិនធានាផលចំណេញនាពេលអនាគតទេ ប៉ុន្តែវានឹងបង្ហាញយ៉ាងឆាប់រហ័សពីគោលគំនិតដែលមិនដំណើរការ។
Backtesting is the process of applying your trading rules to historical market data to evaluate how they would have performed in the past. It is like a flight simulator for traders — you can make mistakes, refine your approach, and build confidence without risking real capital. A quality backtest does not guarantee future profits, but it will quickly expose ideas that were never going to work.
ក្រោយពេលធ្វើ Backtest រួច កុំគ្រាន់តែមើលតែ Total Net Profit! ត្រូវពិនិត្យមើល Metrics សំខាន់ៗទាំងនេះ៖
After backtesting, do not just look at Total Net Profit! Review these key metrics:
• Win Rate 45% (Loss Rate 55%)
• ឈ្នះជាមធ្យម $150
• ចាញ់ជាមធ្យម $70
Expectancy = (0.45 × $150) − (0.55 × $70) = $67.50 − $38.50 = $29 ក្នុងមួយ Trade
ទោះបីចាញ់ច្រើនជាងឈ្នះក៏ដោយ ប្រព័ន្ធនេះនៅតែរកចំណេញ $29 ជាមធ្យមក្នុងរាល់ Trade មួយៗ។
• Win rate 45% (loss rate 55%)
• Average win $150
• Average loss $70
Expectancy = (0.45 × $150) − (0.55 × $70) = $67.50 − $38.50 = $29 per trade
Even though it loses more often than it wins, this system still makes about $29 on average every time you trade.
Optimization គឺជាការឱ្យ MT5 ដើរក្នុងបញ្ជីតម្លៃផ្សេងៗគ្នានៃប៉ារ៉ាម៉ែត្រ (ឧទាហរណ៍ Stop Loss, Take Profit, Period របស់ MA) ដើម្បីរកឃើញកំណត់ត្រាដែលផ្តល់លទ្ធផលល្អបំផុត។ វាមានប្រយោជន៏ ប៉ុន្តែអាចបង្កើត Overfitting (Curve Fitting) ប្រសិនបើប្រេីប្រាស់មិនប្រុងប្រយ័ត្ន។
Optimization is the process of letting MT5 run through different parameter values (e.g., Stop Loss, Take Profit, MA period) to find the setting that produces the best results. It is useful but can create overfitting (curve fitting) if used carelessly.
វិធីការពារ៖
១. ប្រេី Forward Testing (ទិន្នន័យថ្មីដែលមិនបានប្រេីក្នុង Optimization)
២. Optimize តែមួយប៉ារ៉ាម៉ែត្រក្នុងមួយលើក
៣. ជ្រើសរើសលទ្ធផលដែលមាន Equity Curve រលុង (Smooth) មិនមែនតែប្រាក់ចំណេញខ្ពស់បំផុត
Prevention:
1. Use Forward Testing (new data not used in optimization)
2. Optimize only one parameter at a time
3. Choose results with a smooth equity curve, not just maximum profit
២. Look-Ahead Bias — ប្រេីព័ត៌មានដែលមិនទាន់មាននៅពេល Trade (ឧទាហរណ៍៖ ប្រេី Indicator ដែល repaint)
៣. Survivorship Bias — ធ្វើតេស្តតែលើភាគហ៊ុន/គូររូបិយប័ណ្ណដែលនៅរស់ (មិនរាប់បញ្ចូលអ្នកដែលបានលុបចេញ)
៤. មិនរាប់បញ្ចូល Spread និង Slippage — ការធ្វើ Backtest ដ៏ល្អអាចបង្ហាញចំណេញ ប៉ុន្តែពិតទៅគ្មានប្រាក់ចំណេញទេប្រសិនបើគិតពីការចំណាយទាំងនេះ
៥. គម្បីទិន្នន័យ (Data Snooping) — ធ្វើ Backtest ច្រើនលើកលើទិន្នន័យដូចគ្នា រហូតដល់រកឃើញយុទ្ធសាស្ត្រដែល"កាល់"លើទិន្នន័យនោះ
2. Look-Ahead Bias — using information not available at the time of the trade (e.g., using repainting indicators)
3. Survivorship Bias — testing only on surviving stocks/pairs (not including those that were delisted)
4. Not including Spread and Slippage — a great backtest may show profit, but actually has none after costs
5. Data Snooping — backtesting repeatedly on the same data until finding a strategy that 'happens' to work on that data
២. ប្រេប្រាស់ Walk-Forward Analysis — បែងចែកទិន្នន័យជាច្រើនផ្នែក ធ្វើ Backtest លើផ្នែកមួយ ហើយផ្ទៀងផ្ទាត់លើផ្នែកផ្សេង
៣. ប្រេីប្រាស់ Monte Carlo Simulation — ធ្វើការច្របាច់លំដាប់ Trade ឡើងវិញច្រើនដង ដើម្បីពិនិត្យ Drawdown ក្នុងស្ថានភាពអាក្រក់បំផុត
៤. កត់ត្រារាល់ Backtest ក្នុង Trading Journal ដើម្បីតាមដានការវិវត្តន៍របស់យុទ្ធសាស្ត្រ
2. Use Walk-Forward Analysis — split data into multiple parts, backtest on one part, validate on another
3. Use Monte Carlo Simulation — reshuffle trade sequences many times to test drawdown under worst-case scenarios
4. Record every backtest in a Trading Journal to track strategy evolution
រយៈពេល Backtest មិនមែនជាគោលដៅទេ — គោលដៅគឺចំនួន Trade និងភាពចម្រុះនៃស្ថានភាពទីផ្សារ។ តារាងខាងក្រោមបង្ហាញការណែនាំ៖
Backtesting duration is not the goal — the goal is the number of trades and diversity of market conditions. The table below shows recommendations:
| រចនាសទីផ្សារTrading Style | TimeframeTimeframe | រយៈពេលណែនាំSuggested Duration | ចំនួន Trade គោលដៅTarget Trades |
|---|---|---|---|
| ScalpingScalping | M1 – M5M1 – M5 | 3 – 12 ខែ3 – 12 months | 200+200+ |
| Day TradingDay Trading | M15 – H1M15 – H1 | 1 – 2 ឆ្នាំ1 – 2 years | 150+150+ |
| Swing TradingSwing Trading | H4 – DailyH4 – Daily | 3 – 5 ឆ្នាំ3 – 5 years | 100+100+ |
| Position TradingPosition Trading | Daily – WeeklyDaily – Weekly | 5 – 10 ឆ្នាំ5 – 10 years | 100+100+ |
Backtest លើទិន្នន័យប្រវត្តិមិនគ្រប់គ្រាន់ទេ។ យុទ្ធសាស្ត្រដែលល្អត្រូវតែឆ្លងកាត់ Forward Testing — ការដាក់វាទៅលើទីផ្សារជាក់ស្ដែង (ឬគណនី Demo) ដោយមិនបានប្រេីប្រាស់ក្នុងការបង្កើតវា។
Backtesting on historical data is not enough. A good strategy must pass forward testing — placing it in a live market (or demo account) without having used that data in its creation.