Hi all, I'm creating an algorithm that requires a large set of data in the form (past month of minutely data, split into intervals of every possible 180-minute interval, i.e. minute 0 to minute 180, minute 1 to minute 181, minute 2 to minute 182, etc.). Currently, the algorithm goes through a for loop and appends to a list the following:
A list of interval length 180, created by using the current price's placement in overall time series' index to append to the interval list, then moving to the next price point by adding one to initial price placement, and so on, filling the list by recursion (if interval length != 180, call function again, which grabs the next minute price) and finally appending this newly created list of 180 sequential prices to the list in the first paragraph, moving to the next price point to start this process all over again.
Is there a better/faster/more efficient way to run this algorithm? It's taking ~30 seconds to run this code alone, which is valuable time I'll need for other computations down the line, and which could affect the accuracy of price my algorithm would like to trade at.
Also, on a side note, is the code being run off of my computer's CPU, and would using a higher-core computer speed up computation? Or is Quantopian providing a cloud-like service.