Package: ts-api
ts-apiAn unofficial Python wrapper for the TradeStation API.Description•Installation•Usage•Features•Contributing•Credits•LicenseDescriptionts-api is an unofficial wrapper for the TradeStation API. It aims to be as light and unopinionated as possible, offering an elegant programmatic interface over each endpoint. Notable functionality includes:Login and authenticationMarketData, Brokerage, and Order Execution endpointsOptions chainsTrades and trade managementAccount info and preferencests-api is very much a work in progress and is currently not feature complete. See theIssuesto make a suggestion.In-flight features include:Streaming Client endpointsHelpers for complicated dictionary request endpointsWhy ts-api?ts-api has two core goals:Simplify the OAuth authentication procedure.This includes initial registration, refresh tokens, and automatic re-authorization of access tokensBe as lightweight as possible.ts-api takes in the base datatypes and returns the raw responses. No heavy logic or validation. Optional assistance with building orders and complex order groups is in the roadmap for this rather complex task.Installation# Install ts-apipipinstallts-apiUsage# Import the TradeStation auth packageimportts.authasa# Establish your clientclient=a.easy_client("key","secret","redirect")# Call your endpointaccount=client.user_accounts("user_id")FeaturesCurrently ts-api supports all non-streaming routes found in theTradeStation API Specification. Details for each route can be found below.Documentation for Supported API EndpointsAll URIs are relative tohttps://api.tradestation.comClassMethodHTTP requestDescriptionBrokerageApiget_accountsGET/v3/brokerage/accountsGet AccountsBrokerageApiget_balancesGET/v3/brokerage/accounts/{accounts}/balancesGet BalancesBrokerageApiget_balances_bodGET/v3/brokerage/accounts/{accounts}/bodbalancesGet Balances BODBrokerageApiget_historical_ordersGET/v3/brokerage/accounts/{accounts}/historicalordersGet Historical OrdersBrokerageApiget_ordersGET/v3/brokerage/accounts/{accounts}/ordersGet OrdersBrokerageApiget_positionsGET/v3/brokerage/accounts/{accounts}/positionsGet PositionsBrokerageApiget_walletsGET/v3/brokerage/accounts/{account}/walletsGet WalletsMarketDataApiget_barsGET/v3/marketdata/barcharts/{symbol}Get BarsMarketDataApiget_crypto_symbol_namesGET/v3/marketdata/symbollists/cryptopairs/symbolnamesGet Crypto Symbol NamesMarketDataApiget_option_expirationsGET/v3/marketdata/options/expirations/{underlying}Get Option ExpirationsMarketDataApiget_option_risk_rewardPOST/v3/marketdata/options/riskrewardGet Option Risk RewardMarketDataApiget_option_spread_typesGET/v3/marketdata/options/spreadtypesGet Option Spread TypesMarketDataApiget_option_strikesGET/v3/marketdata/options/strikes/{underlying}Get Option StrikesMarketDataApiget_quote_snapshotsGET/v3/marketdata/quotes/{symbols}Get Quote SnapshotsMarketDataApiget_symbol_detailsGET/v3/marketdata/symbols/{symbols}Get Symbol DetailsOrderExecutionApicancel_orderDELETE/v3/orderexecution/orders/{orderID}Cancel OrderOrderExecutionApiconfirm_group_orderPOST/v3/orderexecution/ordergroupconfirmConfirm Group OrderOrderExecutionApiconfirm_orderPOST/v3/orderexecution/orderconfirmConfirm OrderOrderExecutionApiget_activation_triggersGET/v3/orderexecution/activationtriggersGet Activation TriggersOrderExecutionApiplace_group_orderPOST/v3/orderexecution/ordergroupsPlace Group OrderOrderExecutionApiplace_orderPOST/v3/orderexecution/ordersPlace OrderOrderExecutionApireplace_orderPUT/v3/orderexecution/orders/{orderID}Replace OrderOrderExecutionApiroutesGET/v3/orderexecution/routesGet RoutesNot-yet Supported API EndpointsAll URIs are relative tohttps://api.tradestation.comClassMethodHTTP requestDescriptionBrokerageApistream_ordersGET/v3/brokerage/stream/accounts/{accountIds}/ordersStream OrdersBrokerageApistream_orders_by_order_idGET/v3/brokerage/stream/accounts/{accountIds}/orders/{ordersIds}Stream Orders by Order IdBrokerageApistream_positionsGET/v3/brokerage/stream/accounts/{accountIds}/positionsStream PositionsBrokerageApistream_walletsGET/v3/brokerage/stream/accounts/{account}/walletsStream WalletsMarketDataApiget_option_chainGET/v3/marketdata/stream/options/chains/{underlying}Stream Option ChainMarketDataApiget_option_quotesGET/v3/marketdata/stream/options/quotesStream Option QuotesMarketDataApistream_barsGET/v3/marketdata/stream/barcharts/{symbol}Stream BarsMarketDataApistream_market_depth_aggregatesGET/v3/marketdata/stream/marketdepth/aggregates/{symbol}Stream Market Depth AggregatesMarketDataApistream_market_depth_quotesGET/v3/marketdata/stream/marketdepth/quotes/{symbol}Stream Market Depth QuotesMarketdataApisearch_symbolsGET/v2/data/symbols/search/{criteria}Search for SymbolsMarketdataApisuggestsymbolsGET/v2/data/symbols/suggest/{text}Suggest SymbolsMarketDataApiget_quote_change_streamGET/v3/marketdata/stream/quotes/{symbols}Stream QuotesContributingStart contributing right nowOpen an issueIf you've found a problem, you can open anissue!Solve an issueIf you have a solution to one of the open issues, you will need to fork the repository and submit a pull request.CreditsBig thanks to the great people on Discord. You know who you are.LicenseMIT LicenseGitHub@pattertj