I turned off Ext hours and it still wasn't showing anything, even with the debug mode on. Although, at the close today, it did end up populating.
Really what I'm trying to do (I tried all day and couldn't get the right code to work) is edit this code so that on an Extended hours chart I get the ATR and the Direct range of only the RTH. The issue is I have EMAs on the chart (/ES and /NQ futures) where they need the ETH to work right but then my indicator gets thrown off. Could you take a look at it and see if you could figure out how to code it to where it only pulls data from the RTH session? Here is the code below.
Also, I tried using the code from your thread
https://usethinkscript.com/threads/remove-extended-hour-from-indicator.6768/ for the period instead of AggregationPeriod.DAY. I wish there was a default period that was DAY RTH.
Thank you, this has been driving me nuts all day.
#ATR vs DR
declare upper;
input atrLength = 10;
input averageType = AverageType.WILDERS;
input Period = AggregationPeriod.DAY;
input offset = 1;
input showATR = yes;
input showTodayRS = yes; #show strength to today's range
def ATR = MovingAverage(averageType, TrueRange(high(period= Period), close(period = Period), low(period = Period)), ATRlength)[offset];
def todayHigh = high(period = Period);
def todayLow = low(period = Period);
def DR = todayHigh - todayLow;#current range
def a = todayLow + DR * .5; #50% of DR price
def b = close(period=Period) - todayLow; #last close price to DR
def x = b / DR * 100; #current DR range
def rangeDiff = roundUp(DR-ATR); #Range Left
#labels
AddLabel(showATR, "ATR: "+Round(ATR,1)+ " vs DR: "+Round(DR), (if DR > ATR then Color.GREEN else if DR < ATR then Color.RED else Color.LIGHT_GRAY));
AddLabel(showATR,"Diff: " +absValue(rangeDiff) ,if rangeDiff < 0 then color.red else color.green);
AddLabel(showTodayRS,"RS: "+round(x,2) + "%",if x >70 then Color.GREEN else if x>60 then color.LIGHT_GREEN else if x>40 then color.orange else color.red);