I am trying to plot pivot points which have three resistance and support levels including their corresponding middle points. This will be on intraday charts. Since pivot points uses previous day daily prices for its calculations, there are break in values for every other day.
My AFL code connects the lines for different days when viewing intraday chart.
I want a line break for a new day.
Here is my AFL:
// Initial time frame is 15 minutes or other intraday value
TimeFrameSet(inDaily);
p = (High + Low + Close) / 3;
r1 = (2 * p) - Low;
s1 = (2 * p) - High;
r2 = p + (r1 - s1);
s2 = p - (r1 - s1);
r3 = r1 + (High - Low);
s3 = s1 - (High - Low);
r_m1 = p + (r1 - p) / 2;
r_m2 = r1 + (r2 - r1) / 2;
r_m3 = r2 + (r3 - r2) / 2;
s_m1 = s1 + (p - s1) / 2;
s_m2 = s2 + (s1 - s2) / 2;
s_m3 = s3 + (s2 - s3) / 2;
TimeFrameRestore();
p = TimeFrameExpand(p, inDaily);
r1 = TimeFrameExpand(r1, inDaily);
s1 = TimeFrameExpand(s1, inDaily);
r2 = TimeFrameExpand(r2, inDaily);
s2 = TimeFrameExpand(s2, inDaily);
r3 = TimeFrameExpand(r3, inDaily);
s3 = TimeFrameExpand(s3, inDaily);
r_m1 = TimeFrameExpand(r_m1, inDaily);
r_m2 = TimeFrameExpand(r_m2, inDaily);
r_m3 = TimeFrameExpand(r_m3, inDaily);
s_m1 = TimeFrameExpand(s_m1, inDaily);
s_m2 = TimeFrameExpand(s_m2, inDaily);
s_m3 = TimeFrameExpand(s_m3, inDaily);
Plot(p, "Pivot", colorDarkBlue, styleNoLabel | styleNoTitle);
Plot(r1, "R1", colorRed, styleNoLabel | styleNoTitle);
Plot(r2, "R2", colorRed, styleNoLabel | styleNoTitle);
Plot(r3, "R3", colorRed, styleNoLabel | styleNoTitle);
Plot(s1, "S1", colorGreen, styleNoLabel | styleNoTitle);
Plot(s2, "S3", colorGreen, styleNoLabel | styleNoTitle);
Plot(s3, "S3", colorGreen, styleNoLabel | styleNoTitle);
Plot(r_m1, "RM1", colorYellow, styleDots | styleNoLabel | styleNoTitle);
Plot(r_m2, "RM2", colorYellow, styleDots | styleNoLabel | styleNoTitle);
Plot(r_m3, "RM3", colorYellow, styleDots | styleNoLabel | styleNoTitle);
Plot(s_m1, "SM1", colorYellow, styleDots | styleNoLabel | styleNoTitle);
Plot(s_m2, "SM3", colorYellow, styleDots | styleNoLabel | styleNoTitle);
Plot(s_m3, "SM3", colorYellow, styleDots | styleNoLabel | styleNoTitle);