ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  VWAP in financial chart?
Posted by gregr on Mar-10-2012 02:05
Is there a function in the FinancialChart somewhere for plotting the volume-weighted
average price (VWAP)?  I was looking in the docs, but didn't see anything...hoping it might
be hidden somewhere and I just missed it. :-)

  Re: VWAP in financial chart?
Posted by Peter Kwan on Mar-10-2012 02:57
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

  Re: VWAP in financial chart?
Posted by gregr on Mar-10-2012 04:41
Thanks Peter!  I'll try that approach.

  Re: VWAP in financial chart?
Posted by Nidh on Sep-21-2015 20:03
Is that worked for you ?