diff --git a/Experts/SimpleFVG/Config.mqh b/Experts/SimpleFVG/Config.mqh index 70ba0d7..4be31a4 100644 --- a/Experts/SimpleFVG/Config.mqh +++ b/Experts/SimpleFVG/Config.mqh @@ -25,7 +25,7 @@ input double InpFVGMaxOuterBarRatio = 2.0; //--- Step 3: Trading --- input bool InpTradeEnabled = true; input double InpRiskPercentPerR = 1.0; -input double InpRRRatio = 2.2; +input double InpRRRatio = 3.2; input int InpMaxLimitOrders = 3; input int InpLimitMaxAgeBars = 24; input long InpEAMagic = 123456; diff --git a/Experts/SimpleFVG/Drawing.mqh b/Experts/SimpleFVG/Drawing.mqh index 0b22491..cdb5a84 100644 --- a/Experts/SimpleFVG/Drawing.mqh +++ b/Experts/SimpleFVG/Drawing.mqh @@ -300,11 +300,15 @@ void DrawAll() } //+------------------------------------------------------------------+ -//| Clean up all drawn objects | +//| Clean up drawn objects (giữ lại PNL_STATS để xem kết quả sau test) | //+------------------------------------------------------------------+ void DrawCleanup() { - ObjectsDeleteAll(0, EA_PREFIX); + ObjectsDeleteAll(0, EA_PREFIX + "FVG_"); + ObjectsDeleteAll(0, EA_PREFIX + "ORD_"); + ObjectDelete(0, EA_PREFIX + "PNL_HDR"); + ObjectDelete(0, EA_PREFIX + "PNL_TREND"); + ObjectDelete(0, EA_PREFIX + "PNL_FVG"); ChartRedraw(0); } diff --git a/Experts/SimpleFVG/FVG.mqh b/Experts/SimpleFVG/FVG.mqh index 4bb5e36..59657c2 100644 --- a/Experts/SimpleFVG/FVG.mqh +++ b/Experts/SimpleFVG/FVG.mqh @@ -200,7 +200,7 @@ void ScanForNewFVGs() if(gapRatio >= minGapVsBody && !FVGAlreadyTracked(fvgTime, FVG_BULLISH)) { - double slRef = candleA_Low; // SL dưới bar A + double slRef = candleB_Low; // SL dưới bar B (impulse, dưới FVG) AddFVGZone(FVG_BULLISH, candleC_Low, candleA_High, slRef, fvgTime); } } @@ -215,7 +215,7 @@ void ScanForNewFVGs() if(gapRatio >= minGapVsBody && !FVGAlreadyTracked(fvgTime, FVG_BEARISH)) { - double slRef = candleA_High; // SL trên bar A + double slRef = candleB_High; // SL trên bar B (impulse, dưới FVG) AddFVGZone(FVG_BEARISH, candleA_Low, candleC_High, slRef, fvgTime); } } diff --git a/Experts/SimpleFVG/Trade.mqh b/Experts/SimpleFVG/Trade.mqh index ed05cf9..691f629 100644 --- a/Experts/SimpleFVG/Trade.mqh +++ b/Experts/SimpleFVG/Trade.mqh @@ -425,17 +425,17 @@ void ManageFVGTrades() ltfUpper, ltfLower, ltfBarALow, ltfBarAHigh)) continue; - // Entry theo low TF FVG; SL vẫn dùng bar A của high TF (đủ xa) + // Entry theo low TF FVG; SL = bar B của high TF FVG double entryPrice, slPrice; if(zone.type == FVG_BULLISH) { entryPrice = ltfUpper; // Buy limit tại cạnh trên low TF FVG - slPrice = zone.slReferencePrice; // SL dưới bar A của high TF FVG + slPrice = zone.slReferencePrice; // SL dưới bar B high TF } else { entryPrice = ltfLower; // Sell limit tại cạnh dưới low TF FVG - slPrice = zone.slReferencePrice; // SL trên bar A của high TF FVG + slPrice = zone.slReferencePrice; // SL trên bar B high TF } if(PlaceLimitFromLowTF(symbol, zone.type, entryPrice, slPrice))