Plotting On Chart

Hi All ,

I am plotting ORB ORB values on my charts. At the start of the new day I can see a chart like this

image



BSS_Color = ParamColor("ORB Buy SL Color", colorWhite);
BSS_Style = ParamStyle("ORB BUY SL Style", styleDashed);

SSL_Color = ParamColor("ORB Sell SL Color", colorYellow);
SSL_Style = ParamStyle("ORB Sell SL Style", styleDashed);

ORBHigh_Color = ParamColor("ORB High Color", colorGreen);
ORBHigh_Style = ParamStyle("ORB High Style", styleLine);

ORBLow_Color = ParamColor("ORB Low Color", colorRed);
ORBLow_Style = ParamStyle("ORB Low Style", styleLine);

ORBBuyTarget_Color = ParamColor("ORB Buy Target", colorGreen);
ORBBuyTarget_Style = ParamStyle("ORB Buy Target", styleDashed);

ORBSellTarget_Color = ParamColor("ORB Sell Target", colorRed);
ORBSellTarget_Style = ParamStyle("ORB Sell Target", styleDashed);





BSS=ORBHigh - (ORBHigh * (.2/100));
Plot(BSS,"Buy-SL",BSS_Color,BSS_Style);    

SSL=  ORBLow+ (ORBLow * (.2/100));
Plot(SSL,"Sell-SL",SSL_Color,SSL_Style);     


Plot(ORBHigh,"ORB High",ORBHigh_Color,ORBHigh_Style);
Plot(ORBLow,"ORB LOW",ORBLow_Color,ORBLow_Style);

Plot(BuyTar1,"ORB High Target",ORBBuyTarget_Color,ORBBuyTarget_Style);
Plot(Selltar1,"ORB LOW Target",ORBSellTarget_Color,ORBSellTarget_Style);


PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-20);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-30);                      
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-25); 
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);                      
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
//PlotShapes(IIf(Sell1, shapeSquare, shapeNone),colorGreen, 0, H, Offset=40);
//PlotShapes(IIf(Sell1, shapeSquare, shapeNone),colorLime, 0,H, Offset=50);                      
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorWhite, 0,H, Offset=45);
//PlotShapes(IIf(Cover1, shapeSquare, shapeNone),colorRed, 0, L, Offset=-55);
//PlotShapes(IIf(Cover1, shapeSquare, shapeNone),colorOrange, 0,L, Offset=-65);                      
PlotShapes(IIf(Cover, shapeStar, shapeNone),colorWhite, 0,L, Offset=-60); 

_SECTION_BEGIN("Price1");
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() ); 
_SECTION_END();

I want my chart to look like this at the start of every new day

image

Can someone please point out what is wrong in the above code?

Thanks in advance.

Regards,
Sumit

pl chk below code

_SECTION_BEGIN("HIGH LOW breakout");

HLbreakout=ParamList("HL break", "Yes|No",1);

orb = ParamList("ORB Range", "5min|10min|15min|30min|60min",1);

newday = Day() != Ref(Day(),-1); //check if new day or not

starttime = ValueWhen(newday,TimeNum());

X = LastValue(ValueWhen(Day() != Ref(Day(), -1), BarIndex(), 1));

IBtopi = H[X];
IBboti = L[X];

//5min ORB
if(orb == "5min")
{
IBendtime = starttime+500;
IBtop = TimeFrameExpand( IBtopi,in5minute); //
IBbot = TimeFrameExpand( IBboti,in5minute); //
}

//10min ORB
if(orb == "10min")
{
IBendtime = starttime+1000;
IBtop = TimeFrameExpand( IBtopi,2in5minute); //
IBbot = TimeFrameExpand( IBboti,2
in5minute); //
}

//15min ORB
if(orb == "15min")
{
IBendtime = starttime+1500;
IBtop = TimeFrameExpand( IBtopi,3in5minute); //
IBbot = TimeFrameExpand( IBboti,3
in5minute); //
}

//30min ORB
if(orb == "30min")
{
IBendtime = starttime+3000;
IBtop = TimeFrameExpand( IBtopi,6in5minute); //
IBbot = TimeFrameExpand( IBboti,6
in5minute); //
}

//60min ORB
if(orb == "60min")
{
IBendtime = starttime+6000;
IBtop = TimeFrameExpand( IBtopi,12in5minute); //
IBbot = TimeFrameExpand( IBboti,12
in5minute); //
}

if( HLbreakout=="Yes" ){

RANGE_IB = lastvalue( IBtop )-lastvalue( IBBot ) ;
Daysback = 26;//optimize("Bars Back",5 ,5,100,1);
PriceLineColor=colorcustom12 ;
FirstBar = BarCount - DaysBack;
IBtopP = IIf(BarIndex() >= Firstbar,EndValue(LastValue(IBtop)),Null);
//Plot(IBtopP,"",PriceLineColor,styleNoTitle| styleDashed | stylenolabel, Null, Null, 0, 1 , 5);//
IBbotP = IIf(BarIndex() >= Firstbar,EndValue(LastValue(IBbot)),Null);
//Plot( IBbotP,"",PriceLineColor,styleNoTitle| styleDashed | stylenolabel, Null, Null, 0, 1 , 5);//
Plot(IBtopP,"ORBH",colorCustom11);
Plot(IBbotP,"ORBL",colorCustom12);
}

_SECTION_END();