the code is shared as below
Share and discuss as much as u can which will eventually help in understanding the concept more clearly
posting video link of the logic as well
_SECTION_BEGIN("ATP");
B=Volume;
A=Avg;
Value=B*A;
Barsfromtodaybegin = 1 + BarsSince( Day() != Ref(Day(), -1));
Totalvalue=Sum(Value,Barsfromtodaybegin);
Totalvolume=Sum(V,Barsfromtodaybegin);
ATP=(Totalvalue/Totalvolume);
_SECTION_BEGIN("ATP PREV day line");
NewDay =Day()!=Ref(Day(),-1);
NewDayBar =BarsSince(NewDay)+1;
TP=(H+L+C)/3;
TATP = IIf( NewDay, TP, Sum( V * TP, NewDayBar ) / Sum( V, NewDayBar ) );
PATP=ValueWhen(NewDay,Ref(TATP,-1),1);
_SECTION_END();
// Drawing Bar chart
Plot( Close, "Close", colorDefault, styleBar );
//Those who are unable to get current day vwap copy paste the abv line in your code in amibroker