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
tradologics-0.0.21.tar.gz
(10.5 kB
view hashes)
Built Distribution
Close
Hashes for tradologics-0.0.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c33a1a27b4e679cfade49ca2de35c6a9e9a9a65933a08d0490352b05ab4d4df |
|
MD5 | 953a5135cce7eb787be718b8d42e0b43 |
|
BLAKE2b-256 | b004aac1fa2129a562b330c8fd2bae51778f873ba9f7a6fae6e4aff4cc4ee187 |