if I use following call, this call gives me per minute data for m minutes.
price_hist = data.history(security, 'price', m ,'1m')
But suppose I want to find moving volatility based on minute data for last 5 days, then how do I compute the number of minutes?
The problem is, I cannot assume 7 hours of trading per day and to get past 5 days per minute data simply multiply 5 * 7 * 60.
This is so because number of trading hours may vary (say due to heavy snow, etc.).
So, if my requirement is to find moving volatility of per day but based on minute data, how can I find number of minutes of each day?
This question also extends to per day data. Suppose I want to compute moving volatility for 1 quarter, then I cannot simply give
price_hist = data.history(security, 'price', 90 ,'1d')
The reason is that if I give 90 as number of days, it will span beyond a quarter due to weekends and holidays.
So, what is a good way to specify number of days in a more controlled way to get exactly 90 trading days?
Please advice.