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.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?