Skip to main content

Python SDK for LMAX Global

Project description

lmax-python-sdk

Unofficial LMAX Python SDK

This is a Python SDK for interacting with the LMAX trading platform. It provides a set of modules to interact with different aspects of the platform. Since the OpenAPI generator is messy and I needed to interact with LMAX rather implemented a very lightweight and simple SDK.

Modules

Client

The client module, located in lmax_sdk/client.py, provides the LMAXClient class for interacting with the LMAX API. It uses the client_key_id for authentication.

Validation

The validation module, located in lmax_sdk/validation.py, provides various validation functions and constants. Contains different enum types for categorical input arguments.

Account

The account module, located in lmax_sdk/account, provides functionality related to account data and trading.

Broker Market Data

The broker allows to access the real-time and historical LMAX data for close prices and orderbook level data.

Public Data

Not implemented.

Example Usage

Here are some examples of how to use these modules. For more depth take a look at the docs page.

import os
import lmax_sdk

lmax_client = lmax_sdk.account.account_data.LMAXAccount(
    client_key_id=os.getenv("LMAX_DEMO_API_KEY"),
    secret=os.getenv("LMAX_DEMO_API_SECRET"),
    base_url=lmax_sdk.ClientBaseURLType.ACCOUNT_LONDON_DEMO,
)

lmax_client.get_instrument_data_symbol("EUR/USD")

[{'instrument_id': 'eur-usd',
  'security_id': '4001',
  'symbol': 'EUR/USD',
  'currency': 'USD',
  'unit_of_measure': 'EUR',
  'quantity_increment': '1000.0000',
  'margin': '1.00',
  'minimum_position_size': '1000.0000',
  'maximum_position_size': '500000000.0000',
  'trading_days': ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY'],
  'open_time': '17:05',
  'close_time': '17:00',
  'time_zone': 'America/New_York',
  'minimum_commission': '0.00000',
  'aggressive_commission_rate': '0.25000',
  'passive_commission_rate': '0.25000',
  'price_increment': '0.000010',
  'minimum_price': '0.000000',
  'maximum_price': '99999.000000',
  'short_swap_points': '-0.510',
  'long_swap_points': '0.950',
  'short_swap_cost': '-0.51000',
  'long_swap_cost': '-0.95000',
  'swap_cost_units': '10000.0000',
  'trade_date': '2024-02-08',
  'value_date_from': '2024-02-12',
  'value_date_to': '2024-02-13',
  'asset_class': 'CURRENCY'}]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lmax_python_sdk-1.0.4.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

lmax_python_sdk-1.0.4-py2.py3-none-any.whl (18.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file lmax_python_sdk-1.0.4.tar.gz.

File metadata

  • Download URL: lmax_python_sdk-1.0.4.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for lmax_python_sdk-1.0.4.tar.gz
Algorithm Hash digest
SHA256 500a5a3aeee2c71e7bd50607366f45d7f9f1af6f0279130cc206c70d64ea15f0
MD5 1ca7c35fb5740d856f7fa75c6409097c
BLAKE2b-256 b6eeb667a80daa5233183fd4cc5ba7baf32605f9e94986e9279c4860170fb005

See more details on using hashes here.

File details

Details for the file lmax_python_sdk-1.0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for lmax_python_sdk-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5668a7243ae92aaa5700849543a59bc9fb2a4523a8a481d59f05f332e9d463ab
MD5 0293dc07875d3589918b55c6f52bc01a
BLAKE2b-256 6f16a9c6f7909593187b2d4e5097e8de8e6fd6b0f35f278db27ae1d782d132b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page