In this code, the value of signal is being reset to zero for each bar, why would that happen? I have another indicator doing similar things and the variable does not get reset
//Entanglement indicator
//timeframe(1 hour,updateonclose)
BolUp1,BolDown1, BolUp2, BolMiddle, BolDown2, BolUp3, BolDown3, BolUp1Direction, BolDown1Direction, BolUp2Direction, BolDown2Direction=CALL “#HourlyBollinger”
timeframe(5 Minute, updateonclose)
if openhour=20 and openminute=55 then
signal=0
endif
// Signal values
// 1 entangled with BB1
// 2 entangled with BB2
// -1 entangled with BB-1
// -2 entangled with BB-2
if close>=BolUp1 then
signal=1
endif
if close>=BolUp2 then
signal=2
endif
if close<=BolDown1 then
signal=-1
endif
if close<=BolDown2 then
signal=-2
endif
return signal as “Entanglement”