How can I count the number of matching zero elements between two numpy arrays?
You can compare the predictions with the expected results directly, using simple comparisons, in this case just ==. This returns boolean values - True or False, which you can sum up because True == 1 and False = 0.
Here is an example for your case using some randomly generated dummy data:
In [1]: import numpy as np                                                                                                           

In [2]: y = np.random.choice([-1, 0, 1], 10)                                                                                         

In [3]: preds = np.random.choice([-1, 0, 1], 10)                                                                                     

In [4]: y                                                                                                                            
Out[4]: array([ 1,  1,  1, -1,  1, -1, -1,  1,  1,  0])

In [5]: preds                                                                                                                        
Out[5]: array([ 0, -1,  1,  0,  1,  1, -1,  1, -1,  0])

The real part that checks where your predictions are correct is then done using two checks:

where are the predictions equal to the ground truth i.e. where were you correct in predicting the direction, and
where are the predictions equal to the direction you are interested in i.e. downwards (-1), no change (0) or upwards (1)

This can be done as follows:
In [6]: (y == preds) &amp; (preds == 0)   #   &amp;   means we needs both checks to be True 
Out[6]:
array([False, False, False, False, False, False, False, False, False, True])

We can see only the final position is True after both these checks, because that is the only place that the prediction was True and the value direction was 0.
You can then write a loop to check all values and do something with them:
In [7]: n = len(preds)    # the number of test samples (= 10 in my dummy example)

In [8]: for direction in [-1, 0, 1]:
            score = sum((y == preds) &amp; (preds == 0)) 
            accuracy = score / n 
            print(f&quot;Direction {direction:&gt;2}: {score}/{n} = {accuracy * 100:.1f}%&quot;)

Which gives:
Direction -1: 1/10 = 10.0%
Direction  0: 1/10 = 10.0%
Direction  1: 1/10 = 10.0%