Stirrup Rebar Beam

Hi, how can I make this type of stirrup with dynamo. is what I have advanced.

rQC-Rb-Viguetas.dyn (82.1 KB)

I already managed to do it, but I do not know how to make the hooks have the direction down and not to one side as seen in the image.