Automatic previous days range label


# Daily_Range
Input TimeFrame = {default DAY, WEEK, MONTH};
Input Label = Yes;
Def H = high(Period = TimeFrame);
Def L = low(Period = TimeFrame);
Def DR1 = (H[1] - L[1]);
Def DR2 = (H[2] - L[2]);
Def DR3 = (H[3] - L[3]);
Def DR4 = (H[4] - L[4]);
Def DR5 = (H[5] - L[5]);
Def DR6 = (H[6] - L[6]);
Plot Daily_Range = AbsValue(H - L);
Daily_Range.hide();
AddLabel(Label, concat( Daily_Range, concat(" ",  " Point Trading Range")),
if ((Daily_Range > DR1) or (Daily_Range > DR2) or (Daily_Range > DR3) or (Daily_Range > DR4) or (Daily_Range > Dr5) or (Daily_Range > DR6)) then Color.Green else Color.Red);
plot null = double.nan;

2 comments :

annymous said...

AddChartLabel no longer works in thinkscript I used addlabel think that is the same thing?

elvisuptown said...

Yes that will work, I've corrected the script above.

Post a Comment