Hey there,
Looking for help improving the below code so that it displays the previous month hi/lo price, not the current, or show those current levels on the right side of the pic, Thanks
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);
Looking for help improving the below code so that it displays the previous month hi/lo price, not the current, or show those current levels on the right side of the pic, Thanks
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);
Last edited by a moderator: