No Volumes received in VWAP calulation

 

Indicator compiles fine but when loaded gets error stating 'zero divide in line 190.' Looks like volumes are returning a value of 0 in the divisor.  Using iVolumes to retrieve volume not sure what is missing. 

Please help!!!!

 

line 133

iVolume[i]=(double)tick_volume[i];

line 159

if (sumVol > 0) vwapBuffer[i]= sumPrice/sumVol;

If you do this fix, it will work for a while.

But as soon as you move the arrow object, maybe it will stop.

You will need to modify the program significantly to prevent it from stopping.

You should stop using "iRatesTotal, iTime[], iOpen[], iHigh[], iLow[], iClose[], iVolume[]"

and start using "rates_total, time[], open[], high[], low[], close[], tick_volume[]".

 
Nagisa Unada:

line 133

line 159

If you do this fix, it will work for a while.

But as soon as you move the arrow object, maybe it will stop.

You will need to modify the program significantly to prevent it from stopping.

You should stop using "iRatesTotal, iTime[], iOpen[], iHigh[], iLow[], iClose[], iVolume[]"

and start using "rates_total, time[], open[], high[], low[], close[], tick_volume[]".

Thanks so much!!! 

I accidently sent you the non-updated code so the arrow moving issue should be fixed, but the two modifications you sent worked great! 

Much Appreciated

👏👏👏