i = Bars - counted_bars - 1; while ( i >= 1 ) { temp = iMAOnArray(hma,0,MathFloor(MathSqrt (HMA_Period)),0,MODE_LWMA,i); hma[i] = temp; i--; }
You can't do that. The moment you update hma[bars-1] then all other values generated by iMAonArray are bogus.
Add a second buffer.
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
The problem is that in some bars it shows some strange peaks like that one in the image, and if I'm sure it's a problem in the code because if I use another hull's moving average indicator it doesn't have those peaks. Can anyone see the problem in my code? :S
In this image I put my hull moving average's indicator (black line) and another hull moving average indicator with the same period (red line).That peak must come from a problem in the code...