Considering the ends of stacks adjacent to loops, tails or bulges.
For each stack end that is closed by GC or CG add 2. For each stack end that is closed by UA or AU add 1. For each stack end that is closed by GU or UG subtract 1.
For each stack end, if there is a stack pair under (behind) the closing pair and it is GC or CG and the closing pair is not GC or CG, subtract 1.
Normalize by dividing by the number of stack ends in the target structure. Normalized value should range from -2 to 2.