Skip to main content

A package that helps you get Forex data from TraderMade data API

Project description

tradermade is Python SDK for getting forex data via REST API or Websocket.

Installation

Use the package manager pip to install foobar.

pip install tradermade

Get API key by signing up for free

Usage

REST API

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.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.cfd_list() # gets list of all cfds available

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

Streaming Data

from tradermade import stream

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

api_key = "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()

Contributing

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

License

MIT

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

tradermade-1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

tradermade-1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file tradermade-1.0.tar.gz.

File metadata

  • Download URL: tradermade-1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for tradermade-1.0.tar.gz
Algorithm Hash digest
SHA256 10e4081f9a21ac25d862934e357e1e3f9c6c6333c62626f52b34d9cd76c78a2d
MD5 6f4e2de5e861ddf10701290cf422bf6e
BLAKE2b-256 0e6f58f16a17cc36c8b75ae7fa67f50ca4880c9a92a2956331d29abb3c35e168

See more details on using hashes here.

File details

Details for the file tradermade-1.0-py3-none-any.whl.

File metadata

  • Download URL: tradermade-1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for tradermade-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e746542cbd2d4c3fd68475883b4743e325a2fef3a43464e0fe45de9592ac7d73
MD5 6105e1dd04e02a73a22e37ba2e9585ca
BLAKE2b-256 a1ae775f7dbb65c708b7d25b2842b9ab2e04dc83d5a0f09ad3af11d32b397072

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