# Average True Range Within % of 52 week Low

Hi Guys

Could someone please help me create a script that will show the average true range when it is within 5% of its 52 week low and has occurred in the last two days. I understand how to apply these variables to the price chart, but I have no idea how to apply them to an indicator below the chart.

Hi Tonia,

Reading your post i wasn’t sure if you meant when the chart was within its 52 week low or the ATR value was at it’s 52 week low, so below is both scripts…

The following script will display the ATR value when the charts low is within 5% of the 52 week low value…

```V1 = LOWESTLOW(BACKTYPE=Weeks, BARS=52) ;
V2 = WITHINRANGE(Low(),V1, PERCENT=5.00) ;
V3 = ATR();
IF(V2 == 1, V3,0)```

The result in a Show View looks like this:

Green Line = 52 Week Low, Blue line = 5% range, Black Line = ATR value when criteria is met (otherwise returns 0).

If you were wanting to use the 52 week low of the ATR value itself, the script would be:

```V1 = ATR() ;
V2 = LOWESTLOW(V1, BACKTYPE=Weeks, BARS=52) ;
V3 = WITHINRANGE(V1,V2, PERCENT=5.00);
IF(V3 == 1,V1,0)```

The result would look like this:

Red Line = ATR, Green Line = ATR 52 Week Low, Blue Line = 5% Range of ATR 52 Week Low, Black Line = ATR Value when criteria is met

The only part i was unsure on was with regards to the “Within the last 2 days”. If the above scripts aren’t what you’re after please provide more details and include some screen shot examples of the setups you’re trying to identify.

Hi Matthew, apologies for being ambiguous in my request. It is great that you have sent me both, I should have been clearer. I was looking for ATR 6 month low values occurring within the last two days, highlighting extremely low volatility opportunities.

Sorry I meant 52 week ATR low

Hi Tonia,

Try this:

```//Get ATR value
V1 = ATR() ;
//Get Lowest 52 week ATR Value
V2 = LOWESTLOW(V1, BACKTYPE=Weeks, BARS=52);
//Is current ATR within 5% of lowest?
V3 = WITHINRANGE(V1,V2, PERCENT=5.00);
//Did it occur in the last 2 days?
TIMESINCESIGNAL(V3)<3```

Here are the ASX200 true results for Tuesday: