Time Stamp for Multiple Time Frame

I am trying to get time stamp for bar with highest volume over multiple time frames in the code embeded below. While the same is working fine in a normal time frame, it's missing out on time stamps for compressed time frames. I am attaching screenshot of actual data for full day volumes.

the code is pretty much crude , seen it's still in a R&D mode


dn = DateNum();
dt = DateTime();
newday = dn != Ref(dn, -1);
todays_bars = BarsSince( newday )+1;
todaybarsnum = LastValue(todays_bars);


//ID ATPs

TimeFrameSet(in15Minute);
   ATPCal = Ref((High+Low+Close)/3,0);
TimeFrameRestore();
ATPCal15Min = TimeFrameExpand(ATPCal,in15Minute,expandFirst );
V15Min = TimeFrameGetPrice("V", in15Minute, shift = 0); 
TO15Min = V15Min * ATPCal15Min;
ATP15Min = TO15Min / V15Min;

//FD ATPs
HATP15Min = HHV(ATP15Min,todays_bars);
LATP15Min = LLV(ATP15Min,todays_bars);
totalvolume = Sum(V15Min, todays_bars);
totalTO = Sum(TO15Min, todays_bars);
ATPFD = totalTO / totalvolume;


//Volumes

tmfrm = inDaily;
shift = 0;
TimeFrameSet( tmfrm );

Bars10SinceHighestVolume = HHVBars( V, 10 );
HV10 = Ref( V, -Bars10SinceHighestVolume );
DV10 = Ref(DateTime(),-Bars10SinceHighestVolume);

H10HV = Ref( High, -Bars10SinceHighestVolume );
L10HV = Ref( Low, -Bars10SinceHighestVolume );
ATP10FD = Ref(ATPFD,-(Bars10SinceHighestVolume+1));

TotalDayVol = V;
PreviousDayVol = Ref(V,-1); 
Avg5DayVol = Ref(MA(V,5),-1);


Bars15SinceHighestVolume = HHVBars( V, 15 );
HV15 = Ref( V, -Bars15SinceHighestVolume );
H15HV = Ref( High, -Bars15SinceHighestVolume );
L15HV= Ref( Low, -Bars15SinceHighestVolume );
ATP15FD = Ref(ATPFD,-(Bars15SinceHighestVolume+1));
   
TimeFrameRestore();

ATP10FDOut = Ref(ATPFD,-Bars10SinceHighestVolume);
HH10DVOut = TimeFrameExpand(HV10, tmfrm, expandFirst );

H10VOut = TimeFrameExpand(H10HV, tmfrm, expandFirst);
L10VOut = TimeFrameExpand(L10HV, tmfrm, expandFirst);

D10DVOut = TimeFrameExpand(DV10, tmfrm, expandLast );
//dt_str10 = DateTimeFormat(" %Y%b%d ",LastValue(D10DVOut));
dt_str10 = DateTimeFormat(" %x ",LastValue(D10DVOut));



//ATP10FDOut = TimeFrameExpand(ATP10FD, tmfrm, expandFirst);  

HH15DVOut = TimeFrameExpand(HV15, tmfrm, expandFirst );
H15VOut = TimeFrameExpand(H15HV, tmfrm, expandFirst);
L15VOut = TimeFrameExpand(L15HV, tmfrm, expandFirst);
ATP15FDOut = TimeFrameExpand(ATP15FD, tmfrm, expandFirst); 

TotalDayVolVOut = TimeFrameExpand(TotalDayVol, tmfrm, expandFirst);
PreviousDayVolVOut = TimeFrameExpand(PreviousDayVol, tmfrm, expandFirst);
Avg5DayVolOut = TimeFrameExpand(Avg5DayVol, tmfrm, expandFirst);


prev_HTF_Vol = TimeFrameGetPrice("V", in15Minute, shift = 0); 
Incrementalvolume = TotalDayVolVOut- Ref(TotalDayVolVOut,-1); 

HH5D15MinV = HHVBars(V,135);
HV5D15Min = Ref(V,-HH5D15MinV);
High5D15Min = Ref(H,-HH5D15MinV);
Low5D15Min = Ref(L,-HH5D15MinV);
ATP5D15Min = Ref(ATP15Min,-HH5D15MinV);

DV15Min = Ref(DateTime(),-HH5D15MinV);

CurrentVolRatio = TotalDayVolVOut/PreviousDayVolVOut;
Avg5VolRatio = TotalDayVolVOut/Avg5DayVolOut; 


Filter = 1;

AddColumn(C,"C",1.2);
AddColumn(TotalDayVolVOut,"V",1.0);
AddColumn(CurrentVolRatio,"VR",1.2);
AddColumn(Avg5DayVolOut,"V5",1.0);
AddColumn(Avg5VolRatio,"V5R",1.2);
AddTextColumn("$","S");
AddColumn(HV5D15Min,"5x15V",1.0);
//AddColumn(D10VOut,"D10V",formatDateTime);
AddColumn(High5D15Min,"5x15H",1.2);
AddColumn(Low5D15Min,"5x15L",1.2);
AddColumn(ATP5D15Min,"5x15ATP",1.2);
AddColumn(DV15Min,"D15Min",formatDateTime);
AddTextColumn("$","S");
AddColumn(HH10DVOut,"10VFD",1.0);
AddColumn(D10DVOut,"D10V",formatDateTime);
AddtextColumn(dt_str10,"  Date_Str  ", 1, colorBlack);
AddColumn(H10VOut,"H10VFD",1.2);
AddColumn(L10VOut,"L10VFD",1.2);
AddColumn(ATP10FDOut,"ATP10VFD",1.2);
AddTextColumn("$","S");
AddColumn(HH15DVOut,"15VFD",1.0);
//AddColumn(D10VOut,"D10V",formatDateTime);
AddColumn(H15VOut,"H15VFD",1.2);
AddColumn(L15VOut,"L15VFD",1.2);
AddTextColumn("$","S");

_SECTION_END();


Daily