When looking for equality between variables you need to use ‘==’ in the formula, so use this in the IF statement:
IF(V3==V1,1,0)
Regarding the TIMESINCESIGNAL, if you are trying to count how long it has been since it’s been above 60 you will need to look at it from the point of view of when it was last above 60 (not when it crossed above). Likewise, since it’s been below 40:
Finally, when posting formulas please use the <>Code button in the format bar which removes all formatting when copying and pasting in to Optuma. See this pinned post for instructions: