An unofficial, sync/async SDK for Tradestation!
Project description
tradestation
A simple, unofficial, sync/async SDK for Tradestation built on their public API. This will allow you to create trading algorithms for whatever strategies you may have quickly and painlessly in Python.
Features
- Up to 10x less code than using the API directly
- Sync/async functions for all endpoints
- Powerful websocket implementation for account alerts and data streaming, with support for auto-reconnection and reconnection callbacks
- 100% typed, with Pydantic models for all JSON responses from the API
- 95%+ unit test coverage
- Comprehensive documentation
- Utility functions for timezone calculations, futures monthly expiration dates, and more
Installation
$ pip install tradestation
Initial setup
Tradestation uses OAuth for secure authentication to the API. In order to obtain access tokens, you need to authenticate with OAuth 2's authorization code flow, which requires a local HTTP server running to handle the callback. Fortunately, the SDK makes doing this easy:
from tradestation.oauth import login
login()
This will let you authenticate in your local browser. Fortunately, this only needs to be done once, as afterwards you can use the refresh token to obtain new access tokens indefinitely.
Creating a session
A session object is required to authenticate your requests to the Tradestation API.
You can create a simulation session by passing is_test=True.
from tradestation import Session
session = Session('api_key', 'secret_key', 'refresh_token')
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tradestation-0.2.tar.gz.
File metadata
- Download URL: tradestation-0.2.tar.gz
- Upload date:
- Size: 66.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5e692ea9e4a0dfdc45c687ed7e6afd7a45c8b500e3ff17487ea8c42d9c66b7c
|
|
| MD5 |
5b8d54b4f27ef79d5a181886160375cb
|
|
| BLAKE2b-256 |
4b3bc17018516597640769085c221a3878ae9e8bdb50f63a3e61435f9ae70cba
|
Provenance
The following attestation bundles were made for tradestation-0.2.tar.gz:
Publisher:
python-publish.yml on tastyware/tradestation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradestation-0.2.tar.gz -
Subject digest:
d5e692ea9e4a0dfdc45c687ed7e6afd7a45c8b500e3ff17487ea8c42d9c66b7c - Sigstore transparency entry: 164298959
- Sigstore integration time:
-
Permalink:
tastyware/tradestation@0ed5d2c93f1b2cdf8fa4de059fb75dde49f3ba81 -
Branch / Tag:
refs/tags/v0.2 - Owner: https://github.com/tastyware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0ed5d2c93f1b2cdf8fa4de059fb75dde49f3ba81 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tradestation-0.2-py3-none-any.whl.
File metadata
- Download URL: tradestation-0.2-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
857374b772e50a7abf84ecadfa1f1c7f5b1e2698a44979f3ad3fff2f0d9fb08d
|
|
| MD5 |
e41bac22ebe2cfac1e84b47b61cf6867
|
|
| BLAKE2b-256 |
936629c4f33f813577ba88d3c63067ae26ea562fb9cd665dd4be42fbca44765b
|
Provenance
The following attestation bundles were made for tradestation-0.2-py3-none-any.whl:
Publisher:
python-publish.yml on tastyware/tradestation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradestation-0.2-py3-none-any.whl -
Subject digest:
857374b772e50a7abf84ecadfa1f1c7f5b1e2698a44979f3ad3fff2f0d9fb08d - Sigstore transparency entry: 164298961
- Sigstore integration time:
-
Permalink:
tastyware/tradestation@0ed5d2c93f1b2cdf8fa4de059fb75dde49f3ba81 -
Branch / Tag:
refs/tags/v0.2 - Owner: https://github.com/tastyware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0ed5d2c93f1b2cdf8fa4de059fb75dde49f3ba81 -
Trigger Event:
release
-
Statement type: