How would I, once per day, with data.history, in the best possible way, retrieve the minut prices for the 1st, 2nd, 3rd, and 4th 45 minute periods of the previous 63 days for my context.assets?
If it matters for retrieval efficiency, I want, before each trading day, to use the data to first calculate the ratios between selected pairs of stocks and then calculate the ratio slope for each 45 minute period with linear regression, and then stick the ratio slope values into a 63x4 matrix for later use by my decision algorithm, also once per day.
Do I have to figure out the number of minutes per day for each of the 63 days and place 63x4=252 45-minute-windows upon the entire 63 day minute data set to retrieve and calculate the ratio slope values, or is there a slicker way?