Get values from Zigzag indicator - performance issue
int found; int i; double zz; int ExtDepth =12 int ExtDeviation = 5; int ExtBackstep =5; double ZZ[10]; while(found<10) { if(i > Bars - 1) break; zz = iCustom(Symbol(),Period(),"ZigZag",ExtDepth,ExtDeviation,ExtBackstep,0,i); if( zz != 0) { ZZ[found] = zz; found++; } i++; }
Put last 10 zz into array. Maybe that helps.
Hello,
I want to get calculated values from the Zigzag indicator.
My code looks like this:
Now my problem is that the copy operation causes bad performance, because the method will be called in the OnTick() method.
Furthermore, I am dependent on the size variable, because I might not get X zig zag values from Y bars, which will cause an ArrayOutOfBound exception.
Any ideas how I can make this more dynamic (without the size variable) and faster?
Thanks in advance.