Hi gregr,
ChartDirector does not really have a built-in indicator called "VWAP". However, ChartDirector can plot any custom indicator you compute with your code.
For the VWAP, it seems quite easy to calculate using the ChartDirector ArrayMath utility. The following is the code I have just tried in C#:
//compute vwap
double[] adjClose = new ArrayMath(volData).add(0.000000000001).result();
double[] vwap = new ArrayMath(closeData).mul(adjClose).movAvg(10).div(new ArrayMath(adjClose).movAvg(10).result()).result();
//add the main price chart as usual
XYChart mainPriceChart = c.addMainChart(240);
//Add the VWAP into the main price chart
c.addLineIndicator2(mc, vwap, 0xff0000, "VWAP");
Hope this can help.
Regards
Peter Kwan |