Skip to main content

TraderMade SDK

tradermade is the Python SDK for getting forex, crypto and CFD data from the TraderMade REST API and WebSocket feed.

Installation

Use the package manager pip to install tradermade.

   pip install tradermade

Get the API key by signing up for free.

Usage

REST API

Follow the TraderMade Python SDK REST tutorial.

   import tradermade as tm

   # set api key
   tm.set_rest_api_key(api_key)


   tm.live(currency='EURUSD,GBPUSD',fields=["bid", "mid", "ask"]) # returns live data - fields is optional
    
   tm.live(currency='EURUSD,GBPUSD',per_quote_ts=True) # returns live data with a timestamp for each quote instead of one for all - per_quote_ts is optional

   tm.historical(currency='EURUSD,GBPUSD', date="2021-04-22",interval="daily", fields=["open", "high", "low","close"]) # returns historical data for the currency requested interval is daily, hourly, minute - fields is optional

   tm.timeseries(currency='EURUSD', start="2021-04-20",end="2021-04-22",interval="hourly",fields=["open", "high", "low","close"]) # returns timeseries data for the currency requested interval is daily, hourly, minute - fields is optional

   tm.timeseries(currency='BTCUSD', start="2026-10-09",end="2026-10-12",interval="daily",weekend=True) # returns timeseries data including weekend days - weekend is optional and works for crypto pairs only

   tm.cfd_list() # gets a list of all cfds available

   tm.currency_list() # gets a list of all currency codes available add two codes to get code for currency pair ex EUR + USD gets EURUSD

Streaming Data

Follow the TraderMade Python SDK WebSocket tutorial

   from tradermade import stream

   def print_message(data):
      print(f"Received: {data}")

   api_key = "ws_api_key"

    # set streaming key - not the same as rest API key
   stream.set_ws_key(api_key)

   stream.set_symbols("USDJPY,EURGBP")
   
   # Set the callback for receiving messages
   stream.stream_data(print_message)  

   stream.connect()

   # connects to the WebSocket v2 feed, after login_ok and sub_ack each quote arrives as json with bid/ask volume (bv/av) ex:
   # Received: {"a":"1.122940000","av":"1000000","b":"1.122930000","bv":"1000000","s":"EURUSD","t":"QUOTE","ts":"20261021-12:34:36.202"}
   # see the message format at https://tradermade.com/docs/streaming-data-api

Contributing

For changes, please open an issue to discuss what you would like to change.

License

MIT

Metadata

Release files for tradermade 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tradermade 1.1.0
File Size Uploaded Provenance Actions
tradermade-1.1.0.tar.gz 6.4 kB Without provenance Details for tradermade-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tradermade 1.1.0
File Interpreter ABI Platform Actions
tradermade-1.1.0-py3-none-any.whl Python 3 none any Details for tradermade-1.1.0-py3-none-any.whl

Total release size: 13.0 kB

Release files / tradermade-1.1.0.tar.gz

Download URL tradermade-1.1.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ebf26eee6308fb9d4e0510a397dc3d72e88f9497bcd21dec6220f6b1d630a5e9
BLAKE2b-256 checksum
How to use checksums
d1633858ad0a96cbde2c1a16d6f207c40d531bd6c096523bbca1c9a5c1167d53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / tradermade-1.1.0-py3-none-any.whl

Download URL tradermade-1.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
304dd92d85ecff7eeeb6ee5a01e6cad342dc22fb677374deeb0fbafb02a90d34
BLAKE2b-256 checksum
How to use checksums
ea3a6630e7cfc90ec843da0bcaf845c9fe5f7a9b768f3da2824e213e9cb1bdb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for tradermade 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page