Skip to main content

VWAP - Volume Weighted Average Price for Amibroker (AFL)

kaiji over 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker

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 market Close, AND is calculated by Volume weighting all transactions during this time period. This line is typically used for daytrading intraday charts as well as finding potential support / resistance levels for entries and exits.

Indicator / Formula

Copy & Paste Friendly
_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 market Close, AND is calculated by Volume weighting all transactions during this time 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  ) / TodayVolume,0);
Plot (VWAP,"VWAP",colorOrange, styleThick);

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.