Hi, the code additions put fixed text labels at the current bar location. Also while checking I came across a few gremlins which I think I’ve corrected on original lines 15,18,22 and 27.
I’m curious, why your not using the stock pivot point indicator set to 4 hours.
// Pivot H4 intraday
//
Timeframe(4h,UpdateOnClose)
//
// Pivot H4
//
Pivot = (high + low + close)/3
//
Res1 = 2*((high + low + close)/3) - low
Res2 = (high + low + close)/3+(high-low)
Res3 = high+2*((high + low + close)/3-low)
//
Sup1 = 2*((high + low + close)/3) - high
Sup2 = (high + low + close)/3-(high-low)
Sup3 = low+2*(((high + low + close)/3)-high)
//
MidR1 = (3*((high + low + close)/3)-low)/2
MidR2 = (3*((high + low + close)/3)+high)/2-low
MidR3 = high+3*(((high + low + close)/3)-low)/2
//
MidS1 = (3*((high + low + close)/3)-high)/2
MidS2 = (3*((high + low + close)/3)+low)/2-high
MidS3 = low+3*(((high + low + close)/3)-high)/2
//
Timeframe(default)
if isLastBarUpdate then
Drawtext(" Piv H4",-20,Pivot+2) Anchor(topRight,xShift,value) Coloured(0,0,0,255)
Drawtext(" R1 H4",-20,Res1+2) Anchor(topRight,xShift,value) Coloured(255,0,0,255)
Drawtext(" R2 H4",-20,Res2+2) Anchor(topRight,xShift,value) Coloured(255,0,0,255)
Drawtext(" R3 H4",-20,Res3+2) Anchor(topRight,xShift,value) Coloured(255,0,0,255)
Drawtext(" S1 H4",-20,Sup1+2) Anchor(topRight,xShift,value) Coloured(0,128,0,255)
Drawtext(" S2 H4",-20,Sup2+2) Anchor(topRight,xShift,value) Coloured(0,128,0,255)
Drawtext(" S3 H4",-20,Sup3+2) Anchor(topRight,xShift,value) Coloured(0,128,0,255)
Drawtext("mR1 H4",-20,MidR1+2) Anchor(topRight,xShift,value) Coloured(255,0,0,255)
Drawtext("mR2 H4",-20,MidR2+2) Anchor(topRight,xShift,value) Coloured(255,0,0,255)
Drawtext("mR3 H4",-20,MidR3+2) Anchor(topRight,xShift,value) Coloured(255,0,0,255)
Drawtext("mS1 H4",-20,MidS1+2) Anchor(topRight,xShift,value) Coloured(0,128,0,255)
Drawtext("mS2 H4",-20,MidS2+2) Anchor(topRight,xShift,value) Coloured(0,128,0,255)
Drawtext("mS3 H4",-20,MidS3+2) Anchor(topRight,xShift,value) Coloured(0,128,0,255)
endif
//
RETURN Pivot AS "Pivot H4",Res1 AS "Res1 H4",Res2 AS "Res2 H4",Res3 AS "Res3 H4",Sup1 AS "Sup1 H4",Sup2 AS "Sup2 H4",Sup3 AS "Sup3 H4",MidR1 AS "MidR1 H4",MidR2 AS "MidR2 H4",MidR3 AS "MidR3 H4",MidS1 AS "MidS1 H4",MidS2 AS "MidS2 H4",MidS3 AS "MidS3 H4"