Releases: tastyware/tastytrade
tastyware/tastytrade:v9.2
What's Changed
- Removes support for Python 3.8, which has now reached end of life
- Uses Python 3.9's simpler typing, removing the need to import
typing.Listandtyping.Dict - Slightly improves streamer typing using bounded generic
TypeVars - Switches to the standard library's
ZoneInfoinstead of usingpytz - Fixes a bug in
Equity.get_active_equitieswhere some results may not contain thelisted_marketfield
Full Changelog: v9.1...v9.2
tastyware/tastytrade:v9.1
What's Changed
Small release fixing a pretty important bug which prevents placing test (dry_run=True) orders.
Full Changelog: v9.0...v9.1
tastyware/tastytrade:v9.0
New major release! Warning: BREAKING CHANGES! See below.
This is a large release with many changes, so please report any issues you run across!
What's Changed
-
Add sync/async functionality for all requests by @Graeme22 in #168
Simply add thea_prefix to the sync method name and boom, async!
Here's how it looks:acc = await Account.a_get_account(session, account_number)
-
Move from price effect to +/- for numbers by @Graeme22 in #169
Previously, most number fields in the API were represented with two separate fields: one for the value, another for the sign (which in the SDK is calledPriceEffect). This led to less readability and a lot of lines of code that looked like this:value *= -1 if price_effect == PriceEffect.DEBIT else 1
However, as of this release, we can just use positive numbers for credits and negative ones for debits... Much easier! So this example from the old docs of building an order:
order = NewOrder( time_in_force=OrderTimeInForce.DAY, order_type=OrderType.LIMIT, legs=[leg], # you can have multiple legs in an order price=Decimal('10'), # limit price, $10/share for a total value of $50 price_effect=PriceEffect.DEBIT )
Became this:
order = NewOrder( time_in_force=OrderTimeInForce.DAY, order_type=OrderType.LIMIT, legs=[leg], # you can have multiple legs in an order price=Decimal('-10') # limit price, $10/share debit for a total value of $50 )
Under the hood interactions with the API remain unchanged, but for SDK users this should make life much more pleasant.
-
better typing for streamer, orders by @Graeme22 in #170
Certain functions for the streamer ended up not working very cleanly with type checkers. So, with a few typing tricks, the streamer functions have changed their parameters, but in exchange we get type hints and a smoother workflow. Here's how the streamer worked before:from tastytrade.dxfeed import EventType async with DXLinkStreamer(session) as streamer: await streamer.subscribe(EventType.QUOTE, ['SPY']) quote = await streamer.get_event(EventType.QUOTE)
And here's how it looks now:
from tastytrade.dxfeed import Quote async with DXLinkStreamer(session) as streamer: await streamer.subscribe(Quote, ['SPY']) quote = await streamer.get_event(Quote)
This makes life a lot easier for anyone doing type checking or even using an IDE, so pretty much everyone! The type you pass in will not only control the type of event you receive, but also the inferred return type.
-
add order chains, add is_market_open_on util by @Graeme22 in #171
This adds a new function to theAccountclass allowing for fetching order chains (groups of trades in the same symbol used to track open, rolls, and close). Previously these were only available through theAlertStreamerfor existing postions, but now you can query over a time range for a given underlying:chains = account.get_order_chains(session, 'SPX', start_time, end_time)
Also, adds a utility function to check if the market is open on a specific date (defaults to today).
-
test coverage is now better and added for all async tests as well. Using
pytest-aioto easily run all tests in the same event loop. -
update docs with new functionality
-
switch to pyright over mypy for type checking
-
switch to Python 3.8 for building
-
replace several deprecated functions from pydantic v1
-
use
typing_extensions.Selffor classmethods -
add
CustomerandUserdataclasses for data returned bySession -
add tests for
dxfeedmodule -
unclutter
tastytradepackage-level exports, which are now restricted to justAccount,AlertStreamer,DXLinkStreamer,Session, andWatchlist -
no longer using
Optionaltypes for some common, important fields, such asPlacedOrder.idandOption.streamer_symbol. -
add
unsubscribe_allfunction to streamer to unsubscribe from all events of a certain type -
return type of
Account.place_orderandAccount.place_complex_ordernow returntastytrade.order.PlacedOrderResponseandtastytrade.order.PlacedComplexOrderResponserespectively, which are guaranteed to contain theorderorcomplex_orderproperties.
Full Changelog: v8.5...v9.0
tastyware/tastytrade:v8.5
Re-release of v8.4 with packaging fixed. Features:
- Adds backtesting features! Currently in beta, so please report any issues.
- Switches to
httpxoverrequests - Fixes #165, adding new parameters to
Account.get_balance_snapshots
Full Changelog: v8.3...v8.5
tastyware/tastytrade:v8.3
Small bug fixes: #163 as well as internal bugs having to do with cryptocurrencies.
Full Changelog: v8.2...v8.3
tastyware/tastytrade:v8.2
What's Changed
Full Changelog: v8.1...v8.2
tastyware/tastytrade:v8.1
What's Changed
- Prepare v8.1: use httpx Session, prepare for async version, combine Production and Certification sessions by @Graeme22 in #158
Full Changelog: v7.9...v8.1
tastyware/tastytrade:v7.9
Fix candle bug, typing changes for order_id fields
Full Changelog: v7.8...v7.9
tastyware/tastytrade:v7.8
What's Changed
Full Changelog: v7.7...v7.8