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.0.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for tradernet_api-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5c44c9482c789ffc0b12deecbae5f798f21c567ac8222c98cba50524084b2bd |
|
MD5 | e21dba7c3713e80335f64260e0cd3c1d |
|
BLAKE2b-256 | eb9370f00f8c5cab83437a956965bf6fe9748ee59dd062e6c32d937a5bff2914 |