Using the client created from the bitmex package and cancelling using the client with:
client = bitmex.bitmex(test=test