I always use numLong(0) and numShort(0) to count the number of open trades if this helps?