All Projects → areed1192 → tradestation-python-api

areed1192 / tradestation-python-api

Licence: MIT license
A Python Client library for the TradeStation API.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tradestation-python-api

Jiji2
Forex algorithmic trading framework using OANDA REST API.
Stars: ✭ 211 (+205.8%)
Mutual labels:  finance, trading
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+259.42%)
Mutual labels:  finance, trading
Philadelphia
Low-latency Financial Information Exchange (FIX) engine for the JVM
Stars: ✭ 219 (+217.39%)
Mutual labels:  finance, trading
Trade Frame
c++ based application for testing options based automated trading ideas using DTN IQ real time data feed and Interactive Brokers (TWS API) for trade execution.
Stars: ✭ 187 (+171.01%)
Mutual labels:  finance, trading
wolf
🐺 Binance trading bot for node.js
Stars: ✭ 76 (+10.14%)
Mutual labels:  finance, trading
Mlfinlab
MlFinLab helps portfolio managers and traders who want to leverage the power of machine learning by providing reproducible, interpretable, and easy to use tools.
Stars: ✭ 2,676 (+3778.26%)
Mutual labels:  finance, trading
Trading Backtest
A stock backtesting engine written in modern Java. And a pairs trading (cointegration) strategy implementation using a bayesian kalman filter model
Stars: ✭ 247 (+257.97%)
Mutual labels:  finance, trading
Py Market Profile
A library to calculate Market Profile (aka Volume Profile) for financial data from a Pandas DataFrame.
Stars: ✭ 153 (+121.74%)
Mutual labels:  finance, trading
Mida
The open-source and cross-platform trading framework
Stars: ✭ 263 (+281.16%)
Mutual labels:  finance, trading
cira
Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.
Stars: ✭ 21 (-69.57%)
Mutual labels:  finance, trading
Mixture model trading public
Stars: ✭ 166 (+140.58%)
Mutual labels:  finance, trading
portfoliolab
PortfolioLab is a python library that enables traders to take advantage of the latest portfolio optimisation algorithms used by professionals in the industry.
Stars: ✭ 104 (+50.72%)
Mutual labels:  finance, trading
Bot18
Bot18 is a high-frequency cryptocurrency trading bot developed by Zenbot creator @carlos8f
Stars: ✭ 157 (+127.54%)
Mutual labels:  finance, trading
Awesome Quant
中国的Quant相关资源索引
Stars: ✭ 2,529 (+3565.22%)
Mutual labels:  finance, trading
Pipeline Live
Pipeline Extension for Live Trading
Stars: ✭ 154 (+123.19%)
Mutual labels:  finance, trading
Vnpy
基于Python的开源量化交易平台开发框架
Stars: ✭ 17,054 (+24615.94%)
Mutual labels:  finance, trading
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (+91.3%)
Mutual labels:  finance, trading
Interactivebrokers Algo System
Java/MySQL live algorithmic trading using Interactive Brokers API
Stars: ✭ 151 (+118.84%)
Mutual labels:  finance, trading
Alpaca Backtrader Api
Alpaca Trading API integrated with backtrader
Stars: ✭ 246 (+256.52%)
Mutual labels:  finance, trading
hurtrade
An Open Source Forex Trading Platform
Stars: ✭ 22 (-68.12%)
Mutual labels:  finance, trading

Tradestation Python API

A Python Client library for the TradeStation API.

Table of Contents

Overview

The unofficial Python API client library for TradeStation allows individuals with TradeStation accounts to manage trades, pull historical and real-time data, manage their accounts, create and modify orders all using the Python programming language.

To learn more about the TradeStation API, please refer to the official documentation.

What's in the API

  • Authentication - access tokens, refresh tokens, request authentication.
  • Accounts & Trading
  • Symbols
  • Index
  • Orders
  • Paper Trading
  • Quotes
  • Transaction History

Requirements

The following requirements must be met to use this API:

  • A TradeStation account, you'll need your account password and account number to use the API.
  • A TradeStation Developer API Key
  • A Redirect URI, sometimes called Redirect URL
  • Python 3.8 or later.

API Key and Credentials

Each TradeStation API request requires a TradeStation Developer API Key, a consumer ID, an account password, an account number, and a redirect URI. API Keys, consumer IDs, and redirect URIs are generated from the TradeStation developer portal. To set up and create your TradeStation developer account, please refer to the official documentation.

Additionally, to authenticate yourself using this library, you will need to provide your account number and password for your main TradeStation account.

Important: Your account number, an account password, consumer ID, and API key should be kept secret.

Installation

pip install -e .

Usage

This example demonstrates how to login to the API and demonstrates sending a request using the quotes, and stream_bars_start_date endpoint, using your API key.

# Import the client
from ts.client import TradeStationClient

# Create the Client.
ts_client = TradeStationClient(
    username="USERNAME",
    client_id="CLIENT_ID",
    client_secret="CLIENT_SECRET",
    redirect_uri="REDIRECT_URI",
    paper_trading="PAPER_TRADING"
)

# Get quotes for Oil Futures.
ts_client.quotes(symbols=['@CL'])

# Stream quotes for Amazon.
ts_client.stream_quotes_changes(symbols=['AMZN'])

# Stream bars for a certain date.
ts_client.stream_bars_start_date(
    symbol='AMZN',
    interval=5,
    unit='Minute',
    start_date='02-25-2020',
    session='USEQPreAndPost'
)

Features

Authentication Workflow Support

Automatically will handle the authentication workflow for new users, returning users, and users with expired tokens (refresh token or access token).

Request Validation

For certain requests, in a limited fashion, it will help validate your request when possible. For example, when using the get_bars endpoint, it will automatically validate that the market you're requesting data from is one of the valid options.

Documentation and Resources

Support these Projects

Patreon: Help support this project and future projects by donating to my Patreon Page. I'm always looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.

YouTube: If you'd like to watch more of my content, feel free to visit my YouTube channel Sigma Coding.

Hire Me: If you have a project, you think I can help you with feel free to reach out at [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].