Quellcode durchsuchen

Ticket: 4468 Abs Touch Updation, Indicator & Fvg

Huzaifa-MQLDev vor 1 Jahr
Ursprung
Commit
16b85b0a43
2 geänderte Dateien mit 23 neuen und 6 gelöschten Zeilen
  1. BIN
      valFvgMt5.ex5
  2. 23 6
      valFvgMt5.mq5

BIN
valFvgMt5.ex5


+ 23 - 6
valFvgMt5.mq5

@@ -5,7 +5,7 @@
 //+------------------------------------------------------------------+
 #property copyright "Copyright 2025, MQL Development"
 #property link      "https://www.mqldevelopment.com/"
-#property version   "1.00"
+#property version   "1.1"
 #include <Trade\Trade.mqh>
 CTrade  trade;
 #resource "\\Indicators\\SequentialVolumeProfileWithFVG.ex5"
@@ -38,6 +38,13 @@ enum max_trades_option
    one_buy_sell,   // One Buy One Sell
   };
 
+enum abs_high_low_touch
+  {
+   disable_abs,       // Trade Normally
+   single_touch_abs,  // Disable Same Side Trading
+   both_touch_abs,    // Disable Both Side Trading
+  };
+
 sinput       string                  string_0                   = "<><><><><><> General SETTINGS <><><><><><>";   //__
 input        int                     magic_no                   = 333;             // Magic no
 input        tp_options              select_tp                  = zone_based;      // Select Tp
@@ -45,6 +52,7 @@ input        sl_options              select_sl                  = zone_based_sl;
 input        double                  stoploss                   = 4;               // FVG Third High/Low Stop Loss in Buffer
 input        double                  tpMultiplier               = 2;               // Take Profit Multiplier Risk to Reward
 input        max_trades_option       selectTradeCountOption     = one_trade;       // Select Max Trades at a Time
+input        abs_high_low_touch      selectAbsTouch             = single_touch_abs;// Action on Absolute Touch
 
 input        string                  string_0_3                 = "<><><><><><> Lot Management<><><><><><>";   //__
 input        double                  lot_size                   = 0.1;             // Lot Size
@@ -84,6 +92,11 @@ input        color                   BearishFVGColor            = clrDeepPink;
 input        double                  MinFVGSize                 = 0.0;              // Minimum FVG size in points (0 = any size)
 input        int                     MaxBarsBack                = 300;              // How many bars to look back for FVG
 
+input        string                  startHour                  = "23";             // Start Hour
+input        string                  startMin                   = "59";             // Start Minutes
+input        string                  endHour                    = "00";             // End Hour
+input        string                  endMin                     = "05";             // End Minutes
+
 
 
 // Global Variables
@@ -125,7 +138,11 @@ int OnInit()
                                 BullishFVGColor,
                                 BearishFVGColor,
                                 MinFVGSize,
-                                MaxBarsBack);
+                                MaxBarsBack,
+                                startHour,
+                                startMin,
+                                endHour,
+                                endMin);
 
 
 //---
@@ -176,7 +193,7 @@ void OnTick()
                if(((upper_price > absLow) && (lower_price > absLow)))
                   if(((upper_price > val) && (lower_price < val)) || ((upper_price < val) && (lower_price < val)))
                     {
-                     if(candleNotTouchingHigh(absLow, buy))
+                     if((selectAbsTouch == single_touch_abs && candleNotTouchingHigh(absLow, buy)) || (selectAbsTouch == both_touch_abs && candleNotTouchingHigh(absLow, buy) && candleNotTouchingHigh(absHigh, sell)) || (selectAbsTouch == disable_abs))
                        {
                         Print("Buy Trade. Val: ", val, "  Vah: ", vah, "  AbsHigh: ", absHigh, "  AbsLow: ", absLow);
                         placeBuyTrade();
@@ -195,7 +212,7 @@ void OnTick()
                if(((upper_price < absHigh) && (lower_price < absHigh)))
                   if(((upper_price > vah) && (lower_price < vah)) || ((upper_price > vah) && (lower_price > vah)))
                     {
-                     if(candleNotTouchingHigh(absHigh, sell))
+                     if((selectAbsTouch == single_touch_abs && candleNotTouchingHigh(absHigh, sell)) || (selectAbsTouch == both_touch_abs && candleNotTouchingHigh(absLow, buy) && candleNotTouchingHigh(absHigh, sell)) || (selectAbsTouch == disable_abs))
                        {
                         Print("Sell Trade. Val: ", val, "  Vah: ", vah, "  AbsHigh: ", absHigh, "  AbsLow: ", absLow);
                         placeSellTrade();
@@ -511,7 +528,7 @@ string check_bearish_bullish()
 string fvg_gap()
   {
 //Print("Imbalance: ");
-   if(check_bearish_bullish() == previousBullish)
+ //  if(check_bearish_bullish() == previousBullish)
      {
       if(iLow(Symbol(), PERIOD_CURRENT, 1) > iHigh(Symbol(), PERIOD_CURRENT, 3))
         {
@@ -536,7 +553,7 @@ string fvg_gap()
            }
         }
      }
-   if(check_bearish_bullish() == previousBearish)
+  // if(check_bearish_bullish() == previousBearish)
      {
       if(iLow(Symbol(), PERIOD_CURRENT, 3) > iHigh(Symbol(), PERIOD_CURRENT, 1))
         {