Each story format defines it's own macro list and depending on the story format you are using, you may find that some of these macro/features already exist.
The SugarCube story format has a <<for>> macro. (v1 docs & v2 docs)
The Snowman story format supports the usage of the Javascript for statement in your passages.
The Harlowe story format includes the (live:) macro which can be used to emulate those three macros.
One limitation with that method is it only works if you need up to 25 iterations. If you try to loop more than 25 times it assumes the story has gone into an infinite loop and errors out.
Comments
The SugarCube story format has a <<for>> macro. (v1 docs & v2 docs)
The Snowman story format supports the usage of the Javascript for statement in your passages.
The Harlowe story format includes the (live:) macro which can be used to emulate those three macros.