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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tradologics-0.0.19.tar.gz
.
File metadata
- Download URL: tradologics-0.0.19.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80da3253651a83e936bee58a581cb4b18906763eeb7af2a8034ca974ba7a7c8d |
|
MD5 | 787c9376581a51882bceb66c544ed277 |
|
BLAKE2b-256 | 1c187de328cbd3a1583c3e4f842fcaec50be20b7e49c4c471842c1e529a76793 |
File details
Details for the file tradologics-0.0.19-py3-none-any.whl
.
File metadata
- Download URL: tradologics-0.0.19-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b8e4984df55d29292dd9307c216695dd69c481e3ba410f99f34b19a1f736fd7 |
|
MD5 | b9983e60c79fc4c17b5384b651be36f5 |
|
BLAKE2b-256 | eb7437b15384e935df12f0ed92f70b3f40e5c1060a7d7a742c5dccbed5dcef02 |