_SECTION_BEGIN( "VWAP");
Bars_so_far_tod ay = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeN um() == 091500, BarIndex());
TodayVolume = Sum(V,Bars_so_f ar_today);
IIf (BarIndex() >= StartBar, VWAP = Sum (C * V, Bars_so_far_tod ay ) / TodayVolume,0);
Plot (VWAP,"VWAP",co lorOrange, styleThick);
_SECTION_END();
dn = DateTime();
sd = SelectedValue( dn );
start = dn == sd;
mp = C;
PV = mp * V;
CV = Cum( V );
VSS = CV - ValueWhen( start, CV );
denom = IIf( VSS == 0, 1, VSS );
num = Cum( PV ) - ValueWhen( start, Cum( PV ) );
M = IIf( BarsSince( start ), num/denom, mp );
Plot( C, Date() + " Close", colorYellow, styleBar );
Plot( M, "M" + _PARAM_VALUES() , colorYellow, styleThick );
Bars_so_far_tod
StartBar = ValueWhen(TimeN
TodayVolume = Sum(V,Bars_so_f
IIf (BarIndex() >= StartBar, VWAP = Sum (C * V, Bars_so_far_tod
Plot (VWAP,"VWAP",co
_SECTION_END();
dn = DateTime();
sd = SelectedValue( dn );
start = dn == sd;
mp = C;
PV = mp * V;
CV = Cum( V );
VSS = CV - ValueWhen( start, CV );
denom = IIf( VSS == 0, 1, VSS );
num = Cum( PV ) - ValueWhen( start, Cum( PV ) );
M = IIf( BarsSince( start ), num/denom, mp );
Plot( C, Date() + " Close", colorYellow, styleBar );
Plot( M, "M" + _PARAM_VALUES()
Comments
Post a Comment