Drawing Pivot Lines till Day End

#1
Below is a basic Pivot Code which I use for day trading in Ami. Now the issue is, the pivot lines are drawn only till the current candle which becomes bit difficult to comprehend during live market. Was looking for help if anyone can advise on below.

Since Pivot lines remain static for the entire day, need some expert guidance on how to extend the lines till EOD candle even if I see the chart at morning time. I use below code which plots lines till current candle. I want the Line should be visible for the entire day till 3:30PM candle even though I may be seeing the chart at 10:00AM. I.e. the line should be extended till EOD candle on a 5 minute chart or 3 min chart or 15mins chart, the usual timeframes which I use.

I have attached a sample chart to show what I need here.

Any help will be highly appreciated. Thanks in advance.

H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ));
L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 ));
C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));

/*PIVOT Calculation*/
p = ( H1+ L1 + C1 )/3;
s1 = (2*p)-H1;
r1 = (2*p)-L1;
s2 = p -(H1 - L1);
s3 = S1 - (H1-L1);
r2 = p +(H1 - L1);
r3 = R1 +(H1-L1);

Plot (p,"Pivot",colorYellow, styleThick|styleNoRescale, 1);
Plot (r1,"R1",colorRed,styleThick|styleNoRescale, 1);
Plot (r2,"R2",colorRed,styleThick|styleNoRescale, 1);
Plot (r3,"R3",colorRed,styleThick|styleNoRescale,1);
Plot (s1,"S1",colorLime,styleThick|styleNoRescale,1);
Plot (s2,"S2",colorLime,styleThick|styleNoRescale,1);
Plot (s3,"S3",colorLime,styleThick|styleNoRescale,1);
 

Attachments

mastermind007

Well-Known Member
#2
use LineArray method
 

Romeo1998

Well-Known Member
#4
this might be helpful, good luck :)
Code:
H1=TimeFrameGetPrice( "H", inDaily, -1 );
L1=TimeFrameGetPrice( "L", inDaily, -1 );
C1=TimeFrameGetPrice( "C", inDaily, -1 );

/*PIVOT Calculation*/
p = ( H1+ L1 + C1 )/3;
s1 = (2*p)-H1;
r1 = (2*p)-L1;
s2 = p -(H1 - L1);
s3 = S1 - (H1-L1);
r2 = p +(H1 - L1);
r3 = R1 +(H1-L1);

Plot (p,"Pivot",colorYellow, styleThick);
Plot (r1,"R1",colorRed,styleThick);
Plot (r2,"R2",colorRed,styleThick);
Plot (r3,"R3",colorRed,styleThick);
Plot (s1,"S1",colorLime,styleThick);
Plot (s2,"S2",colorLime,styleThick);
Plot (s3,"S3",colorLime,styleThick);

newday = DateNum()!=Ref(DateNum(),-1);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,p,Null),"",colorYellow, styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,r1,Null),"",colorRed,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,r2,Null),"",colorRed,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,r3,Null),"",colorRed,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,s1,Null),"",colorLime,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,s2,Null),"",colorLime,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,s3,Null),"",colorLime,styleThick|styleNoLabel,null,null,3);
 
Last edited:
#5
this might be helpful, good luck :)
Code:
H1=TimeFrameGetPrice( "H", inDaily, -1 );
L1=TimeFrameGetPrice( "L", inDaily, -1 );
C1=TimeFrameGetPrice( "C", inDaily, -1 );

/*PIVOT Calculation*/
p = ( H1+ L1 + C1 )/3;
s1 = (2*p)-H1;
r1 = (2*p)-L1;
s2 = p -(H1 - L1);
s3 = S1 - (H1-L1);
r2 = p +(H1 - L1);
r3 = R1 +(H1-L1);

Plot (p,"Pivot",colorYellow, styleThick);
Plot (r1,"R1",colorRed,styleThick);
Plot (r2,"R2",colorRed,styleThick);
Plot (r3,"R3",colorRed,styleThick);
Plot (s1,"S1",colorLime,styleThick);
Plot (s2,"S2",colorLime,styleThick);
Plot (s3,"S3",colorLime,styleThick);

newday = DateNum()!=Ref(DateNum(),-1);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,p,Null),"",colorYellow, styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,r1,Null),"",colorRed,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,r2,Null),"",colorRed,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,r3,Null),"",colorRed,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,s1,Null),"",colorLime,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,s2,Null),"",colorLime,styleThick|styleNoLabel,null,null,3);
Plot (IIf(BarsSince(newday)>=3 AND TimeNum()<=151500,s3,Null),"",colorLime,styleThick|styleNoLabel,null,null,3);

Thanks much. Though it doesn't plot the lines till day end, for now it serves the purpose :)
 

Attachments