BC Canada
Posts: 4 since Jan 2011
Thanks Given: 0
Thanks Received: 1
|
To amansinghbaveja
Sorry for the late reply. I haven't been very active on this forum. In case you still need it, here's the code you are looking for:
input aggPeriod = aggregationPeriod.MONTH;
input showOnlyLastPeriod = yes; # TD Ameritrade IP Company, Inc. (c) 2011-2023
input offset = 0;
plot mthHi;
plot mthLo;
mthHi.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
mthHi.SetDefaultColor(Color.GREEN);
mthLo.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
mthLo.SetDefaultColor(Color.RED);
# TD Ameritrade IP Company, Inc. (c) 2011-2023
if showOnlyLastPeriod and !IsNaN(close(period = aggPeriod)[-1]) {
mthHi = Double.NaN;
mthLo = Double.NaN;
} else {
mthHi = high(period = aggPeriod)[offset];
mthLo = low(period = aggPeriod)[offset];
}
# TD Ameritrade IP Company, Inc. (c) 2011-2023
Please note that some of this code was created by TD as noted
|