I found the following script some time ago ( I probably altered it some) and use it every trading day. I use it only on a daily chart, Is there a way to code a bar style lower that would show the SD of ADR per day giving insight past the averaged SD of ADR in the Label here?
Code:
## Average Daily Range (ADR) Labels by theLEMband
## Version 220318.0 + Modified by TIGER 05/25/22
## Displays the average percent MOVEMENT of high vs lows
## (not gain/loss) for the past number of days desired
## ADR excludes gaps up/down (as opposed to ATR which
## includes gaps)
## Displays the percent movement for today
## Displays the percent of move remaining before hitting the average
#### inputs
input DtrAtrlength = 14;
input AtrAvgLength = 14;
input showAverageDailyRange = yes;
input showStandardDeviation = yes;
input showTodayPercentMove = yes;
input showPerecentOfDayRemaining = yes;
#### definitions & calculations ####
def aggregationPeriod = AggregationPeriod.DAY;
## fetch highs/lows for the period
def dailyHigh = high(period = aggregationPeriod);
def dailyLow = low(period = aggregationPeriod);
## calc the average movement for the period
def avgDailyRangeSum = Average((dailyHigh / dailyLow), AtrAvgLength);
## convert to a percentage
def averageDailyRange = Round (100 * (avgDailyRangeSum - 1), 2);
def stdDevofADR = stdev(averageDailyRange, AtrAvgLength);
## calc today's movement
def todayRange = (dailyHigh / dailyLow);
## convert to a percentage
def todayPercent = Round (100 * (todayRange - 1), 2);
## calculate ratio of today's movement vs average movement
## "what percent of the average movement is remaining"
def todayRatio = (1 - todayRange) / (1 - avgDailyRangeSum);
## convert to a percentage
def todayRemaining = Round (100 *(todayRatio - 1), 2);
# DTR definitions
def ATR = WildersAverage(TrueRange(high(period = aggregationPeriod.DAY), close(period = aggregationPeriod.DAY), low(period = aggregationPeriod.DAY)), AtrAvgLength);
def TodayHigh = Highest(high(period = aggregationPeriod.DAY), 1);
def TodayLow = Lowest(low(period = aggregationPeriod.DAY), 1);
def DTR = TodayHigh - TodayLow;
def DTRpct = Round((DTR / ATR) * 100, 0);
#### Output and Style
DefineGlobalColor("ADRColor", CreateColor(50, 200, 255)) ;
AddLabel(showAverageDailyRange, " ADR last " + DtrAtrlength + " days = " + averageDailyRange + "%", GlobalColor("ADRColor"));
AddLabel(showStandardDeviation, " SD of ADR = " + stdDevofADR + " ", GlobalColor("ADRColor"));
AddLabel(showTodayPercentMove, " % Today = " + todayPercent + "%", GlobalColor("ADRColor"));
AddLabel(showPerecentOfDayRemaining, " % of ADR Remaining = " + (1 - todayRemaining)+ "%", GlobalColor("ADRColor"));
## Open to Scanner
plot ADR18 = averageDailyRange;
#DTR Label (remove the # to activate this label)
#AddLabel (yes, "DTR " + Round (DTR , 2) + " vs ATR " + round (ATR,2)+ " " + round (DTRpct,0) + "%", (if DTRpct <= 70 then Color.GREEN else if DTRpct >= 90 then Color.RED else Color.ORANGE));