I am building an inidcator that uses the last 3 Zig Zag Highs and Lows... I have constructed a simple loop at the beginning of my indicator that will update the ZZ points and store them in an array. (see below for loop code)
The issue is that the indicator takes about 10 to 15 seconds to load on my 1 minute chart and i cant work out why...
I suspect it may be because everytime this loop checks, the Zig Zag indicator has to run from beginning to end (or at least from beginning up until the point necessary)..... Therefor making this way of calling the ZZ to find the points to do the same calculations over and over again....
Can anyone confirm that my suspicions are correct and maybe offer a solution? If i am correct, then the only answer i can think of is to add my code into the ZZ indicator, but i would rather keep them separate.
Thanks in advance for any kind help.
for (int x = 3; x >= 1; x--)
{
int zzLBar = ZigZag(DeviationType.Points, zZDeviation1, true).LowBar(0,x,100);
int zzHBar = ZigZag(DeviationType.Points, zZDeviation1, true).HighBar(0,x,100);
zzLow[x] = Low[zzLBar];
zzHigh[x] = High[zzHBar];
zzLB[x] = zzLBar;
zzHB[x] = zzHBar;
}
Comment