avwap time frames

hi there! i’ve been wondering how i would script in the analysis tool to calculate % distance from the most recent price to the avwap pegged to various times throughout the day on the charts at low as 1min.

any help appreciated!

Hi Joshua,

Here’s how to script for intraday timeframes, but it looks as though AVWAP scripting uses dates only, without an option to include time.

However, this will give the value of the AVWAP from the first bar of the day:

Sig1=DAYNUM()<>DAYNUM()[1];
$DATE=BARDATE(Sig1);
AVWAP(BACKTYPE=Fixed, DATE=$DATE)

Capture