I would recommend having a reset setpoint for your alarm so it doesn’t toggle so much. Something like:
AlarmHigh: 90
AlarmReset: 5
if(value > AlarmHigh) then
alarm();
endif
if(value < AlarmHigh - AlarmReset) then
unalarm();
endif
I use a subroutine in my strategies to handle alarms that will handle high/low/reset/delays/logging etc. since I typically have a lot of points I need to alarm on in the HVAC world. Screenshots below for inspiration:
