# 回測

> 回測是指把一套交易策略放到歷史行情數據上運行，以估計它當時的表現。它給出的是「在已經發生過的條件下的行為估計」，而不是預測。回測的價值幾乎完全取決於它建模了什麼：一個忽略手續費、滑價和資金費的回測，並不是對實盤結果的保守估計——它測的根本是另一個策略。

Canonical HTML page: https://qanterion.com/zh-TW/glossary/backtesting
更新於: 2026-08-18
又稱: 歷史模擬, 策略回測

## 計算方式

```
A backtest is credible only when every one of these is modelled:
  · Fees, both sides, at the tier actually paid
  · Slippage, scaled to order size and market depth
  · Funding, for every interval a perpetual position was open
  · Fill realism — no filling at the close, the mid, or the signal price
  · Out-of-sample data the parameters were never fitted on
```

## 一份可信的回測必須包含什麼

按實際支付級距計算的交易手續費、隨訂單規模縮放的滑價、永續部位持有期間每一個結算週期的資金費，以及尊重實際可用流動性的成交邏輯——而不是直接按收盤價或中間價成交。上述每一項遺漏，都會把結果推向同一個方向：更好看。這就是為什麼一份不含摩擦成本的回測不只是不精確，而是系統性地錯誤。

## 樣本內的結果不構成證據

透過觀察一份資料集挑出來的參數，描述的就是那份資料集本身。一個策略必須在它從未擬合過的時間段上接受檢驗，它的數字才開始有意義；而即便如此，樣本裡也只包含碰巧發生過的那些市場狀態，這個集合遠比未來可能出現的要窄。

## 常見誤讀

回測經常被讀成預測。它只是對一份樣本中一條路徑的描述：同樣的規則、不同的資料，就會得到不同的結果。它報告的最大回撤是那份樣本內的最壞情況，因此是未來風險的下界，而不是上界。

## 動手算算看

- Sharpe ratio calculator: https://qanterion.com/zh-TW/tools/sharpe-ratio-calculator
- 破產機率計算器: https://qanterion.com/zh-TW/tools/risk-of-ruin-calculator

## 相關詞條

- 過度擬合: https://qanterion.com/zh-TW/glossary/overfitting
- 模擬交易: https://qanterion.com/zh-TW/glossary/paper-trading
- 滑價: https://qanterion.com/zh-TW/glossary/slippage

## 參考資料

- [Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance](https://www.ams.org/notices/201405/rnoti-p458.pdf) — American Mathematical Society (Notices of the AMS, Vol. 61 No. 5, 2014)
- [Interpretive Notice 9025 — Compliance Rule 2-29: Use of Promotional Material Containing Hypothetical Performance Results](https://www.nfa.futures.org/rulebooksql/rules.aspx?RuleID=9025&Section=9) — National Futures Association
- [The probability of backtest overfitting](https://doi.org/10.21314/JCF.2016.322) — Journal of Computational Finance (Risk Journals)

## Other languages

- English: https://qanterion.com/glossary/backtesting
- 简体中文: https://qanterion.com/zh/glossary/backtesting
- 繁體中文（香港）: https://qanterion.com/zh-HK/glossary/backtesting
- 日本語: https://qanterion.com/ja/glossary/backtesting
- 한국어: https://qanterion.com/ko/glossary/backtesting
- Português (Brasil): https://qanterion.com/pt-BR/glossary/backtesting
- Türkçe: https://qanterion.com/tr/glossary/backtesting
- Bahasa Indonesia: https://qanterion.com/id/glossary/backtesting
- العربية: https://qanterion.com/ar/glossary/backtesting

## Risk notice

本術語表用於教學。此處內容不構成投資建議，頁面所述任何指標都無法預測未來結果。