Plotting Horizontal lines Using GFX Function

Dear All,

I Have written a code which Plots Previous Day high and low Using Plot function .

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

//==================================================================================================================

DailyTF     = inDaily;

PrevDayHigh = TimeFrameGetPrice("H",DailyTF,-1);
PrevDayLow  = TimeFrameGetPrice("L",DailyTF,-1);

//===========================================================
// Market start time is - 9.15     Close time is -- 15.30

PlotStartTime = 091501 ;
PlotEndTime   = 153000 ; 


Plot( IIf(TimeNum() < PlotStartTime ,Null,PrevDayHigh), "",colorLavender,styleDashed);
Plot( IIf(TimeNum() < PlotStartTime ,Null,PrevDayLow), "",colorLavender,styleDashed);


As Plotting Horizontal lines using Plot Function is not efficient . I want to do the same using Gfx function . Also I do not want this small Gap as shown below in attached image .

There is no need to do anything. Single Plot() is as efficient as it can only be.

1 Like

Thanks for reply @Tomasz .

Can you hint me how the same thing will be implemented using Gfx .

I read few post related to this , but couldn't find clarity on the same.

Actually I want to implement some Pivot concepts, Where multiple horizontal lines to be drawn.

May be the Following Post can Help you, Have a Look
Click Here

1 Like

Thanx a lot @kaeswar . This is exactly what I was searching for .:pray::pray: