# 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);

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);

Try this that identifies each fundamental price with the period

Ruby:
``````input length = 14;
input...``````

#### SleepyZ

##### Well-known member
VIP
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);

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);