Parcourir la Source

Ticket : 4491 Indicator not working on M5 timeframe

1) Sequential Volume Indicator Bug Fixed
faiz ali il y a 9 mois
Parent
commit
c0be51c8a1

BIN
indicator/SequentialVolumeProfileWithFVG.ex5


+ 14 - 3
indicator/SequentialVolumeProfileWithFVG.mq5

@@ -36,6 +36,8 @@ input     string                startMin             = "59";
36 36
 input     string                endHour              = "00";                                     // End Hour
37 37
 input     string                endMin               = "05";                                     // End Minutes
38 38
 
39
+datetime expiry=D'2025.05.30 12:30:27';
40
+
39 41
 // Structure to hold volume profile data for a day
40 42
 struct VolumeProfileData
41 43
   {
@@ -72,6 +74,12 @@ int OnInit()
72 74
 // Set up FVG object prefix
73 75
    prefix = "VProfFVG_";
74 76
 
77
+   if(TimeCurrent()>expiry)
78
+     {
79
+      Comment("Inactive. Contact Provider to Activate");
80
+      ExpertRemove();
81
+      return(INIT_FAILED);
82
+     }
75 83
 // Initialize profile storage
76 84
    ArrayResize(g_Profiles, MaxDaysBack);
77 85
    for(int i = 0; i < MaxDaysBack; i++)
@@ -181,10 +189,13 @@ int OnCalculate(const int rates_total,
181 189
 // Check if it's near the 23:59 boundary (update a bit before and after)
182 190
    if((mdt.hour == (int)startHour && mdt.min >= (int)startMin) || (mdt.hour == (int)endHour && mdt.min <= (int)endMin))
183 191
      {
184
-      if(lastCandleTime != iTime(Symbol(),PERIOD_CURRENT,0))
192
+      if(lastCandleTime != iTime(Symbol(),PERIOD_D1,0))
185 193
         {
186
-         CalculateAllVolumeProfiles();
187
-         lastCandleTime = iTime(Symbol(),PERIOD_CURRENT,0);
194
+         //if(newDayBar())
195
+           {
196
+            CalculateAllVolumeProfiles();
197
+            lastCandleTime = iTime(Symbol(),PERIOD_D1,0);
198
+           }
188 199
         }
189 200
      }
190 201
 // Detect Fair Value Gaps if enabled

BIN
valFvgMt5.ex5


+ 2 - 2
valFvgMt5.mq5

@@ -528,7 +528,7 @@ string check_bearish_bullish()
528 528
 string fvg_gap()
529 529
   {
530 530
 //Print("Imbalance: ");
531
- //  if(check_bearish_bullish() == previousBullish)
531
+//  if(check_bearish_bullish() == previousBullish)
532 532
      {
533 533
       if(iLow(Symbol(), PERIOD_CURRENT, 1) > iHigh(Symbol(), PERIOD_CURRENT, 3))
534 534
         {
@@ -553,7 +553,7 @@ string fvg_gap()
553 553
            }
554 554
         }
555 555
      }
556
-  // if(check_bearish_bullish() == previousBearish)
556
+// if(check_bearish_bullish() == previousBearish)
557 557
      {
558 558
       if(iLow(Symbol(), PERIOD_CURRENT, 3) > iHigh(Symbol(), PERIOD_CURRENT, 1))
559 559
         {