The arrow array (arrowar) you are checking for a Buy alert isn't zero by default. When there is no arrow, the array's value is EMPTY_VALUE. So, you need to change > 0 to != EMPTY_VALUE.
However, this won't fix everything for you.
You also need to check color array (arrowcl you are checking for a Sell alert) to determine whether it is a Buy or Sell signal.
arrowar assumes a non-empty value whenever there is any signal at all - be it Buy or Sell. Then the arrowcl array is changed based on whether it is a Buy (0) or Sell (1), so your two conditions have to look like this: