Hi, I'm pretty new to all this so here's my code. I'm trying to get the top 20 stocks with highest volatility. I get volatility by ATR/price. I keep getting this error: 

Runtime Error: AttributeError : 'SelectionData' object has no attribute 'ATR'
 at __init__
   self.atr = self.ATR(self.symbol in main.py: line 48

My code's below, I was wondering about how I would go about correcting this?

This algorithm will find 20 stocks with highest momentum so far at 9:00am to give market time to move.
I will buy these stocks if the SPY is positive for the day. It will sell stocks at 11:45am because
this is when its lunch time and trading dies down.

class CalmMagentaBat(QCAlgorithm):

def Initialize(self):
self.SetStartDate(2018, 1, 1)
self.SetStartDate(2021, 1, 1)

self.UniverseSettings.Resolution = Resolution.Minute
self.UniverseSettings.Leverage = 2

self.stateData = {}


def MyCoarseFilterFunction(self, coarse):
for c in coarse:
if c.Symbol not in self.stateData:
self.stateData[c.Symbol] = SelectionData(c.Symbol, 30)
values = [x for x in self.stateData.values()]
values.sort(key=lambda x: x.volatility, reverse=True)
return [x.symbol for x in values[:20]]

# this event fires whenever we have changes to our universe
def OnSecuritiesChanged(self, changes):
# liquidate removed securities
for security in changes.RemovedSecurities:
if security.Invested:

# we want 10% allocation in each security in our universe
for security in changes.AddedSecurities:
self.SetHoldings(security.Symbol, 0.05)

def OnData(self, data):

class SelectionData(object):
def __init__(self, symbol, period):
self.symbol = symbol
self.atr = self.ATR(self.symbol, period, Resolution.Minute)
self.volatility = (self.atr.Current.Value)/(self.Securities[self.symbol].Price)

def update(self, time, price):