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.13.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

tradologics-0.0.13-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tradologics-0.0.13.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for tradologics-0.0.13.tar.gz
Algorithm Hash digest
SHA256 65c27370e7930b5fff8d2533017e77d77ada2c399b404b4afccc44eaa9cf57d0
MD5 cc5705f4b99158ef0be2ee71dec9e90b
BLAKE2b-256 662eb697620991d81ee7a0a6cee4523027be94d2236c95399d8bb51105cd3406

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tradologics-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for tradologics-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 2ab3df1092d4fd92218a81b4dcef23ef65504f3d5ae93de776d45e610eec1cc2
MD5 5b97ec316423f37b64f5f53fdafea5c6
BLAKE2b-256 623065d888e3c14f42657a0171148c413e91c41d02847e6a3c8ba70e3f7e50ea

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