First, thank you arranging active support for all newcomers!

I have a question. I try to get a price of SPY inside a scheduled function (decribed in docs and in your latst post). : 

self.last_price = data["SPY"].Close 

and get an error: global name 'data' is not defined. How to pass data to the function?