
Rec ilc = if(lowest(close(period = agg),12) != ilc and marketOpen, lowest(close(period = agg),12), if(!firstBar, ilc, 0)) Rec ilo = if(lowest(open(period = agg),12) != ilo and marketOpen, lowest(open(period = agg),12), if(!firstBar, ilo, 0)) Hh.SetDefaultColor (CreateColor(0,95,95)) hh.SetLineWeight(1) hh.HideBubble() Plot hh = if(shouldPlot, ih, Double.nan) hh.SetPaintingStrategy( paintingStrategy.HORIZONTAL) Rec ih = if(highest(high(period = agg),12) != ih and marketOpen, highest(high(period = agg),12), if(!firstBar, ih, 0)) Hhcc.SetDefaultColor (CreateColor(95,95,0)) hhcc.SetLineWeight(1) hhcc.HideBubble() Plot hhcc = if(shouldPlot, Max(iho, ihc), Double.nan) hhcc.SetPaintingStrategy( paintingStrategy.HORIZONTAL) Rec ihc = if(highest(close(period = agg),12) != ihc and marketOpen, highest(close(period = agg),12), if(!firstBar, ihc, 0)) Rec iho = if(highest(open(period = agg),12) != iho and marketOpen, highest(open(period = agg),12), if(!firstBar, iho, 0)) PrevCloseY.SetPaintingStrategy(PaintingStrategy.LINE) PrevCloseY.SetLineWeight(1) PrevCloseY.HideBubble() ĭef showOnlyToday = 1 #отображать ТОЛЬКО для последней сессии = 1, для всех сессий = 0ĭef day = getDay() def lastDay = getLastDay() ĭef shouldPlot = if(showOnlyToday and isToday, 1,if(!showOnlyToday,1,0)) ĭef pastOpen = if((secondsTillTime(1025) > 0), 0,1) ĭef pastClose = if((secondsTillTime(1030) > 0), 0,1) ĭef marketOpen = if(pastOpen and !pastClose, 1, 0) ĭef firstBar =if (day != day, day-1, 0) Plot PrevCloseY = if(mOpenY and sY, close(period = "DAY"), double.nan) PrevCloseY.SetDefaultColor(CreateColor(95,95,0)) PrevClose.SetPaintingStrategy(PaintingStrategy.LINE) PrevClose.SetLineWeight(1) PrevClose.HideBubble() ĭef TodayY = yes #yes = showOnlyToday, no = showEveryDayĭef dayY = getDay() def lastY = getLastDay() ĭef isTodayY = if(dayY=lastY-1,1,0) def sY = if(TodayY and isTodayY, 1,if(!TodayY,1,0)) ĭef pastOpenY = if((secondsTillTime(Open_TY) > 0), 0,1) ĭef pastCloseY = if((secondsTillTime(Close_TY) > 0), 0,1) ĭef mOpenY = if(pastOpenY and !pastCloseY, 1, 0) Plot PrevClose = if(mOpen and s, close(period = "DAY"), double.nan) PrevClose.SetDefaultColor(CreateColor(95,95,0)) PrevL.SetPaintingStrategy(PaintingStrategy.LINE) PrevL.SetLineWeight(1) PrevL.HideBubble() Plot PrevL = if(mOpen and s, low(period = "DAY"), double.nan) PrevL.SetDefaultColor(CreateColor(75,0,0)) PrevH.SetPaintingStrategy(PaintingStrategy.LINE) PrevH.SetLineWeight(1) PrevH.HideBubble() Plot PrevH = if(mOpen and s, high(period = "DAY"), double.nan) PrevH.SetDefaultColor(CreateColor(0,75,0)) Def Today = yes #yes = showOnlyToday, no = showEveryDayĭef day = getDay() def last = getLastDay() ĭef isToday = if(day=last,1,0) def s = if(Today and isToday, 1,if(!Today,1,0)) ĭef pastOpen = if((secondsTillTime(Open_T) > 0), 0,1) ĭef pastClose = if((secondsTillTime(Close_T) > 0), 0,1) ĭef mOpen = if(pastOpen and !pastClose, 1, 0)
