Skip to content

Releases: tastyware/tastytrade

tastyware/tastytrade:v10.2.1

13 May 17:11

Choose a tag to compare

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

06 May 15:39

Choose a tag to compare

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

Full Changelog: v10.1.1...v10.2.0

tastyware/tastytrade:v10.1.1

30 Apr 17:02

Choose a tag to compare

What's Changed

  • Fixes #239
  • Renames tastytrade.order.TradeableTastytradeJsonDataclass to TradeableTastytradeData

Full Changelog: v10.1.0...v10.1.1

tastyware/tastytrade:v10.1.0

29 Apr 16:27
d4d27ed

Choose a tag to compare

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:
    from tastytrade.market_data import get_market_data
    from tastytrade.order import InstrumentType
    data = get_market_data(session, "SPY", InstrumentType.EQUITY)
    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_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 backtest
    • delete: deletes an active backtesting session
    • get: fetches a past backtest by ID
    • available_parameters: gets a list of valid symbols and dates for backtests
  • adds get_futures_holidays to tastytrade.market_sessions for futures exchange calendars
  • Renames heavily used internal class TastytradeJsonDataclass to TastytradeData
  • __str__ and __repr__ for all Pydantic models now don't print fields that are None by default, making for cleaner debugging

Full Changelog: v10.0.1...v10.1.0

tastyware/tastytrade:v10.0.1

23 Apr 17:49

Choose a tag to compare

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

11 Apr 19:47

Choose a tag to compare

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: Account
    • tastytrade.instruments: Cryptocurrency, Equity, Option, NestedOptionChain, FutureProduct, Future, FutureOptionProduct, FutureOption, Warrant, NestedFutureOptionChain
    • tastytrade.watchlists: PrivateWatchlist, PublicWatchlist (previously Watchlist)
  • Watchlist split into two subclasses, PrivateWatchlist and PublicWatchlist

  • switch to Semantic Versioning

  • AlertStreamer now works with OAuthSession

Full Changelog: v9.13...v10.0.0

tastyware/tastytrade:v9.13

01 Apr 21:39

Choose a tag to compare

What's Changed

  • Fixes bug with certification session which prevents creation in v9.12

Full Changelog: v9.12...v9.13

tastyware/tastytrade:v9.12

01 Apr 20:43

Choose a tag to compare

What's Changed

  • NestedOptionChain.deliverables is 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

20 Mar 21:12

Choose a tag to compare

What's Changed

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

Full Changelog: v9.10...v9.11

tastyware/tastytrade:v9.10

17 Feb 18:13
dc24afb

Choose a tag to compare

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