Nâng cao & AI Tooling · advanced · 6 phút
Best practices cho VN equity
#style
Defaults phù hợp với VN equity
| Indicator | Default |
|---|---|
| SMA | 20 (short), 50 (mid), 200 (long) |
| EMA | 12/26 (MACD-style) |
| RSI | 14 |
| ATR | 14 |
| Bollinger | 20×2.0 |
| Donchian | 20 |
| ADX | 14 |
Threshold quy ước
| Threshold | Giá trị |
|---|---|
| RSI hot | 70 |
| RSI cool | 30 |
| ADX trending | 25 |
| ATR% high vol | 4% |
| BB width squeeze | < 5% close |
Tên biến rõ ràng
✅ fast_ema, vol_thrust, is_trend_up ❌ x, tmp, a1
Comment ngắn
quanta
# Volume thrust = vol >= 1.5× tb 20 bar vol_thrust = market.volume >= 1.5 * rollmean(market.volume, 20)
KHÔNG comment hiển nhiên (# tính ema).
Không gọi indicator 2 lần cùng tham số
quanta
# ❌ tốn cpu when rsi(c, 14) > 70 and rsi(c, 14)[1] <= 70: ... # ✅ logics: r = rsi(c, 14) signals: when crossover(r, 70): ...
Khi muốn share lên marketplace
- Đặt tên
strategy "Tên ngắn gọn"kèm metadata header:
@regime "…", @style "…", @detail "…" (Trợ lý AI tự sinh khi tạo chiến lược mới).
- Mở
inputs:đầy đủ (đừng hardcode magic number tronglogics:). - Viết
rationalerõ — người dùng thấy ở UI. - Test qua backtest 5 năm + 3 ticker khác nhau.