I cannot possibly advise against margin trading enough. But, if you are intent on starting, Bitmex also has a public test realm. If you are going to start, start here: https://testnet.bitmex.com/
It's honestly shocking that bitmex's own tutorial doesn't show this. Or that someone would just repost someone else's work here without any addition and get this much attention and traction.