I think you need two attribute randomizes. The first one will give them a starting location. Change the blending mode of the second one to “add”. Plug your frame value to the second one. This should at least give you a start.
Also: If you plug the your sine value into the seed or max of your random float, the flags will wave randomly.
Good luck!