AverageDailyRange - Daily only

Camus1612

New member
Hey, I'm trying to take an ADR script and make it showing only the daily range (even if I'm on 4H timeframe for example). The problem is that what the script shows is 105% of the current price (SPY is 401.72 and ADR shows 424.62).
JavaScript:
input length = 14;
input high = FundamentalType.High;
input low = FundamentalType.Low;

plot ADR = MovingAverage(AverageType.wilders, fundamental(high-low,period = AggregationPeriod.DAY), length);
ADR.SetDefaultColor(GetColor(6));

AddLabel (yes, "ADR:" + round((ADR) , 3), Color.light_green);

AddLabel (yes, "ADR:" + Round((ADR / close) * 100, 3) + "%", Color.light_green);
Thanks in advance
 
Solution
Hey, I'm trying to take an ADR script and make it showing only the daily range (even if I'm on 4H timeframe for example). The problem is that what the script shows is 105% of the current price (SPY is 401.72 and ADR shows 424.62).
JavaScript:
input length = 14;
input high = FundamentalType.High;
input low = FundamentalType.Low;

plot ADR = MovingAverage(AverageType.wilders, fundamental(high-low,period = AggregationPeriod.DAY), length);
ADR.SetDefaultColor(GetColor(6));

AddLabel (yes, "ADR:" + round((ADR) , 3), Color.light_green);

AddLabel (yes, "ADR:" + Round((ADR / close) * 100, 3) + "%", Color.light_green);
Thanks in advance

Try this that identifies each fundamental price with the period

Ruby:
input length = 14;
input...

SleepyZ

Well-known member
VIP
Lifetime
Hey, I'm trying to take an ADR script and make it showing only the daily range (even if I'm on 4H timeframe for example). The problem is that what the script shows is 105% of the current price (SPY is 401.72 and ADR shows 424.62).
JavaScript:
input length = 14;
input high = FundamentalType.High;
input low = FundamentalType.Low;

plot ADR = MovingAverage(AverageType.wilders, fundamental(high-low,period = AggregationPeriod.DAY), length);
ADR.SetDefaultColor(GetColor(6));

AddLabel (yes, "ADR:" + round((ADR) , 3), Color.light_green);

AddLabel (yes, "ADR:" + Round((ADR / close) * 100, 3) + "%", Color.light_green);
Thanks in advance

Try this that identifies each fundamental price with the period

Ruby:
input length = 14;
input high = FundamentalType.High;
input low = FundamentalType.Low;

plot ADR = MovingAverage(AverageType.wilders, fundamental(high, period=aggregationPeriod.DAY)-fundamental(low,period = AggregationPeriod.DAY), length);
ADR.SetDefaultColor(GetColor(6));

AddLabel (yes, "ADR:" + round((ADR) , 3), Color.light_green);

AddLabel (yes, "ADR:" + Round((ADR / close) * 100, 3) + "%", Color.light_green);
 
Solution

Similar threads

Top