You're not computing the linking number, because the linking number is a property of a _link_ with two components. Note also that when computing the linking number, you only consider crossing where the first knot crosses over or under the second knot, you don't count self-crossing.
What you're computing could be called the "self-linking number", but it's actually called the writhe. And in fact you're computing half the writhe. In the definition of the writhe, you don't divide by $2$ when you're done summing all positive and negative crossings.
Moreover you have to be careful, because the writhe is _not_ an isotopy invariant, it doesn't make sense to talk about "the writhe of a knot", only "the write of a knot diagram". To convince yourself, do a Reidemeister type I move on one of your diagrams and compute the writhe again.