combine two indicator(PVI and Moving Average)
tom standly:
this is the code that i combined PVI and iMA but it doesn't show them correctly like the attached image. how to correct the code?
Try putting:
if(Vol0 > 0 && Vol1 > 0)
ahead of your assignment of buffer values.
I fixed a buggy volume indicator in the past in this way.
if(Vol0>Vol1) PVIBuffer[bar]=PVIBuffer[bar-1]*(1+((close[bar]-close[bar-1])/close[bar-1])); else PVIBuffer[bar]=PVIBuffer[bar-1]; } //---- return(rates_total);
find this bit of code in middle of OnCalculate. I reckon if you remove the return rates_total, it may work.
this is the code that i combined PVI and iMA but it doesn't show them correctly like the attached image. how to correct the code?