I am looking for a way to produce a volume weighted moving average of price over a given number of prior traded shares (input paramater).
We have a script for volume weighted average price. This is an average over a given number of prior interval bars.
I would like a similar calculation but instead of over a constant number of prior interval bars (like 10 or 50) I want the weighted average computed over the last 1 million shares for example.
The shares could be aggregated into small intervals such as 5 minutes and the volume weighted average price computed for all past bars until the cumulative volume equals an input parameter.
Does such a script exist or anything close?
Mike Scott
Tarzana, CA
We have a script for volume weighted average price. This is an average over a given number of prior interval bars.
I would like a similar calculation but instead of over a constant number of prior interval bars (like 10 or 50) I want the weighted average computed over the last 1 million shares for example.
The shares could be aggregated into small intervals such as 5 minutes and the volume weighted average price computed for all past bars until the cumulative volume equals an input parameter.
Does such a script exist or anything close?
Mike Scott
Tarzana, CA
Comment