regards to everyone.
i'm interested in the cl contract and want to determine whether it is traded with any more volatility on the days when there are eia - api petroleum reports.
so, initially i'm interested in calculating the average for the latest 52 observations of the range of the day ( Value[0] = High[0] - Low[0]; ) but only for the days that were tuesdays.
i'm also interested in this same calculation for all days that were wednesdays only. and subsequently it would be necessary to compare the average range for tuesdays versus the average range for all days that were not tuesdays (mondays, wednesdays, thursdays, fridays), same for wednesdays versus non wednesdays, and finally tuesdays and wednesdays together versus all other days that were neither tuesdays nor wednesdays.
i asked for help on stack overflow but didn't get anywhere.
https://stackoverflow.com/questions/...ay-of-the-week
in mathematical terms i would use indicator functions (1 or 0) for every single day of the week but when it comes to programming i have no idea if it is possible to use this kind of conditional attributes inside calculations like those for the daily range or a simple average.
very well, thanks, regards.

Comment