I need help with programming the weekly version of the code shown below without using “Timeframe (weekly)”
DEFPARAM CalculateOnLastBars = 1000
defparam drawonlastbaronly=true
Voffset = -0*pipsize
H1 = DHigh(1)
L1 = DLow(1)
C1 = DClose(1)
H2 =DHigh(2)
L2 = DLow(2)
C2 = DClose(2)
H3 = DHigh(3)
L3 = DLow(3)
C3 = DClose(3)
PLdotDay= ((H1+L1+C1)/3 + (H2+L2+C2)/3 + (H3+L3+C3)/3)/3
// Envelope Top and Bottom
envelopeTopDay= (H1 + H2 + H3) / 3
envelopeBottomDay= (L1 + L2 + L3) / 3
Timeframe (Default)
drawtext(“envelopeTopDay”,barindex,envelopeTopDay+Voffset,SansSerif,Bold,10)
DRAWSEGMENT(barindex, envelopeTopDay, barindex+10, envelopeTopDay)
drawtext(“envelopebottomday”,barindex,envelopebottomday+Voffset,SansSerif,Bold,10)
DRAWSEGMENT(barindex, envelopebottomday, barindex+10, envelopebottomday)
drawtext(“pldotday”,barindex,pldotday +Voffset,SansSerif,Bold,10)
DRAWSEGMENT(barindex, pldotday, barindex+10, pldotday)
Return envelopetopDay as “envelopetopDay”, envelopebottomday as “envelopebottomday”,pldotday as “pldotday”