Skip to main content

Tradologics SDK

Project description

This is the initial version of Tradologics’ Python SDK.

At the moment, it only supports a wrapper for the awesome requests library that will automatically:

  • prepend the full endpoint url to your calls

  • attach your token to the request headers

  • add datetime to your order when in backtesting mode

Install using PyPi

$ pip3 install -U tradologics

Using the library:

In your requirements.txt:

tradologics

In your code:

# import Tradologics' requests
import tradologics.requests as requests

# set your token (once)
requests.set_token("MY TOKEN")

# from this point - use is just like you would have used `reqeuests`:
requests.post("/orders", json={
    ...
})

Running your own server:

Assuming that strategy.py (your strategy file) is located in the same directory as your server.py file (your Tradehook’s handler file), and that strategy.py has a main function called strategy:

# server.py

from tradologics import server

#-------------------------------
# ↓ this should be a file with your strategy code
from . import strategy
#-------------------------------

server.start(strategy, endpoint="/my-strategy",
             host="0.0.0.0", port=5000, debug=False)

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

tradologics-0.0.22.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

tradologics-0.0.22-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file tradologics-0.0.22.tar.gz.

File metadata

  • Download URL: tradologics-0.0.22.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for tradologics-0.0.22.tar.gz
Algorithm Hash digest
SHA256 6dc94b756356556c1f5140fa429047f06d4253a8615294bb79202965b27ca875
MD5 264c007ef055c0fd1165fa1aea924a48
BLAKE2b-256 70574b4928f9575b075d611a042ec51e9f247c05f67c24dae37f56489440c82e

See more details on using hashes here.

File details

Details for the file tradologics-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: tradologics-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for tradologics-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 2276da1f0f84aa571d22fd311da39f8d16b65e920bd879f9863d83624905f0ca
MD5 09fb0fc537835741cd78878dfefc2604
BLAKE2b-256 d37bd8d6c950011e1b94e32cb7f661116f68067ef04e17c071f471b3fcc7cf84

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