try this, is not my work i copy from another guy
ND = Day() !=Ref(Day(), -1) ;
P = (H + L ) / 2;
VWP = P * V;
BI = BarIndex();
BeginBI = ValueWhen(ND, BI);
BeginBI = BeginBI[BarCount -1];
if(BeginBI <= BarCount - 1) {
InRange = BI > BeginBI;
CumV = Cum(V * InRange);
CumVWP = Cum(VWP * InRange);
VWAP = CumVWP / CumV;
Cuu=Cum(InRange);
S = Cum(Ref(CumV, -1) * V * (P-Ref( VWAP,-1))^2 /CumV );
Variance = S / CumV;
SD = sqrt(Variance);
VWAP = IIf(InRange, VWAP, VWAP);
}
Plot( VWAP, " VWAP", colorBlue );
Plot( VWAP + 1.96 *SD, "+1SD", colorDarkGreen );
Plot( VWAP - 1.96 *SD, "-1SD", colorRed );
Plot( VWAP + 2.58 *SD, "+2SD", colorDarkGreen );
Plot( VWAP - 2.58 *SD, "-2SD", colorRed );