input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLast10Period = yes;
plot DailyHigh;
plot DailyLow;
plot DailyOpen;
plot DailyClose;
if showOnlyLast10Period and !IsNaN(close(period = aggregationPeriod)[-10]) {
DailyHigh = Double.NaN;
DailyLow = Double.NaN;
DailyOpen = Double.NaN;
DailyClose = Double.NaN;
} else {
DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length);
DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length);
DailyOpen = Highest(Open(period = aggregationPeriod)[-displace], length);
DailyClose = Lowest(Close(period = aggregationPeriod)[-displace], length);
}
DailyHigh.SetDefaultColor(GetColor(4));
DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyLow.SetDefaultColor(GetColor(4));
DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyClose.SetDefaultColor(GetColor(4));
DailyClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyOpen.SetDefaultColor(GetColor(4));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);