Color coding the e.g. 1h bar based on the e.g. average close of the 1 min bars within


New member

I was wondering if anyone has come across a way to color code the e.g. 1h bar based on the e.g. average close price of the 1 min bars within it. For example let's say that, for the specific case above (1h chart), one defines

input length = 60;

def x = average(log(close/close[1]), length);

declare lower;
Plot y = if x > 0 then 1 else 0;

Something like this would work if I were to plot it on a 1 min indicator chart. What should I do if I actually intended to average the 60 close prices that fit within a 1 h bar and then plot it in a 1 h timeframe. This is sort of the opposite of displaying a higher time-frame on a lower time-frame chart.

I appreciate any help,

Thank you.


New member
Thank you for the reply. I believe I did not explain myself well. I do not wish to "display a lower timeframe data on a higher timeframe." Rather, I would like to retrieve, for example, the 1-minute closing prices contained in 1 hour (and there are 60 such closing prices in 1 hour,, perform some calculations on it, then assign a color for the 1 hour bar. It is a slightly different idea.

Similar threads