I would like to plot weekly, monthly, quarterly and yearly highs and lows on daily candles. The code immediately below accomplishes this for weekly and monthly data:
//Weekly Plots WkH = TimeFrameCompress(H,inWeekly,compressHigh); WkL = TimeFrameCompress(L,inWeekly,compressLow); WklyH = TimeFrameExpand(WkH,inWeekly,expandFirst); WklyL = TimeFrameExpand(WkL,inWeekly,expandFirst); Plot(WklyH,"WklyH",colorBlue,styleStaircase); Plot(WklyL,"WklyL",colorBlue,styleStaircase); //Monthly Plots MnthH = TimeFrameCompress(H,inMonthly,compressHigh); MnthL = TimeFrameCompress(L,inMonthly,compressLow); MlyH = TimeFrameExpand(MnthH,inMonthly,expandFirst); MlyL = TimeFrameExpand(MnthL,inMonthly,expandFirst); Plot(MlyH,"MnthlyH",colorRed,styleStaircase); Plot(MlyL,"MnthlyL",colorRed,styleStaircase); Unfortunately, the quarterly start and end dates are not correctly plotted using similar code. QtrH = TimeFrameCompress(H,3*inMonthly,compressHigh); QtrL = TimeFrameCompress(L,3*inMonthly,compressLow); QlyH = TimeFrameExpand(QtrH,3*inMonthly,expandFirst); QlyL = TimeFrameExpand(QtrL,3*inMonthly,expandFirst); Plot(QlyH,"QtrlylyH",colorBrightGreen,styleLine); Plot(QlyL,"QtrlyL",colorBrightGreen,styleLine); Would anyone be able to advise me as to how to correctly encode the plotting of the quarterly and yearly highs and lows? It is probably really simple but I have tried a number of approaches without success thus far. Thank you very much for your time and effort. Fred