Is there any workaround to enable ping macro @cursor?

You need to use this stopmacro technique

#showtooltip
/cast [mod:alt,@cursor] [@player] Anti-Magic Zone
/ping [nomod:alt,@player] onmyway
/stopmacro [nomod:alt]
/ping onmyway