H

#### horserider

##### Well-known member

**VIP**

**Warehouse**

A fast and slow moving average of the VWAP since someone requested it. Again never used it. Play with it and report any results. I see little use for it.

Code:

```
## VWAPMovAvg2Line_JQ
#
# two line simple or exponential moving average
# by JQ 2008-08-31
# Not my own code... thinkMOney maybe
def VWAP = vwap();
input displace = 0;
input fastlength = 6;
input price = close;
input slowlength = 13;
input Averagetype = {default Exponential, Simple};
plot fastavg;
plot slowavg;
switch (Averagetype)
{
case Simple:
fastavg = Average(vwap[-displace], fastlength);
slowavg = Average(vwap[-displace], slowlength);
case Exponential:
fastavg = ExpAverage(vwap[-displace], fastlength);
slowavg = ExpAverage(vwap[-displace], slowlength);
}
```

Last edited by a moderator: