So, I have a bunch of lines on my chart with equally spaced y values, imagine a line at every $10 for the sake of simplicity, and right now I have them structured into an array in order to do certain things with them.
One of the things I am doing is determining which line was last hit by using
for (i = 0; i < 13; i++) {if (Closes[1][0] == array[i]) {lastHit = i; }}
How can I somehow store the last value that this calculation yielded and ensure it is only counting when the value has changed?
And tangentially, how can I ascribe the different values of i their own count value using the array. I know I could do this easily outside the context of the array, but elegant > inelegant, right?
I hope I have provided enough information and I am looking forward to your responses.
Thank you.
Comment