You don't state what the current values of the $health and $heart variables are, but assuming that:
a. The $health variables equals an integer greater than zero 0.
b. The $heart variable contains a value that can be printed.
... then the syntax of your <<for>> macro is correct.
note: if the $heart contains a simple String value then you don't need to use the <<print>> macro, you could use a Naked Variable instead.