teddybear555
New member
Hi,
I'm trying to plot the January opening range based off the highest high and lowest low only for the first 10 trading days of each January.
The code below does not seems to plot correctly. Appreciate if anyone can help out please.
Thanks!
Rgds
Adrian Choong
I'm trying to plot the January opening range based off the highest high and lowest low only for the first 10 trading days of each January.
The code below does not seems to plot correctly. Appreciate if anyone can help out please.
Code:
def highrange = highest(high,10)[1];
def lowrange = lowest(low,10)[1];
def JanMonth = if GetMonth() ==1 then 1 else 0;
rec jH = compoundValue(1, if JanMonth then highrange else jH[1], high);
rec jL = compoundValue(1, if JanMonth then lowrange else jL[1], low);
plot JanHigh = jH;
plot JanLow = jL;
JanHigh.setDefaultColor(color.blue);
JanLow.setDefaultColor(color.blue);
JanHigh.setLineWeight(2);
JanLow.setLineWeight(2);
Thanks!
Rgds
Adrian Choong
Last edited by a moderator: