simplify stock transaction counting