Various BitMEX Utility functions for Google Sheets
The following custom functions can be used with Google Sheets in your own Google Sheets Macros. Those functions are the exact replica of how BitMEX Calculate liquidation price, initial margin requirements, etc.
- Calculate Bitmex liquidationPrice for a new position given the price, leverage and quantity.
- Calculate Bitmex initial margin for a new position given the price, leverage and quantity.
- Calculate Bitmex Margin Requirement for a new position given the price, leverage and quantity.
I spent so many hours trying to figure out how BitMEX calculate margin/liquidation, etc. and could not find anything out there. I eventually had to dig deep in the code and prepare it for easy use in any Javascript application/ Google Sheets/ etc. This is the most accurate functions and will possibly help you if you building automation bots. If you using any of those in your own Google Sheets or javascript application, please Star or leave a comment to let me know it is useful! Keep Sharing and Make the World a better place !!