I have 1000+ text files. Each has dates ( which I have made the index) and stock prices (which are column 0). I have created the code to find an individual file's price's moving average, and rolling difference between the price and the moving average. I would like to create code to do this for every file. I have to upload them in groups because it uses too much memory to upload them at once.
I imagine I would have to use a for loop to iterate through the files and find the metrics for each one. But how would I do that? How can I upload all the files into a group, and say, group them into one variable, then create a loop to find the moving average and difference from price for each one?
Edit: I am using numpy,pandas, and matplotlib. I'd also like to be able to find the stocks which the difference from the moving average is the greatest.
Any help would be greatly appreciated