I am trying to build a study which needs grouping of historical price (OHLC) data into Weekly / Monthly buckets i.e. to get Open, High, Low, Close for a week / month for the entire data set displayed in chart.
In the Calculate method, I checked the DataContext, but unable to figure out how to group the data.
Not sure, but my hunch is something like below should get the OHLC data grouped week-wise, not sure though.
BarSize barSizeWeek = BarSize.getBarSize(Enums.BarSizeType.TICK, Enums.IntervalType.WEEK, 1);
DataSeries dS= dataContext.getDataSeries(barSizeWeek);
I notice that the standard study - Pivot Point has an option (Timeline) where we can have pivots based on week / month, so I believe the grouping of data (Eg: Weekly OHLC) is possible.
Hope my query is clear & await your inputs / guidance.
P.S: This is my first post in this forum, apologies in case I have not followed any rules of this forum.
In the Calculate method, I checked the DataContext, but unable to figure out how to group the data.
Not sure, but my hunch is something like below should get the OHLC data grouped week-wise, not sure though.
BarSize barSizeWeek = BarSize.getBarSize(Enums.BarSizeType.TICK, Enums.IntervalType.WEEK, 1);
DataSeries dS= dataContext.getDataSeries(barSizeWeek);
I notice that the standard study - Pivot Point has an option (Timeline) where we can have pivots based on week / month, so I believe the grouping of data (Eg: Weekly OHLC) is possible.
Hope my query is clear & await your inputs / guidance.
P.S: This is my first post in this forum, apologies in case I have not followed any rules of this forum.