Skip to content

Anchored VWAP function - AVWAP()

By Optuma Team · Updated 2020-06-03

Use the AVWAP() function to create a scan for price crossing above or below an anchored VWAP line. The VWAP anchor can be based off a rolling period, eg last month or change the Look Back Type to Fixed and select a specific date from the calendar.

Blog post: Scripting and Anchored VWAPs

Here’s crossing below the AVWAP over the last month:

CLOSE() CrossesBelow AVWAP(BACKTYPE=Month)

To set the anchoring to a specific date:

CLOSE() Crosses AVWAP(BACKTYPE=Fixed, DATE=2020-03-01)

Anchored VWAP Properties

To automatically draw the AVWAP from the year’s high in a Show Plot tool:

//Define starting date as first trading day of the year;
Start = (BARDATE() == STRDATE(DATE=2020-01-02));
//Find where date matches the Highest High since Dec 31st;
Sig = HIGH() == HIGHESTSINCE(Start);
//Remove Non Zero results to show date of high as latest value;
$DATE = BarDate(NonZero(Sig));
//Calculate VWAP from High Date;
AVWAP(BACKTYPE=Fixed, DATE=$DATE)

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.