Skip to content
All library documents

BitMEX API Operations for Orders, Positions, and Leverage

Article FMZ forum · Author: 小草

Summary

This technical note demonstrates exchange operations for BitMEX perpetual contracts through FMZ's trading interface. Its example selects the XBTUSD contract, retrieves ticker, account, and position data, submits market and limit orders, checks order status, and cancels outstanding orders. It also shows closing a short position, changing leverage while a position exists, and invoking a raw exchange API endpoint. The examples illustrate how a trading program can inspect state and manage the lifecycle of orders and positions.

The note also describes simultaneous long and short position checks and explains that the platform can construct chart intervals beyond those directly supported by the exchange. Screenshots and sample API responses are presented as demonstrations, not as a measured trading evaluation. The code is an operational test sequence rather than a complete strategy: it gives no entry logic, sizing framework, or risk controls, and does not assess profitability. Its platform and exchange details are historical documentation, so current API behavior and contract support should not be inferred from the examples alone.

Key ideas

  • The example retrieves account, ticker, position, and order information through the trading interface.
  • It demonstrates submitting, checking, and canceling market and limit orders.
  • Leverage can be adjusted while a position is held, and raw exchange API calls are illustrated.
  • The note includes examples for closing positions and checking simultaneous long and short exposure.
  • The material is an operational API demonstration, not a tested trading strategy or current compatibility guide.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.