Macro will not run when starting with $H

When I try to home set offset and go to origin in a single macro I only get home function. if I only set offset and go to origin it works.
Here is the macro I would like to run.
$H
G10 L2 P1 X-370 Y-270
G0 X0 Y0