Kaynağa Gözat

Ticket : 4491 Indicator not working on M5 timeframe

1) Sequential Volume Indicator Bug Fixed
faiz ali 1 yıl önce
ebeveyn
işleme
c0be51c8a1

BIN
indicator/SequentialVolumeProfileWithFVG.ex5


+ 14 - 3
indicator/SequentialVolumeProfileWithFVG.mq5

@@ -36,6 +36,8 @@ input     string                startMin             = "59";
 input     string                endHour              = "00";                                     // End Hour
 input     string                endMin               = "05";                                     // End Minutes
 
+datetime expiry=D'2025.05.30 12:30:27';
+
 // Structure to hold volume profile data for a day
 struct VolumeProfileData
   {
@@ -72,6 +74,12 @@ int OnInit()
 // Set up FVG object prefix
    prefix = "VProfFVG_";
 
+   if(TimeCurrent()>expiry)
+     {
+      Comment("Inactive. Contact Provider to Activate");
+      ExpertRemove();
+      return(INIT_FAILED);
+     }
 // Initialize profile storage
    ArrayResize(g_Profiles, MaxDaysBack);
    for(int i = 0; i < MaxDaysBack; i++)
@@ -181,10 +189,13 @@ int OnCalculate(const int rates_total,
 // Check if it's near the 23:59 boundary (update a bit before and after)
    if((mdt.hour == (int)startHour && mdt.min >= (int)startMin) || (mdt.hour == (int)endHour && mdt.min <= (int)endMin))
      {
-      if(lastCandleTime != iTime(Symbol(),PERIOD_CURRENT,0))
+      if(lastCandleTime != iTime(Symbol(),PERIOD_D1,0))
         {
-         CalculateAllVolumeProfiles();
-         lastCandleTime = iTime(Symbol(),PERIOD_CURRENT,0);
+         //if(newDayBar())
+           {
+            CalculateAllVolumeProfiles();
+            lastCandleTime = iTime(Symbol(),PERIOD_D1,0);
+           }
         }
      }
 // Detect Fair Value Gaps if enabled

BIN
valFvgMt5.ex5


+ 2 - 2
valFvgMt5.mq5

@@ -528,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))
         {
@@ -553,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))
         {