Releases: tastyware/tastytrade
tastyware/tastytrade:v10.2.1
What's Changed
- Fixes a bug with some futures options (eg /ZN) where dates had a format that pydantic couldn't parse
Full Changelog: v10.2.0...v10.2.1
tastyware/tastytrade:v10.2.0
What's Changed
- Catch the WebSocket ConnectionClosedError by @quantx-heiko in #242
This PR adds disconnect callbacks to the streamers, allowing for executing arbitrary code when the websocket disconnects. This is distinct from the reconnect callback, since the reconnect callback only fires once the connection is re-established, but the disconnect callback fires right away.async def disconnect_callback(streamer: DXLinkStreamer): print("Disconnected!") async with DXLinkStreamer(session, disconnect_fn=disconnect_callback) as streamer: ...
- handling rare exceptions in the heartbeat methods for aesthetic reasons
- fixes #244 by adding new AlertStreamer type. Also, if new types are discovered in the future, they will be non-fatal for better stability.
New Contributors
- @quantx-heiko made their first contribution in #242
Full Changelog: v10.1.1...v10.2.0
tastyware/tastytrade:v10.1.1
What's Changed
- Fixes #239
- Renames
tastytrade.order.TradeableTastytradeJsonDataclasstoTradeableTastytradeData
Full Changelog: v10.1.0...v10.1.1
tastyware/tastytrade:v10.1.0
What's Changed
- add market data endpoints by @Graeme22 in #237
Tastytrade recently added very useful new endpoints for fetching market data without using the streamer. This is great for many scenarios where you just want to grab prices once, rather than listen to them continually. This PR adds them to the SDK:This data contains tons of useful information, like quotes, last trade price, and OHLC prices for the day! It can also be fetched for multiple symbols at once:from tastytrade.market_data import get_market_data from tastytrade.order import InstrumentType data = get_market_data(session, "SPY", InstrumentType.EQUITY)
from tastytrade.market_data import get_market_data_by_type data = get_market_data_by_type( session, indices=["SPX", "VIX"], cryptocurrencies=["ETH/USD", "BTC/USD"], equities=["SPLG", "SPY"], futures=["/MCLG6", "/MCLF6"], future_options=["./MCLM5MW2K5 250509C62.5", "./MCLM5MW2K5 250509P65.75"], options=["SPLG 250516C00048000", "SPLG 250516P00054000"], )
- adds new backtesting-related endpoints from API docs:
cancel: cancels a running backtestdelete: deletes an active backtesting sessionget: fetches a past backtest by IDavailable_parameters: gets a list of valid symbols and dates for backtests
- adds
get_futures_holidaystotastytrade.market_sessionsfor futures exchange calendars - Renames heavily used internal class
TastytradeJsonDataclasstoTastytradeData __str__and__repr__for all Pydantic models now don't print fields that areNoneby default, making for cleaner debugging
Full Changelog: v10.0.1...v10.1.0
tastyware/tastytrade:v10.0.1
What's Changed
- Documentation switched to material theme from mkdocs
- Adds PyPI trove classifiers
Full Changelog: v10.0.0...v10.0.1
tastyware/tastytrade:v10.0.0
What's Changed
-
overload to simplify classmethods by @Graeme22 in #230
Previously, classmethods were overly verbose, leading to patterns like this:from tastytrade import Account account = Account.get_account(session, "5WX01234") accounts = Account.get_accounts(session)
This release changes naming conventions across all Pydantic models to use a shortened name which combines the single and multiple fetches into a single, overloaded function:
from tastytrade import Account account = Account.get(session, "5WX01234") accounts = Account.get(session)
This preserves type hints thanks to
typing.overload, where the return type is inferred from the number of arguments.
Here's a list of classes affected by this change by module:tastytrade.account:Accounttastytrade.instruments:Cryptocurrency,Equity,Option,NestedOptionChain,FutureProduct,Future,FutureOptionProduct,FutureOption,Warrant,NestedFutureOptionChaintastytrade.watchlists:PrivateWatchlist,PublicWatchlist(previouslyWatchlist)
-
Watchlist split into two subclasses,
PrivateWatchlistandPublicWatchlist -
switch to Semantic Versioning
-
AlertStreamernow works withOAuthSession
Full Changelog: v9.13...v10.0.0
tastyware/tastytrade:v9.13
What's Changed
- Fixes bug with certification session which prevents creation in v9.12
Full Changelog: v9.12...v9.13
tastyware/tastytrade:v9.12
What's Changed
NestedOptionChain.deliverablesis now optional, as sandbox sessions often don't include it- Add session token and streamer token expiration information to session
- Better error handling and reconnection callbacks in streamer
Full Changelog: v9.11...v9.12
tastyware/tastytrade:v9.11
What's Changed
- added refresh_interval to subscribe method by @CosmicTrader in #221
Frequency of streamed events can now be changed on a per-event basis:
await streamer.subscribe(Quote, ['AAPL', 'MSFT'], refresh_interval=0.5)- added a new session,
OAuthSession, for users who have been granted Tastytrade OAuth access
from tastytrade.session import OAuthSession
session = OAuthSession('provider_secret', 'refresh_token')This session can be used in most of the same places as a normal session, allowing you to manage connected user accounts.
- fixes bug in #222 due to tastytrade changing their account streamer API
New Contributors
- @CosmicTrader made their first contribution in #221
Full Changelog: v9.10...v9.11
tastyware/tastytrade:v9.10
What's Changed
Adds a new module, market_sessions to the SDK which implements the new API endpoints used for checking exchange status and market calendars. This is an alternative to some of the utility functions in tastytrade.utils which uses Tastytrade endpoints. Check out the new docs page here!
This adds a new optional parameter, proxy, to the Session class to proxy all requests through a proxy server. Proxies will also apply to all web socket connections (so DXLinkStreamer and AlertStreamer) created with that session.
session = Session('username', 'password', proxy="http://user:[email protected]:8080")
accounts = Account.get_accounts(session) # proxied!
async with DXLinkStreamer(session) as streamer: # proxied!
# ...- sessions now have a context manager, which can be used like this:
with Session('username', 'password') as session:
# ...which is equivalent to:
session = Session('username', 'password')
session.destroy()Full Changelog: v9.9...v9.10