Đang tối ưu (Độ mở rộng hiện tại 10)

This commit is contained in:
Bell
2026-05-23 23:27:08 +07:00
parent 71677f804b
commit 104c2510dd
3 changed files with 41 additions and 20 deletions
+5 -3
View File
@@ -4,7 +4,7 @@
//| RSI×WMA45 + 5phase entry | ATR↑ EMA200 phiên | Limit 50% body |
//+------------------------------------------------------------------+
#property copyright "RsiMomentumEA"
#property version "4.22"
#property version "4.23"
#include <Trade/Trade.mqh>
#include <RsiMom/TradeJournal.mqh>
@@ -35,7 +35,7 @@ input double InpRSIOversold = 30.0; // RSI ≤ ngưỡng → bỏ SELL
input group "Entry 5 phase (mở rộng → cuộn EMA9 → EMA9 hướng → WMA45 phẳng → cắt gần)"
input bool InpPhaseFilterEnabled = true;
input int InpPhaseExpandLookback = 25; // P1: quét mở rộng 3 đường
input double InpPhaseMinExpandSpread = 8.0; // P1: min (WMA45-RSI) đơn vị RSI (buy)
input double InpPhaseMinExpandSpread = 10.0; // P1: min max(WMA45-RSI) pt RSI [tối ưu ~618, step 1]
input int InpPhaseCoilLookback = 12; // P2: quét cuộn trước nến tín hiệu
input int InpPhaseMinRsiEma9Cross = 2; // P2: RSI cắt EMA9 ≥ N lần (chống xuyên 1 lần)
input double InpPhaseCoilBand = 6.0; // P2: |RSI-EMA9| ≤ band = quanh EMA9
@@ -416,8 +416,10 @@ void Panel_UpdateStatus()
Panel_SetLine(ln++, "────────────────────────────────────", clrDarkGray);
Panel_SetLine(ln++, StringFormat("5 phase: %s | EMA200: %s (%d bar)",
Panel_SetLine(ln++, StringFormat("5 phase: %s P1>=%.1f LB%d | EMA200: %s (%d bar)",
Panel_FmtOnOff(InpPhaseFilterEnabled),
InpPhaseMinExpandSpread,
InpPhaseExpandLookback,
Panel_FmtOnOff(InpTrendFilterEnabled),
MathMax(1, InpTrendConfirmBars)),
InpPhaseFilterEnabled ? clrWhite : clrDimGray);
+20 -3
View File
@@ -139,7 +139,7 @@ Quét trên các nến **đã đóng** trong lookback: từ `shift+1` trở về
```
RSI[j] < EMA9[j] < WMA45[j]
spread[j] = WMA45[j] - RSI[j] → max(spread) >= InpPhaseMinExpandSpread (mặc định 8 điểm RSI)
spread[j] = WMA45[j] - RSI[j] → max(spread) >= InpPhaseMinExpandSpread (mặc định 10 điểm RSI)
```
**SELL:** `RSI[j] > EMA9[j] > WMA45[j]`, `spread = RSI[j] - WMA45[j]`.
@@ -411,7 +411,7 @@ EA **không** đọc file indicator. Indicator `Indicators/RsiMomentumIndicator`
| Input | Mặc định | Phase / vai trò |
|-------|----------|-----------------|
| `InpPhaseExpandLookback` | 25 | P1 |
| `InpPhaseMinExpandSpread` | 8.0 | P1 |
| `InpPhaseMinExpandSpread` | 10.0 | P1 — tối ưu edge (xem §15) |
| `InpPhaseCoilLookback` | 12 | P2 |
| `InpPhaseMinRsiEma9Cross` | 2 | P2 |
| `InpPhaseEma9SlopeBars` | 2 | P3 |
@@ -425,4 +425,21 @@ EA **không** đọc file indicator. Indicator `Indicators/RsiMomentumIndicator`
---
*Tài liệu đồng bộ với mã nguồn v4.14. P1P2 giữ nguyên; P3P5 đã nới lỏng mặc định.*
## 15. Tối ưu P1 — độ mở rộng (`InpPhaseMinExpandSpread`)
**Mục tiêu:** Lọc setup yếu — chỉ vào khi sóng trước đó đã giãn RSI↔WMA45 đủ lớn.
**Strategy Tester (MT5):**
1. Tab **Inputs** → chọn `InpPhaseMinExpandSpread` → bật **Optimization**.
2. Gợi ý: **Start** `6`, **Stop** `18`, **Step** `1` (XAU M5/M15; FX có thể thử 514).
3. Tiêu chí: **Profit Factor** hoặc **Custom max** (PF × sqrt(trades) nếu cần đủ mẫu).
4. So sánh **số lệnh** vs PF — ngưỡng quá cao → ít lệnh, overfit.
**Debug trên chart:** dấu SKIP hover hiển thị `P1:FAIL(sp=7.2<10.0)` = max spread tìm được trong lookback chưa đạt ngưỡng; `P1:OK(sp=12.4>=10.0)` = đạt.
**Panel:** dòng `5 phase` hiển thị `P1>=10.0 LB25`.
---
*Tài liệu đồng bộ với mã nguồn v4.23.*