|
|
@@ -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
|