Hi everyone,
From Price_low = history(100, '1d', 'low'),
I grab the lowest low price with lowest = prices_low.idxmin()
Now, I would like to use this lowest data for tomorrow. And tomorrow my code will be calculating as well the new ''lowest'' data. And so on.
How to create the list in handle_data and put a data in the list without seeing this list go empty at every beginning of the day? I f I create my empty list outside of handle_data, it tells me it doesn't exist.
def initialize(context):
#set_universe(universe.DollarVolumeUniverse(94.0, 99.0))
context.security = symbol('AAPL')
def handle_data(context, data):
low_list=[]
Price_low = history(100, '1d', 'low')
lowest = prices_low.idxmin()
low_list.append(lowest)
I know the way I try to put my lowest data in the list is not right and, tomorrow, when the handle data will run again, the low_list will go blank to add only one value that will be deleted the next day....
Help please !