The number of open contracts refers to the total number of contracts in circulation of a futures contract. It is the sum of all long positions and correspondingly all short positions. -the above is taken from the textbook and get down to business.
Suppose that A and B are both parties to the transaction, and both are open positions. To make a deal, one person (suppose a) must buy and one person (b) must sell. (This shows that A has no short position in futures and B has no long position. )
In this way, the long position and short position increased by 1 respectively, and the open position also increased by 1.
Extension:
(1) If both parties close positions, it is assumed that A will still buy positions and B will sell positions. This means that A originally held the short position of futures and B originally held the long position of futures, and both sides closed their positions, resulting in the decrease of both short positions and long positions 1.
(2) If one party in the transaction is to open a position and the other party is to close a position. Let's assume that A buys a position and B sells it. This shows that A originally did not hold short positions in futures, and B originally held long positions. The result is that A leads to long increase 1, and B leads to long decrease 1, and the number of open positions remains unchanged.
I hope I can answer your doubts.