Hi
I wonder how I can code so that I get the difference for the closing price for the 5 last candels in a 5 min chart. Anyone that can help me?
Ex:
5 close (1645,3; 1644,4; 1644,1; 1643,8; 1644,6) and I want too have a number for the highest and lowest for the last 5 candles. In this exemple 1645,3-1643,8=1,5
How can I code it so I get the number 1,5 as output?
average[5](close)
returns the average for the last five candle closing prices – or do you mean that you want the average of the last five 5 minute candles on a different time frame chart?
I have updated my question… i want the difference between highest and lowest close for the 5 last candles
a = highest[5](close)
b = lowest[5](close)
c = (a + b) / 2
Thank you for that… this forum i really great when one is trying too learn!!
The difference is:
a = highest[5](close)
b = lowest[5](close)
difference = a - b
Roberto’s answer is correct if you want the difference. I may have been confused in my reply as I read your first post and title before you edited them and they originally asked for an average.