once todayOpen=open
once todayHigh=high
once todayLow=low
once todayClose=close
once Dailyclose=todayClose
once DailyOpen=todayopen
once DailyHigh=todayHigh
once DailyLow=todayLow
checkTime=010000
if opentime>=checktime and opentime[1]<checktime then
Dailyclose=todayClose
DailyOpen=todayopen
DailyHigh=todayHigh
DailyLow=todayLow
//-------------------------------
//Pivot points
Pivot=(DailyHigh + DailyLow + Dailyclose) / 3
R01 = 2*Pivot - DailyLow
S01 = 2*Pivot - DailyHigh
R02 = Pivot + (DailyHigh - DailyLow)
S02 = Pivot - (DailyHigh - DailyLow)
R03 = R01 + (DailyHigh - DailyLow)
S03 = S01 - (DailyHigh - DailyLow)
//-------------------------------
todayOpen=open
todayHigh=high
todayLow=low
todayClose=close
else
todayHigh=max(high,todayHigh)
todayLow=min(low,todayLow)
todayClose=close
endif
if islastbarupdate then
drawsegment(barindex,Pivot,barindex+10,Pivot)coloured("blue")
drawsegment(barindex,R01,barindex+10,R01)coloured("red")
drawsegment(barindex,R02,barindex+10,R02)coloured("red")
drawsegment(barindex,R03,barindex+10,R03)coloured("red")
drawsegment(barindex,S01,barindex+10,S01)coloured("green")
drawsegment(barindex,S02,barindex+10,S02)coloured("green")
drawsegment(barindex,S03,barindex+10,S03)coloured("green")
endif
return