Range of first candle of each and every day

@mradtke

This is my code iam getting movingaverage values and range values as correct but i do have problem while ploting
it is plotting shape on each and every candle i want to plot on particular candle whose range is more than or equal mavg

time = TimeNum();
time2 = SelectedValue(time);
val = ValueWhen(TimeNum()==time2, H-L);
Range = TimeFrameCompress(val,inDaily);
MovingAvg = MA(Range, 15);
MovingAvg = TimeFrameExpand(MovingAvg, inDaily);
PlotShapes(IIf(val >= MovingAvg, shapeUpArrow, shapeNone),colorRed, 0, L);

Moderator comment: you need to use CODE tags