I've dealt with flexing failures like that in door jamb wiring. I would suggest 12-gauge wire. Also, look inside the wire. If it has like 8 fat strands, it will not last. The wire should have very fine, hair-like strands of copper inside.
If you have the room, an extra loop or two in the wire could help spread out the flex.
If the loop won't work, get some good heat shrink tubing, the kind with the sealant/glue inside. Apply it to the entire area that flexes and beyond; try to extend it past the splices. I've used even two or three layers of heat shrink for added flex resistance. This method seems to be the most durable.