You are on page 1of 1

_SECTION_BEGIN("VWAP");

/*
The VWAP for a stock is calculated by adding the dollars traded for every
transaction in that stock ("price" x "number of shares traded") and dividing the
total shares traded. A VWAP is computed from the Open of the market to the mark
et Close, AND is calculated by Volume weighting all transactions during this tim
e period
*/
Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 093000, BarIndex());
TodayVolume = Sum(V,Bars_so_far_today);
IIf (BarIndex() >= StartBar, VWAP = Sum (C * V, Bars_so_far_today ) / TodayVolu
me,0);
Plot (VWAP,"VWAP",colorOrange, styleThick);
_SECTION_END();

You might also like