Fetch Exited Positions for the Set

For a given set, I want or check whether a position is entered and exited. However, the below condition doesn’t work.

What am I doing wrong?