TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/markzuckerbergas/gbmplus-api-python/llms.txt
Use this file to discover all available pages before exploring further.
gbmplus package exports three Enum classes — OrderTypes, TradingTypes, and InstrumentTypes — that are used as arguments to generateOrderObject(). By using these named constants instead of raw integers you avoid magic numbers in your trading code, get IDE auto-complete support, and make it immediately clear what each argument represents at a glance.
OrderTypes
OrderTypes specifies the direction of a trade: a purchase or a sale.
| Member | Integer value | Meaning |
|---|---|---|
OrderTypes.Buy | 1 | Open a long position — purchase the instrument |
OrderTypes.Sell | 8 | Close or short a position — sell the instrument |
TradingTypes
TradingTypes controls how the order is matched by the exchange: at a specific price or at whatever price the market offers.
| Member | Integer value | Meaning |
|---|---|---|
TradingTypes.Limited | 0 | Limit order — the order only fills at price or better |
TradingTypes.Market | 5 | Market order — the order fills immediately at the best available price |
When
TradingTypes.Limited is used, a price argument must be provided to generateOrderObject(). Omitting it raises an OrderFormatError. TradingTypes.Market orders do not require a price.InstrumentTypes
InstrumentTypes identifies the market segment of the instrument you are trading on the Mexican exchange.
| Member | Integer value | Meaning |
|---|---|---|
InstrumentTypes.SIC | 0 | Sistema Internacional de Cotizaciones — international instruments listed and traded on the Mexican exchange (e.g. US stocks cross-listed in Mexico) |
InstrumentTypes.IPC | 2 | Índice de Precios y Cotizaciones — domestic Mexican stock market instruments traded on the BMV |
Importing enums
All three enums are available directly on the top-levelgbmplus module — no sub-module import is required.
.value:
Full usage example
The example below shows all three enums working together when constructing and submitting a market buy order for a domestic Mexican instrument.price argument:
Passing
trading_type=gbmplus.TradingTypes.Limited without a price argument raises OrderFormatError. Always include price for limit orders.generateOrderObject() signature and all available parameters.