|
|
@@ -35,8 +35,8 @@ input int MaxBarsBack=300; // How many bars to look back for FVG
|
|
|
// Structure to hold volume profile data for a day
|
|
|
struct VolumeProfileData {
|
|
|
datetime date; // Trading day date
|
|
|
- datetime startTime; // Start time for calculation (23:00 previous day)
|
|
|
- datetime endTime; // End time for calculation (23:00 current day)
|
|
|
+ datetime startTime; // Start time for calculation (23:59 previous day)
|
|
|
+ datetime endTime; // End time for calculation (23:59 current day)
|
|
|
datetime displayStart; // When to start displaying this profile (= endTime)
|
|
|
datetime displayEnd; // When to stop displaying this profile (= next day's endTime)
|
|
|
double val; // Value Area Low
|
|
|
@@ -113,8 +113,8 @@ void OnTimer()
|
|
|
MqlDateTime mdt;
|
|
|
TimeToStruct(currentTime, mdt);
|
|
|
|
|
|
- // Check if it's near the 23:00 boundary (update a bit before and after)
|
|
|
- if((mdt.hour == 22 && mdt.min >= 59) || (mdt.hour == 23 && mdt.min <= 5))
|
|
|
+ // Check if it's near the 23:59 boundary (update a bit before and after)
|
|
|
+ if((mdt.hour == 23 && mdt.min >= 58) || (mdt.hour == 0 && mdt.min <= 5))
|
|
|
{
|
|
|
CalculateAllVolumeProfiles();
|
|
|
}
|
|
|
@@ -322,7 +322,7 @@ void CalculateAllVolumeProfiles()
|
|
|
// Update comment with the most recent profile (index 0)
|
|
|
if(ShowComment && calculatedDays > 0)
|
|
|
{
|
|
|
- string info = "Volume Profile (TradingView 23:00-23:00 UTC+2)\n" +
|
|
|
+ string info = "Volume Profile (TradingView 23:59-23:59 UTC+2)\n" +
|
|
|
"Date: " + TimeToString(g_Profiles[0].date, TIME_DATE) + " (" + GetDayOfWeekName(g_Profiles[0].date) + ")\n" +
|
|
|
"Value Area: " + DoubleToString(ValueAreaPercent, 0) + "%\n" +
|
|
|
"VAL: " + DoubleToString(g_Profiles[0].val, _Digits) + "\n" +
|
|
|
@@ -374,8 +374,8 @@ void CalculateTimeBoundaries(int index)
|
|
|
string dayBeforeTradingDayStr = StringFormat("%04d.%02d.%02d", beforeMdt.year, beforeMdt.mon, beforeMdt.day);
|
|
|
|
|
|
// Calculate start and end times
|
|
|
- g_Profiles[index].startTime = StringToTime(dayBeforeTradingDayStr + " 23:00:00");
|
|
|
- g_Profiles[index].endTime = StringToTime(tradingDayStr + " 23:00:00");
|
|
|
+ g_Profiles[index].startTime = StringToTime(dayBeforeTradingDayStr + " 23:59:00");
|
|
|
+ g_Profiles[index].endTime = StringToTime(tradingDayStr + " 23:59:00");
|
|
|
g_Profiles[index].displayStart = g_Profiles[index].endTime;
|
|
|
}
|
|
|
|