Use the "Check Trade Count" block to verify the number of open trades. When you want to close the oldest trade, use the "Counter : Pass Once" block. You should also use "Reset counter" blok when entering the first trade.