Help creating array of date/time periods
Posted: Mon Aug 04, 2008 8:23 am
Hi,
I am trying to write a program to help with my trading. I need to create an array of dates for different trading time frames. For example I need a function that will take a date/time as an argument and create an array of all of the days moving forward for a year, not including bank holidays and weekends (this bit I am struggling to get my head around). I need to do the same for every four hour period, every hour period and every 15 minute period too. I dont need to project the smaller time periods forward for a year, just a month or so would do.
Does anyone have any advice on how this could be achieved, specifically dealing with the weekends and bank holidays? I just cant seem to get my head around it ...
Thanks
James
I am trying to write a program to help with my trading. I need to create an array of dates for different trading time frames. For example I need a function that will take a date/time as an argument and create an array of all of the days moving forward for a year, not including bank holidays and weekends (this bit I am struggling to get my head around). I need to do the same for every four hour period, every hour period and every 15 minute period too. I dont need to project the smaller time periods forward for a year, just a month or so would do.
Does anyone have any advice on how this could be achieved, specifically dealing with the weekends and bank holidays? I just cant seem to get my head around it ...
Thanks
James