Public API client for working with the Tradernet platform.
Project description
Tradernet API
Public API client for working with the Tradernet platform.
Official API documentation
Installation
Install package
pip install -U tradernet-api
or
poetry add tradernet-api@latest
Getting Started
from tradernet_api.api import API
# Setup client
api_client = API(api_key="YOUR API KEY", secret_key="YOUR SECRET KEY")
# Get only active orders by default
api_client.get_orders()
# Get all orders
api_client.get_orders(active_only=False)
# Get ticker info
api_client.get_ticker_info(ticker="AAPL")
# Send order to the platform
api_client.send_order(ticker="AAPL", side="buy", margin=True, count=1, order_exp="day", market_order=True)
api_client.send_order(ticker="MSFT", side="sell", margin=False, count=2, order_exp="ext", limit_price=200)
api_client.send_order(ticker="TSLA", side="sell", margin=True, count=3, order_exp="gtc", stop_price=1000)
# Delete/cancel active order
api_client.delete_order(order_id=123456789)
# Set stop loss and/or take profit
api_client.set_stop_order(ticker="AAPL", stop_loss=1, take_profit=2)
🛡 License
This project is licensed under the terms of the MIT
license. See LICENSE for more details.
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
tradernet_api-1.1.2.tar.gz
(8.6 kB
view details)
Built Distribution
File details
Details for the file tradernet_api-1.1.2.tar.gz
.
File metadata
- Download URL: tradernet_api-1.1.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35d63f245abf7fdc42f87ca216117295cb9919867a2b7a3373c8604a0df78b30 |
|
MD5 | f54f37966a373af20055dc2db1808735 |
|
BLAKE2b-256 | 73d6e460a607248df50c75dbe6002d29a14da7538961055f433a8bae4ef70914 |
File details
Details for the file tradernet_api-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: tradernet_api-1.1.2-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e90d21416c6707c66438157b1752ca6c5b5a1c1e9a01b72f3dc81351fb9d8a4 |
|
MD5 | 84a0da7f6d89a26288a73798a0897da3 |
|
BLAKE2b-256 | 48fbdbf8e8560fb4451e24279f7629137ded56892f0c37d5cfc72fd6b03236b1 |