🔬 Cách Backtest Chiến Lược Trading — Vnstock + AmiBroker

Backtest là kiểm tra chiến lược trên historical data trước khi dùng real money. Backtest tốt = saving thousands of dollars from bad strategies.

Backtest là gì?

Simulate strategy trên past data. Ví dụ: "Mua khi RSI < 30, bán khi RSI > 70" — backtest 5 năm VN30 → biết được profit factor, max drawdown, win rate.

Metrics quan trọng

1) Total Return: Lãi tổng %. 2) CAGR: Compound annual growth rate. 3) Sharpe Ratio: Risk-adjusted return (xem calculator). 4) Max Drawdown: Mất nhiều nhất từ peak. 5) Win Rate: % trades thắng. 6) Profit Factor: Total wins / Total losses.

Vnstock Backtest (Free, 5 năm)

1) Vào vnstock.io.vn/app → tab "Backtest". 2) Chọn ticker + timeframe. 3) Pick template strategy (RSI cross, MACD cross, Breakout, etc.) hoặc viết AFL custom. 4) Run → 0.3s. 5) Xem equity curve + metrics + trades log.

AmiBroker (Pro)

$279 one-time. AFL (AmiBroker Formula Language) cực mạnh, customize sâu. Import data VN cần thủ công. Phù hợp serious quant.

Tránh Overfitting

Backtest quá fit data lịch sử = không hoạt động future. Rules: 1) Out-of-sample test (giữ 30% data để test sau). 2) Strategy đơn giản (< 5 parameters). 3) Test trên nhiều mã, nhiều thời kỳ. 4) Robust to small changes (±10% parameter không break strategy).

Strategies common

1) Trend-following: Buy MA50 cross MA200. 2) Mean-reversion: Buy RSI < 30 + Bollinger Lower. 3) Breakout: Buy 20-day high + volume > 1.5x. 4) Momentum: Buy top 10 score AI weekly. Each có pros/cons riêng.

Vnstock AFL Community

Vnstock có "AFL Community" — share + fork scripts. Top contributors có 50+ scripts. Download → backtest → fork để customize. Tất cả free.

🚀 Bắt Đầu Với Vnstock App

📚 Hướng dẫn liên quan

📈 Cách Đọc Xu Hướng Thị Trường — Bull, Bear, Sidew