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", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
SetPositionSize( 2000, spsShares ); // 2000 shares by default
_SECTION_BEGIN("levels");
breakoutime = Param("open time",091500,091500,230000,1,0);// for nse 100000,
Filterdaych = ParamToggle("Filter day Change Connections", "No|Yes", 1) ;
dt = DateTime() ;
//mytimenum = DateTimeConvert(2,dt,TimeNum());
//newt = mytimenum != 100000;
dtnum = DateTimeConvert(2, dt,TimeNum()) ;
newdt = dtnum != Ref(dtnum, -1);
//mytimenum = DateTimeConvert(1,dt);
// newt = mytimenum == 100000;
Lastbar = H-H ;
if (Filterdaych)
Lastbar = dtnum != Ref(dtnum, 1) AND TimeNum()<=breakoutime; ;
strnday = "day";
afterbreakout0 = Cross(TimeNum(),breakoutime);
afterbreakout1 = TimeNum()>=breakoutime ;// TimeNum()>=100000;
NewDay = Day()!= Ref(Day(), -1);
DayH = TimeFrameGetPrice("H", inDaily, -1); // yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1); // low
DayC = TimeFrameGetPrice("C", inDaily, -1); // close
DayO = TimeFrameGetPrice("O", inDaily,-1); // current day open
if ( True )
{
R = DayH - DayL;
S3 = DayC-(R * 1.1/4);
R4 = (R * 1.1/2)+DayC;
R3 = (R * 1.1/4)+DayC;
S4 = DayC- (R * 1.1/2);
}
Plot(IIf(lastbar,Null,R3), "r3",colorRed,styleStaircase);
Plot(IIf(lastbar,Null,R4), "r4",colorGreen,styleStaircase);
Plot(IIf(lastbar,Null,S3), "s3",colorPaleGreen,styleStaircase);
Plot(IIf(lastbar,Null,S4), "s4",colorOrange,styleStaircase);
//----
//Title = Name()
;
Filter=1;
AddColumn(C,"cmp",1.2);
AddColumn(R3,"R3",1.2);
AddColumn(R4,"R4",1.2);
AddColumn(S3,"S3",1.2);
AddColumn(S4,"S4",1.2);
_SECTION_END();
Buy1 = Cross (C, R4);
Buy2 = Cross (C, S3) ;
Sell1 = Cross (R3 ,C);
Sell2 = Cross (S4 ,C);
Buy= ( Buy1 OR Buy2)AND TimeNum()>breakoutime;
Sell= (sell1 OR sell2) AND TimeNum()>breakoutime;
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=10);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=20);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-15);