#----- Previous Day High/Low -----# input aggregationPeriod = AggregationPeriod.DAY; input length = 1; input displace = -1; input showOnlyLastPeriod = no; plot DailyHigh; plot DailyLow; if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { DailyHigh = Double.NaN; DailyLow = Double.NaN; } else { DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length); DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length); } DailyHigh.SetDefaultColor(GetColor(4)); DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); DailyLow.SetDefaultColor(GetColor(4)); DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);