The cords of your bracelet are the core cords of your square knot sliding closure. You need a separate cord to tie the square knots over your core. Since no knots are tied with the core cords, they slide. Finishing the closure is tricky. In a "quick and dirty" method, cut the square knotting cords short and heat seal or glue them to the closure. This is not very secure, and also tends to be unsightly (but only on close inspection). For a more refined and secure finish, cut the knotting cords close to the sliding knots and heat seal (or fray check) the cords, making sure that they don't stick, then tuck/hide the cord ends in the knot and sew them securely in place.
An alternate finish works better if you start your closure with free ends (so you have 4 ends to finish vs 2). Then slide some beads onto the cord ends or tie a decorative knot and then finish the ends (heat seal, fray check, sew), then at the corners of the sliding closure when the cord ends come out, sew at the corners to secure. Note, that if the cord you are working with is too thin to sew, you are probably OK. Also if you're working with hemp or other natural fibre cord, then heat sealing won't work and fray checking is likely unnecessary.
Carol