I'm trying to do a few calculations based on the condition that there has been a change in price. I did it doing the following way:
if(Close[0] !=(Close[1]){... etc
Line 2: Close[0]: 1665.25 Close[1]: 1665.5
Line 3: Close[0]: 1665.25 Close[1]: 1665.5
Line 4: Close[0]: 1665.25 Close[1]: 1665.5
Line 5: Close[0]: 1665.25 Close[1]: 1665.5
Line 6: Close[0]: 1665.25 Close[1]: 1665.5
I'm trying to avoid doing the calculation on the same Close value twice in a row. Any idea on how I can achieve my goal?
Thanks
Comment